aliens

Author Topic: Local Llama3 Integration  (Read 2320 times)

Offline Whispers

  • Sergeant
  • **
  • Posts: 43
    • View Profile
Local Llama3 Integration
« on: May 25, 2024, 04:21:52 pm »
Hey,

A while back(several years ago) I wrote some stuff for OXCE which enabled some Lua modding, but it wasn't well received so I abandoned it.

Lately I've been toying with the idea of using a local Llama3:8b LLM model for some limited scope stuff within Xcom. The first, and most obvious one, is the council notices at the end of the month. Instead of it being some bland text which is always the same, I was thinking it would be cool if it could reference what happened during the month, and the results of those actions. Not everything, of course, but just the highlights. Even cooler, imagine if it would read it to you with a similar voice of the Spokesman in Firaxis Xcom, but maybe attenuated and made in 8 bit audio.

Unlike the Lua stuff, where I just went off and did it, then was told it wasn't going to make it into mainline, I wanted to ask before beginning work on something like this.

So the way it would work is fairly straightforward. If you have the option enabled and the address and port to the Llama instance set, then it would work. Otherwise it would fall back to using the same bland text we have seen for decades now. If it is enabled, then it would feed all actions you have performed over the past month, how those actions have changed your political standing within governments, and some very simple prompt engineering to make the report sound like it is coming from the Spokesman, then viola! You have a custom report at the end of every month detailing your progress and standing within the governments. It's possible to take this a step further and enable a conversation with the Spokesman, but I kinda feel as though that would diminish the feeling of finality of the end of the month report.

To do the voice encoding, it's possible to train up something with Piper(https://github.com/rhasspy/piper). Once again, making it optional. If you have piper installed, then we could provide it with a model and text to read, and that's it. You'd have in game text to speech that would sound similar to the Spokesman.

What are your thoughts?