bzgpt: Moderating your servers with a GPT chatbot assistant

All things BZFlag - no [OT] here please
Post Reply
playerStr
Private First Class
Private First Class
Posts: 11
Joined: Fri Feb 09, 2024 9:50 am

bzgpt: Moderating your servers with a GPT chatbot assistant

Post by playerStr »

It is possible to use Llama2 and a python wrapper in combination with bzadmin to make a (slightly) intelligent BZFlag admin assistant.

I tested bzgpt today, and it was able to:

- Make jokes, answer questions (sometimes incorrectly, but it was fun)
- Run server commands "hey bzgpt, say /set _mirror and then write a color that you think is cool"
- Use /me to emote and describe itself

With a bit more tweaking, it could be a fun addition to less serious servers, and maybe useful in more serious ones as well with different prompting.

The specific model used was llama2-7b-chat in GGUF format from HuggingFace, running on a 1080Ti with CUDA.

The model was executed using llamacpp, which is a standalone project with few dependencies, which makes it easier to get set up with than the usual python mess that most AI tools use.

The model would reset its state completely between requests, which is foolproof but limited. In the future, it could be good to:
- Have it read and understand the full chat log.
- Feed it data about players, scores, and stats, so it can answer questions about them.
- Use a better model (13b will run on my machine, but that's my limit, personally)
- Experiment with better prompting, potentially inserting some data from bzadmin directly into the prompt for maximum effect
Last edited by playerStr on Sun Feb 18, 2024 11:23 pm, edited 1 time in total.
mudfreak
Private First Class
Private First Class
Posts: 14
Joined: Mon Jan 02, 2017 10:53 pm

Re: bzgpt: Moderating your servers with a GPT chatbot assistant

Post by mudfreak »

Reminds me of IRC bots. They are not very intelligent though. ;-)
User avatar
Zehra
Private First Class
Private First Class
Posts: 921
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

Re: bzgpt: Moderating your servers with a GPT chatbot assistant

Post by Zehra »

I once had the idea of indexing most of the forums to find out what are the most common questions, ways of them being asked and more and simply indexing a lot of keywords for context and logic.

In theory it would become possible to easily have a searchable database of all the maps, general troubleshooting..etc

It wouldn't have a perfect or truly natural flow in terms of language responses though, but it would have been able to provide useful responses to queries requesting map types (ctf, ffa, rabbit), objects used (meshes, boxes), or general features like: towers, open space, textured, asymmetrical, ctf variant..etc

The sheer amount of content to index and convert to context would have easily turned this into a project which would take 3-12 months to build and even at a rate of 5 hours per day by my own estimates. (This without bzadmin type communications being available to it.)

---

So seeing GPT on BZ is something I can really imagine taking off, as it has much more natural form of language processing in both input and output.

I see perhaps even the potential to run/create pseudo-code game modes rather easily and even generate statistics on them in the future, as this requires some context, but GPTs are generally able to make some use of it in general, even if it's not true understanding.

In conclusion, I think a really good balance between utility and novelty may be found and at the same time being easy to interact with. I think this will be very fun. I look forward to more of it, as there is a lot of potential which remains untapped with this.

-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
User avatar
macsforme
General
General
Posts: 2069
Joined: Wed Mar 01, 2006 5:43 am

Re: bzgpt: Moderating your servers with a GPT chatbot assistant

Post by macsforme »

Now to combine the recent projects here… I want to see ChatGPT emit a BZFlag map. :lol-old:
playerStr
Private First Class
Private First Class
Posts: 11
Joined: Fri Feb 09, 2024 9:50 am

Re: bzgpt: Moderating your servers with a GPT chatbot assistant

Post by playerStr »

Llama2 tried... weirdly it's symmetrical.

Maybe actual chatgpt would do better.
gpt.jpg
(52.5 KiB) Not downloaded yet
playerStr
Private First Class
Private First Class
Posts: 11
Joined: Fri Feb 09, 2024 9:50 am

Re: bzgpt: Moderating your servers with a GPT chatbot assistant

Post by playerStr »

Here's what microsoft's bing chat AI thing made, after removing some nonsense materials it tried to generate:
copilot.jpg
(19.9 KiB) Not downloaded yet
It's actually not so bad.
User avatar
Zehra
Private First Class
Private First Class
Posts: 921
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

Re: bzgpt: Moderating your servers with a GPT chatbot assistant

Post by Zehra »

Any chance I can get a GPT running on 4GB of RAM? (Or around 2GB, since the rest gets taken up.)

Since I've considered the possibility of feeding large amount of prefabs to one and seeing if it can figure out/create templates from them and afterwards be able to use those templates in various patterns/layouts. (I know for sure it is doable/easy to do this manually, but it's tedious to do so.)

-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
playerStr
Private First Class
Private First Class
Posts: 11
Joined: Fri Feb 09, 2024 9:50 am

Re: bzgpt: Moderating your servers with a GPT chatbot assistant

Post by playerStr »

So long as you have swap enabled, it'll run, it'll just be really slow.

It's easy to get a chat bot set up that you can ask questions and stuff, but hard to get a useful tool out of it. Maybe some models are better for that sorta thing, I am not that experienced with it yet.

You'd probably have the best luck using an online service like ChatGPT, or the Bing AI. But you can always try a local model.

The way to do it is to go on huggingface, and find models in "GGUF" format, as those can be used with llamacpp. Try to find one small enough to fit better into the available RAM (they come in all sizes). Each model can have different types of prompting features, so how to prompt the model will depend on which one you choose.
User avatar
macsforme
General
General
Posts: 2069
Joined: Wed Mar 01, 2006 5:43 am

Re: bzgpt: Moderating your servers with a GPT chatbot assistant

Post by macsforme »

playerStr wrote: Wed Feb 21, 2024 12:57 am Here's what microsoft's bing chat AI thing made, after removing some nonsense materials it tried to generate:

copilot.jpg

It's actually not so bad.
Interesting… I bet it’s mostly pulling examples from our wiki pages for the different map elements. But agreed, not awful.
User avatar
tainn
Private First Class
Private First Class
Posts: 278
Joined: Sun Nov 18, 2018 7:25 pm
Location: phantom_zone;

Re: bzgpt: Moderating your servers with a GPT chatbot assistant

Post by tainn »

macsforme wrote: Thu Feb 22, 2024 9:41 pm Interesting… I bet it’s mostly pulling examples from our wiki pages for the different map elements. But agreed, not awful.
I would guess it has (also) pulled examples from the forums, it's a much greater sample size.

This was the response of GPT-4 on my simple prompt.
User avatar
Zehra
Private First Class
Private First Class
Posts: 921
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

Re: bzgpt: Moderating your servers with a GPT chatbot assistant

Post by Zehra »

tainn wrote: Fri Mar 15, 2024 9:15 pm This was the response of GPT-4 on my simple prompt.
Visiting said link is 404 response:
404: This page could not be found
Related to 404: Share Link does require Account Creation?
carsten.wittmann wrote: I have used share links to share conversations with friend before and it worked fine all of the time. Now my friends need to create an account to use the link? Documentation still says, that everyone with the link can access the conversation. And this is still true for old links - but not for the ones I created yesterday or today. Seems to be a bug from my perspective.
old link, still working: https://chat.openai.com/share/c74f6c10- ... 25e7c2ab25
new link, not working: https://chat.openai.com/share/8daffdfc- ... bbc628b7d6
In my opinion, the need to create an account to preview content is troublesome.
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
Post Reply