Home Artists Posts Import Register

Content

UPDATE 9/11/2023

In more recent versions, the "--chat" parameter was removed and having it set might prevent OB from starting. I updated the guide to remove that parameter from section "4.Configure". For people that have problems with OB starting, you can edit the webui.py file from the OoobaBooga folder and remove the "--chat" parameter, and keep only something like CMD_FLAGS = '--api'.


UPDATE 8/25/2023
In more recent updates of OobaBooga, for Llama or Llama2 AI models like some that I recommended in this post (they have llama2 in their name) it's recommended to use the Model loader ExLlama for speed when loading a model in the Model tab. For vam purposes, if you get bad performance, turning down the max_seq_len variable should help a bit at the cost of making the AI more forgetful.

ABOUT

My old tutorial is obsolete already so I'm posting a quick new one for people that want to update their old version or get started with local text AI. This tutorial doesn't require any other previous setup.

There are a few alternatives to running local AI and many AI models to choose from. This solution is the best in terms of both quality & speed that I found, so I'll focus just on it to keep things simple and efficient. I'l post at the bottom some other alternatives too.

INSTALL

1. Download files

Download files from https://github.com/oobabooga/one-click-installers (Code > Download zip). Extract them to some new folder where you want oobabooga to be installed.

2. Run setup

Run start_windows.bat. It will take a few minutes. When asked about GPU, pick Nvidia (or the other variants if you don't have an nvidia card, the performance will not be as good though and some of the later settings might not work)

3. Pick a model

When the setup is done it might ask you to pick an initial model to download. You can paste this: PygmalionAI/pygmalion-350m

This will install this tiny AI model https://huggingface.co/PygmalionAI/pygmalion-350m which is good for testing things. You can add as many models as you want later from the Models tab in the UI:

You can copy paste a code from hugginface from a model like user/model. You can get that from the copy button next to the models names:

The models will have lots of nerdy tags, here's a quick glossary:

4bit or 3bit - These mean that the model has been optimized to be smaller. You definitely want models that have this. It will increase performance a lot and the model swill be smaller in file size.

350M,6B,7B, 70B etc - these are number of millions or billions parameters the model has. The more it has, the smarter it is but it will respons slower. For 6-8GB GPU cards I think 7B is the recommended size.

GPTQ vs GGML - GPTQ versions are better for nvidia cards. GGML are for users that want to run the AI on the CPU instead of the graphic cards, that's usually needed for AMD cards.

Some models I recommend for nvidia cards:
nsfw - Monero/Pygmalion-Metharme-7b-4bit-TopScore
nsfw bigger - notstoic/pygmalion-13b-4bit-128g
smart: TheBloke/Llama-2-7b-Chat-GPTQ
smart bigger: TheBloke/Llama-2-13B-chat-GPTQ

For AMD:
nsfw : TehVenom/Pygmalion-7b-4bit-Q4_1-GGML
smart: TheBloke/Llama-2-7B-Chat-GGML

4. Configure

You can edit in notepad or any text editor the file webui.py in the folder where you installed OobaBooga. You have to look for the line with "CMD_FLAGS" in it, and add --api to it to enable the OobaBooga API (the interface that allows other programs to send commands to oobabooga). Like this for example CMD_FLAGS = '--api'. If you have multiple parameters they can be separated by space like CMD_FLAGS = '--param1 --param2 --api'

  • --api - will enable the OobaBooga api to allow other local software to connect to it, necessary for Alive to get AI messages

After you make this change you might want to restart OB to make sure everything works fine.

5. Run

Now when you run start_windows.bat, if everything went ok you'll see something like this:

You can then go to http://127.0.0.1:7860/ in any browser and you should see the OobaBooga interface.

6. If you really like it

You can support oobabooga here https://ko-fi.com/oobabooga and help and reward him to update it and make it better. At some point a few weeks ago he actually took it down for a while and almost quit due to haters, which would have been a big shame.

ALTERNATIVES TO OOBABOOGA

For AMD cards, and allegedly better performance in general, there's also this: https://github.com/0cc4m/koboldcpp. People seem to use it a lot these days but for me after a few quick tests it's slower.  Maybe for people that try to run big/huge AI models this approach is better, I only played around with small AI models (7B).

Koboldcpp is simpler to install, you can download just the executable here https://github.com/LostRuins/koboldcpp/releases/latest and when you run it, it will ask for a .bin file which is the AI model. It runs on the CPU rather than the GPU so the models are a bit different, you can find them marked as ggml: https://huggingface.co/models?sort=likes&search=ggml

There's also KoboldAI https://github.com/KoboldAI/KoboldAI-Client but at the time of writing this it doesn't support the 4bit models which are a must imo for local casual use.

In Alive for now there's only support for OobaBooga. The other alternatives won't work with VAM.

Comments

Anonymous

Chat functionality is quite impressive. I was surprised that the ai was aware of its atom name in VAM. In the future, it would be great to have the ability to set a custom context string describing the ai character

Tim

The AI acted as an assistant which it not good, can you make it act like a real girlfriend that would be nice.

SPQRAeternum

You mean in the oobabooga web ui, not in Alive, right? If yes then for the OB web ui just make sure you're in chat mode (interface mode > mode > chat), then you'll see a Chat tab where you can customize the AI or load preset character cards. You can google for "reddit tavern ai cards" and find lots of them and you can put them in \text-generation-webui\characters. There's also an example character that you can load (Chat settings > Character > Example) that shows how you can set the character info

Anonymous

Anyway to use OpenAI keys instead of a local model like sillytavern does?

SPQRAeternum

That's not an option in oobabooga to my knowledge. It was built to interface & handle local AI models

ToTheWindow

I really need some help understanding using Oobabooga in Alive. I have Oobabooga up, functional and configured for the API. I have Alive configured for the local API endpoint. Now what? Do I understand right that you need an Android to chat? And you have to "buy" it? I don't understand what's going on there at all and I can find no information on it. Believe me, I've looked. So, what do I need to do to have a Oobabooga chat within Alive? Or are we not there yet?

SPQRAeternum

In V50 in the services app Services > Text AI you have to enable Oobabooga. You'll see Status: Connected if it detects that OB is running in the background. Yes, androids > android > chat is for the chat feature in the latest versions. There's no information because it's work in progress and things change, I think I changed chat like 3 times already. Next time I work on that side of things, it will change considerably again. Lots of things to do. The Androids thing is a very quick structure I put together as the foundation of a character system. I don't want chat to be disconnected, to talk to a vam person atom in a scene like an episodic thing in a void, already did that in older versions and felt like a dead end. The goal is to add continuity to characters and that's where androids come in play. Yeah, there's a basic buy mechanic to create them. I'd rather push it towards gameplay rather than software where you load files, etc There's more stuff you might want to look into: services > speech allows TTS & STT but you need to run my TextAudioTool in the background. Services > Local Assistant adds an extra layer of chatbot logic before sending it to the AI (think older chatbots). There are some commands I added, you should be able for example to trigger any vam buttons like "trigger SomeButtonName" or "trigger some button name". So basically you can link the AI to do anything that vam is capable. It's also possible to do your own commands and more complex responses. If you write "echo some text" the AI will say "some text" for example. A good way to test TTS It's not exactly oobabooga chat, it's more like direct interaction with the AI model loaded in oobabooga. There's different formatting that the OB webui, stuff I added to try to make tiny models (like pygmalion-350M) work better and not get stuck. There's more stuff but you'll have to go through the posts. I don't do guides because I change things very often. Sentiment analysis on AI responses (positive/negative) for example translates into character expressions in vam. There's procedural nodding sometimes on negative/positive answers. But it's WIP, I didn't have a lot of time to work on this part and lots or people here are mad when I work on that and get very pissy, they want me to make vam triggers and sliders till I die, they're not AI fans. But more to come

Saint66

Very good guide for beginners, good writing! Anyway, I think —chat is obsolete in current version, for me it’s default without the argument