Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Discussion forum for Extension Writers regarding Extension Development.
Locked
User avatar
privet.fun
Registered User
Posts: 54
Joined: Sun May 07, 2023 8:46 pm
Contact:

Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by privet.fun »

I recently created extension to my phpBB 3.3.x board which provides integration with Open AI (both ChagGPT and DALL-E) and also with several Stable Diffusion services (namely Leonardo.ai and of course Midjourney).

Here's how it looks like in real life:
ChatGPT topic/conversation example conversation history supported (up to specified number of tokens) which makes it very much human-like
It is possible to create "tuned" bots with desired personality eg Bender , April
DALL-E generations topic
Stable Diffusion Leonardo.ai generations/topic
and finally mighty and super popular Midjourney topic and there's more using latest v5.1

Implementation relies on creating board user (bot) and tying it to extension API so when user convers with bot and it would be regular board user.

Extension itself in a decent state, just need to add multilanguage support and polish a bit setup pages.
Integration with Open AI is very straightforward, you just need Open AI key (since it is paid service).
They have decent REST API, very responsive and integrates well with phpBB.

Integration with SD is not so much, actually it's quite complex.
As you probably aware there's no API for either Leonardo AI or Midjourney so I ended up writing serverless functions to scrape both and my php code calls that function and waits for results. This naturally not scalable or reusable, not at it's current iteration anyway.

Before spending time on making it public I want to see if there's any interest in above?
Should I release Open AI support firs?
Is there really any interest in that considering Open AI is not free so there will be costs involves (here's mine)

I can see how I can figure out Midjourney extension but it will require some middle-tier which for most phpBB board will be no-go.
It is possible to release it as serverless option (free tier GCP/AWS/Azure - any of these will do) but again complexity of this probably way to high for average phpBB board admin.
I was thinking of creating integration service with some small subscription monthly fee ($5..10) but again not sure if there's any demand for that.

Feel free to try above SD integration as a Telegram bot , it's 100% free (as of now)
Stable Diffusion Superbot https://t.me/stable_diffusion_superbot

Happy to answer any questions.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5871
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by thecoalman »

That's interesting to say the least, way back in the phpBB 2 days there was a bot using A.L.I.C.E. but that was just a "dumb" database driven bot.

I'm moving this to Extension Writers Discussion.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
privet.fun
Registered User
Posts: 54
Joined: Sun May 07, 2023 8:46 pm
Contact:

Re: Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by privet.fun »

thecoalman wrote: Sun May 07, 2023 9:47 pm That's interesting to say the least, way back in the phpBB 2 days there was a bot using A.L.I.C.E. but that was just a "dumb" database driven bot.
So far biggest two downsides of ChatGPT is the limit of conversation context window and lack of any knowledge past it's training date (mid 2021?).

Context window of ChatGPT v3.5 is 4K tokens (roughly 2K words in any Latin-based language) which is not enough to capture long conversations.
Here's example of somewhat long conversation, you can see I had to add cutoff post reference to provide users a hint what is really happening.
There's more elegant solution for cases like that where you can ask ChatGPT to summarize prior (long) conversation thread, store it's response locally and feed it back as a history for next round. This should allow much longer continuous thread with context but you will loose some (possibly important) nuances.
ChatGPT v4 has 8K/32K token limit which is a lot for most practical cases but pricing model of v4 is very different.
For now I will stay with v3.5 as it is priced very reasonably and just as entertaining :)
For none-Latin alphabets one token is roughly one character (from what I know) which makes above issue even more pronounced.

Second issue is what Microsoft trying to fix by combining Bing with ChatGPT (aka new Bing), it will attempt to feed you adjusted search results if there's no answer provided by ChatGPT. So far I have mixed experience with that, it seems to be work in progress on Microsoft part, it will probably improve very quickly. Since MS have full stats on what users searching for and what is not yet part or current model training set they can dynamically add that data (continuous training).
Last edited by privet.fun on Mon May 08, 2023 8:16 pm, edited 2 times in total.
User avatar
dbrewood
Registered User
Posts: 446
Joined: Tue Feb 09, 2021 9:35 am
Name: Daron Brewood
Contact:

Re: Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by dbrewood »

I'd be interested in it as long as it could be limited to certain forums.
User avatar
privet.fun
Registered User
Posts: 54
Joined: Sun May 07, 2023 8:46 pm
Contact:

Re: Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by privet.fun »

dbrewood wrote: Tue May 09, 2023 5:18 am I'd be interested in it as long as it could be limited to certain forums.
Right now for each bot you can specify list of forums where bot will reply to each new topic started and there's also separate option to specify list of forums where bot will reply every time it's quoted.

Seems like there's some interest in this extension, I'll try to release it this month.
User avatar
dbrewood
Registered User
Posts: 446
Joined: Tue Feb 09, 2021 9:35 am
Name: Daron Brewood
Contact:

Re: Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by dbrewood »

Good ndews on all :)
User avatar
privet.fun
Registered User
Posts: 54
Joined: Sun May 07, 2023 8:46 pm
Contact:

Re: Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by privet.fun »

AI Labs v 1.0.4 RC June 4, 2023 officially released https://github.com/privet-fun/phpbb_ailabs changelog
User avatar
amorino
Registered User
Posts: 55
Joined: Sat Jun 05, 2010 10:25 pm

Re: Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by amorino »

Hello @privet.fun,
many thanks for this wonderful extension
I have a couple of questions :
1- How can users continue discussion with chat gpt in a topic. For example if I asked him a 1st question what are different types of technologies and after his 1st answer I ask him which one do you prefer ?
I notice that gpet can't remember 1st question to build a second answer according to 1st and 2nd question.

2- I don't really understand these setting
What values are ok to have long answers with human like text ?
"model": "gpt-3.5-turbo",
"temperature": 0.9,
"max_tokens": 4096,
"message_tokens": 1024,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0.6,
"prefix": "",
"prefix_tokens": 0
Many thanks for your precious help
Last edited by amorino on Sun Jun 18, 2023 3:10 am, edited 2 times in total.
User avatar
privet.fun
Registered User
Posts: 54
Joined: Sun May 07, 2023 8:46 pm
Contact:

Re: Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by privet.fun »

amorino wrote: Mon Jun 12, 2023 1:36 am Hello @privet.fun,
many thanks for this wonderful extension
I have a couple of questions :
1- How can users continue discussion with chat gpt in a topic. For example if I asked him a 1st question what are different types of technologies and after his 1st answer I ask him which one do you prefer ?
I notice that gpet can't remember 1st question to build a second answer according to 1st and 2nd question.
Thank you, amorino!
To keep history going you'll need to quote AI reply (it actually doesn't need entire text, just a header with post info).
In this case follow up reply will tell you where history of conversation starts and if there were any cut of posts.
Here's example
amorino wrote: Mon Jun 12, 2023 1:36 am 2- I don't really understand these setting
What values are ok to have long answers with human like text ?
"model": "gpt-3.5-turbo",
"temperature": 0.9,
"max_tokens": 4096,
"message_tokens": 1024,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0.6,
"prefix": "",
"prefix_tokens": 0
Those are OpenAI ChatGPT params, you can see more at https://platform.openai.com/docs/api-reference/chat
Temperature (and of course model) makes most noticeable effect on generated response, you can play with them get desired results.
I intentionally exploded as much as possible to support such fine tunning and customization.
CPTOM
Registered User
Posts: 131
Joined: Fri Jul 02, 2021 1:05 am

Re: Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by CPTOM »

Thanks for this extension -- I have it running on my test board and it's pretty fun. :) One question and/or request... When I 'mention' ChatGPT for a response, I ask my question and then hit 'submit'. What I'm noticing is that the forum sits in limbo waiting for a response from ChatGPT before posting anything, and then ultimately posts my question and ChatGPT's answer at the same time. This makes it feel like the forum is freezing after I hit submit, which I fear will cause issues with users on my live board. Is there any way to make my question post as it normally would, and then have ChatGPT post its reply when it's ready, without that pause where the forum seems hung up?
User avatar
privet.fun
Registered User
Posts: 54
Joined: Sun May 07, 2023 8:46 pm
Contact:

Re: Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by privet.fun »

CPTOM wrote: Fri Jun 23, 2023 11:52 pm Thanks for this extension -- I have it running on my test board and it's pretty fun. :) One question and/or request... When I 'mention' ChatGPT for a response, I ask my question and then hit 'submit'. What I'm noticing is that the forum sits in limbo waiting for a response from ChatGPT before posting anything, and then ultimately posts my question and ChatGPT's answer at the same time. This makes it feel like the forum is freezing after I hit submit, which I fear will cause issues with users on my live board. Is there any way to make my question post as it normally would, and then have ChatGPT post its reply when it's ready, without that pause where the forum seems hung up?
Glad you liked it!
You are correct, there will be connection open for duration of communication between your forum and OpenAI API.
Depending on your server this may limit number of available connections to your server, this is more of configuration issue.
Check how's your test/dev server configured and perhaps bump number of default connections or switch to dynamic pool.
It's really should be non-issue if you have proper configuration since majority of the time it's just waiting for OpenAI to reply (waiting on POST) so it will not consume any server resources, except one connection slot.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Public release of extension for Open AI (ChatGPT+DALLE), Stable Diffusion and Midjourney?

Post by Paul »

Extensions writers discussion is not for extension support. Please post in the extensions in development forum for further support.
Locked

Return to “Extension Writers Discussion”