talemate/README.md
veguAI d768713630
Prep 0.17.0 (#48)
* improve windows install script to check for compatible python versions, also work with multi version python installs

* bunch of llm prompt templates

* first gamestate directing impl

* lower similarity threshold when checking for repetition in llm responses

* tweaks to narrate after dialog prompt
tweaks to extract character sheet prompt

* set_context cmd

* Xwin MoE

* thematic generator for randomized content stimuli

* add a memory query to extract character sheet

* direct-scene prompt tweaks

* conversation prompt tweaks

* inline character creation from gameplay instruction template
expose thematic generator to prompt templates

* Mixtral
Synthia-MoE

* display prompt and response side by side

* improve ensure_dialogue_format

* prompt tweaks

* prevent double passive narration in one round
improvements to persist character logic

* SlimOrca
OpenBuddy

* prompt tweaks

* runpod status check wrapped in asyncio

* generate_json_list creator agent action

* limit conversation retries to 2
fix issue where REPETITION signal trigger would get sent with the prompt

* smaller agent tweaks

* thematic generator personality list
thematic generator generate from sets of lists

* adjust tests

* mistral prompt adjustment

* director: update content context

* prompt adjustments

* nous-hermes-2-yi
dolphin-2.2-yo
dolphin-2.6-mixtral

* status messages

* determine character goals
generate json lists

* fix error when chromadb add was called before db was ready (wait until the db is fully initiazed)

* only strip extra spaces off of prompt
textgenwebui: half temperature on -yi- models

* prompt tweaks

* more thematic generators

* direct scene without character should just run the scene instructions if they exist

* as_question_answer for query_scene

* context_history revamp

* Aurora-Nights
MixtgralOrochi
dolphin-2.7-mixtral
nous-hermas-2-solar

* remove old context_history calls

* mv world_state.py to subdir
FlatDolphinMaid
Goliath
Norobara
Nous-Capybara

* world state manager first progress

* context db manager

* fix issue with some clients not remembering context length settings after talemate restart

* Sensualize-Solar

* improve RAG prompt

* conversation agent use [ as a stopping string since the new reinforcement messages use that

* new method for RAG during conversation

* mixtral_11bx2_moe

* option to reset context db from manager ui

* fix context db cleanup if scene is closed without saving

* didnt mean to commit that

* hide internal meta tags

* keep track of manual context entries in scene save file so it can be rebuilt.

* auto save
auto progress
quick settings hotbar options

* manual mode
actor dialogue tools
refactor toolbar

* narrate directed progress
reorganiza narration tools into one cmd module

* 0.17.0

* Mixtral_34Bx2
Sensualize-Mixtral
openchat

* fix save-as action

* fix issue where too little context was joined in via RAG

* context pins implementation

* show active pins in world state component

* pin condition eval and world state agent action config

* Open_Gpt4

* summarization prompt improvements
system prompt for summarization

* guidance prompt for time passage narration

* fix rerun for generic / unhandled messages

* prompt fixes

* summarization methods

* prompt adjustments

* world tools to hot bar
ux tweaks

* bagel-dpo

* context state reinforcements support different insertion methods now (sequential, all context or conversation specific context)

* first progress on world state reinforcement templating

* Kunoichi

* tweaks to update reinforcements prompt

* world state templates progress

* world state templates integration into main ux

* fix issue where openai client wouldn't accept context length override

* dont reconfigure client if no arguments are provided

* pin condition prompt fixes
world state apply template comman label set

* world information / lore entries and reinforcement

* show world entry states reinforcers in ux

* gitignore

* dynamic scenario generation progress

* dynamic scenario experiment

* gitignore

* need to emit world state even if we dont run it during scene init

* summarize and pin action

* poetry relock

* template question / attribute cannot be empty

* fix issue with summarize and pin not respecting selected line

* keep reinforcement messages in history, but keep the same one from stacking up

* narrate query prompt more natural sounding response

* manage pins from world entry editor

* pin_only tag

* ts aware summarize and pin
pin text rendered to context with time label
context reuse session id (this fixes issue of editing context entry and not saving the scene causing removal of context entry next time scene is loaded)

* UX to add character state from template within the worldstate manager UX

* move divider

* handle agent emit error
fix issue with state reinforcer validation

* layout fixes in world state character panel
physical health template added to example config

* fix pin_only undefined error in world entry editor

* laser-dolphin
Noromaid-v0.4-Mixtral-Instruct

* show state templates for world and players in favorite list
fix applying world state template

* refresh world entry list on state creation

* changing a state from non-sequential to sequential should queue it as due

* quicksettings to bar

* fix error during memory db delete

* status messages during scene load

* removing a sequential state reinforcement should remove the reinforcement messages

* Nous-Hermes-2-Mixtral

* fix sync issue when editing character details through contextdb

* immutable save property

* enable director

* update example config

* enable director when loading a scene file that has instructions

* fix more openai client funkyness with context size and losing model

* iq dyn scenario prompt fixes

* delay client save so that dragging the ctx slider doesnt send off a million requests
default openai ctx to 8k

* input disabled while clients active

* declare event

* narrate query prompt tweaks

* fixes to dialogue cleanup that would cause messages after : to be cut off.

* init git repo if not exist

* pull current branch

* add 12 hours as option

* world-state persist deactivated

* install npm packages

* fix typo

* prompt tweaks

* new screenshots and features updated

* update screenshot
2024-01-19 11:47:38 +02:00

7.6 KiB

Talemate

Allows you to play roleplay scenarios with large language models.

Screenshot 1 Screenshot 2
Screenshot 1 Screenshot 2
------------------------------------------ ------------------------------------------

⚠️ It does not run any large language models itself but relies on existing APIs. Currently supports OpenAI, text-generation-webui and LMStudio.

This means you need to either have:

Current features

  • responive modern ui
  • agents
    • conversation: handles character dialogue
    • narration: handles narrative exposition
    • summarization: handles summarization to compress context while maintain history
    • director: can be used to direct the story / characters
    • editor: improves AI responses (very hit and miss at the moment)
    • world state: generates world snapshot and handles passage of time (objects and characters)
    • creator: character / scenario creator
    • tts: text to speech via elevenlabs, coqui studio, coqui local
  • multi-client support (agents can be connected to separate APIs)
  • long term memory
    • chromadb integration
    • passage of time
  • narrative world state
    • Automatically keep track and reinforce selected character and world truths / states.
  • narrative tools
  • creative tools
    • AI backed character creation with template support (jinja2)
    • AI backed scenario creation
  • context managegement
    • Manage character details and attributes
    • Manage world information / past events
    • Pin important information to the context (Manually or conditionally through AI)
  • runpod integration
  • overridable templates for all prompts. (jinja2)

Planned features

Kinda making it up as i go along, but i want to lean more into gameplay through AI, keeping track of gamestates, moving away from simply roleplaying towards a more game-ified experience.

In no particular order:

  • Extension support
    • modular agents and clients
  • Improved world state
  • Dynamic player choice generation
  • Better creative tools
    • node based scenario / character creation
  • Improved and consistent long term memory and accurate current state of the world
  • Improved director agent
    • Right now this doesn't really work well on anything but GPT-4 (and even there it's debatable). It tends to steer the story in a way that introduces pacing issues. It needs a model that is creative but also reasons really well i think.
  • Gameplay loop governed by AI
    • objectives
    • quests
    • win / lose conditions
  • stable-diffusion client for in place visual generation

Quickstart

Installation

Post here if you run into problems during installation.

There is also a troubleshooting guide that might help.

Windows

  1. Download and install Python 3.10 or Python 3.11 from the official Python website. ⚠️ python3.12 is currently not supported.
  2. Download and install Node.js from the official Node.js website. This will also install npm.
  3. Download the Talemate project to your local machine. Download from the Releases page.
  4. Unpack the download and run install.bat by double clicking it. This will set up the project on your local machine.
  5. Once the installation is complete, you can start the backend and frontend servers by running start.bat.
  6. Navigate your browser to http://localhost:8080

Linux

python 3.10 or python 3.11 is required. ⚠️ python 3.12 not supported yet.

  1. git clone git@github.com:vegu-ai/talemate
  2. cd talemate
  3. source install.sh
  4. Start the backend: python src/talemate/server/run.py runserver --host 0.0.0.0 --port 5050.
  5. Open a new terminal, navigate to the talemate_frontend directory, and start the frontend server by running npm run serve.

Configuration

OpenAI

To set your openai api key, open config.yaml in any text editor and uncomment / add

openai:
    api_key: sk-my-api-key-goes-here

You will need to restart the backend for this change to take effect.

RunPod

To set your runpod api key, open config.yaml in any text editor and uncomment / add

runpod:
    api_key: my-api-key-goes-here

You will need to restart the backend for this change to take effect.

Once the api key is set Pods loaded from text-generation-webui templates (or the bloke's runpod llm template) will be autoamtically added to your client list in talemate.

ATTENTION: Talemate is not a suitable for way for you to determine whether your pod is currently running or not. Always check the runpod dashboard to see if your pod is running or not.

(as of2023.10.25)

Any of the top models in any of the size classes here should work well: https://www.reddit.com/r/LocalLLaMA/comments/17fhp9k/huge_llm_comparisontest_39_models_tested_7b70b/

Connecting to an LLM

On the right hand side click the "Add Client" button. If there is no button, you may need to toggle the client options by clicking this button:

Client options

Text-generation-webui

⚠️ As of version 0.13.0 the legacy text-generator-webui API --extension api is no longer supported, please use their new --extension openai api implementation instead.

In the modal if you're planning to connect to text-generation-webui, you can likely leave everything as is and just click Save.

Add client modal

OpenAI

If you want to add an OpenAI client, just change the client type and select the apropriate model.

Add client modal

Ready to go

You will know you are good to go when the client and all the agents have a green dot next to them.

Ready to go

Load the introductory scenario "Infinity Quest"

Generated using talemate creative tools, mostly used for testing / demoing.

You can load it (and any other talemate scenarios or save files) by expanding the "Load" menu in the top left corner and selecting the middle tab. Then simple search for a partial name of the scenario you want to load and click on the result.

Load scenario location

Loading character cards

Supports both v1 and v2 chara specs.

Expand the "Load" menu in the top left corner and either click on "Upload a character card" or simply drag and drop a character card file into the same area.

Load character card location

Once a character is uploaded, talemate may actually take a moment because it needs to convert it to a talemate format and will also run additional LLM prompts to generate character attributes and world state.

Make sure you save the scene after the character is loaded as it can then be loaded as normal talemate scenario in the future.

Further documentation

Please read the documents in the docs folder for more advanced configuration and usage.