Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9eb4c48d79 | ||
|
|
e4d465ba42 | ||
|
|
61d01984ba |
57
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Python Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, 'prep-*' ]
|
||||
pull_request:
|
||||
branches: [ main, 'prep-*' ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip'
|
||||
|
||||
- name: Install uv
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install uv
|
||||
|
||||
- name: Cache uv dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/uv
|
||||
key: ${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-uv-${{ matrix.python-version }}-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
uv venv
|
||||
source .venv/bin/activate
|
||||
uv pip install -e ".[dev]"
|
||||
|
||||
- name: Setup configuration file
|
||||
run: |
|
||||
cp config.example.yaml config.yaml
|
||||
|
||||
- name: Download NLTK data
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
python -c "import nltk; nltk.download('punkt_tab')"
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
pytest tests/ -p no:warnings
|
||||
6
.gitignore
vendored
@@ -8,6 +8,9 @@
|
||||
talemate_env
|
||||
chroma
|
||||
config.yaml
|
||||
|
||||
# uv
|
||||
.venv/
|
||||
templates/llm-prompt/user/*.jinja2
|
||||
templates/world-state/*.yaml
|
||||
scenes/
|
||||
@@ -17,4 +20,5 @@ scenes/
|
||||
!scenes/infinity-quest-dynamic-scenario/infinity-quest.json
|
||||
!scenes/infinity-quest/assets/
|
||||
!scenes/infinity-quest/infinity-quest.json
|
||||
tts_voice_samples/*.wav
|
||||
tts_voice_samples/*.wav
|
||||
third-party-docs/
|
||||
1
.python-version
Normal file
@@ -0,0 +1 @@
|
||||
3.11
|
||||
52
Dockerfile
@@ -1,15 +1,19 @@
|
||||
# Stage 1: Frontend build
|
||||
FROM node:21 AS frontend-build
|
||||
|
||||
ENV NODE_ENV=development
|
||||
FROM node:21-slim AS frontend-build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the frontend directory contents into the container at /app
|
||||
COPY ./talemate_frontend /app
|
||||
# Copy frontend package files
|
||||
COPY talemate_frontend/package*.json ./
|
||||
|
||||
# Install all dependencies and build
|
||||
RUN npm install && npm run build
|
||||
# Install dependencies
|
||||
RUN npm ci
|
||||
|
||||
# Copy frontend source
|
||||
COPY talemate_frontend/ ./
|
||||
|
||||
# Build frontend
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Backend build
|
||||
FROM python:3.11-slim AS backend-build
|
||||
@@ -22,30 +26,25 @@ RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install poetry
|
||||
RUN pip install poetry
|
||||
# Install uv
|
||||
RUN pip install uv
|
||||
|
||||
# Copy poetry files
|
||||
COPY pyproject.toml poetry.lock* /app/
|
||||
# Copy installation files
|
||||
COPY pyproject.toml uv.lock /app/
|
||||
|
||||
# Create a virtual environment
|
||||
RUN python -m venv /app/talemate_env
|
||||
|
||||
# Activate virtual environment and install dependencies
|
||||
RUN . /app/talemate_env/bin/activate && \
|
||||
poetry config virtualenvs.create false && \
|
||||
poetry install --only main --no-root
|
||||
|
||||
# Copy the Python source code
|
||||
# Copy the Python source code (needed for editable install)
|
||||
COPY ./src /app/src
|
||||
|
||||
# Create virtual environment and install dependencies
|
||||
RUN uv sync
|
||||
|
||||
# Conditional PyTorch+CUDA install
|
||||
ARG CUDA_AVAILABLE=false
|
||||
RUN . /app/talemate_env/bin/activate && \
|
||||
RUN . /app/.venv/bin/activate && \
|
||||
if [ "$CUDA_AVAILABLE" = "true" ]; then \
|
||||
echo "Installing PyTorch with CUDA support..." && \
|
||||
pip uninstall torch torchaudio -y && \
|
||||
pip install torch~=2.4.1 torchaudio~=2.4.1 --index-url https://download.pytorch.org/whl/cu121; \
|
||||
uv pip uninstall torch torchaudio && \
|
||||
uv pip install torch~=2.7.0 torchaudio~=2.7.0 --index-url https://download.pytorch.org/whl/cu128; \
|
||||
fi
|
||||
|
||||
# Stage 3: Final image
|
||||
@@ -57,8 +56,11 @@ RUN apt-get update && apt-get install -y \
|
||||
bash \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install uv in the final stage
|
||||
RUN pip install uv
|
||||
|
||||
# Copy virtual environment from backend-build stage
|
||||
COPY --from=backend-build /app/talemate_env /app/talemate_env
|
||||
COPY --from=backend-build /app/.venv /app/.venv
|
||||
|
||||
# Copy Python source code
|
||||
COPY --from=backend-build /app/src /app/src
|
||||
@@ -83,4 +85,4 @@ EXPOSE 5050
|
||||
EXPOSE 8080
|
||||
|
||||
# Use bash as the shell, activate the virtual environment, and run backend server
|
||||
CMD ["/bin/bash", "-c", "source /app/talemate_env/bin/activate && python src/talemate/server/run.py runserver --host 0.0.0.0 --port 5050 --frontend-host 0.0.0.0 --frontend-port 8080"]
|
||||
CMD ["uv", "run", "src/talemate/server/run.py", "runserver", "--host", "0.0.0.0", "--port", "5050", "--frontend-host", "0.0.0.0", "--frontend-port", "8080"]
|
||||
16
README.md
@@ -2,10 +2,13 @@
|
||||
|
||||
Roleplay with AI with a focus on strong narration and consistent world and game state tracking.
|
||||
|
||||
|||
|
||||
<div align="center">
|
||||
|
||||
|<img src="docs/img/ss-1.png" width="400" height="250" alt="Screenshot 1">|<img src="docs/img/ss-2.png" width="400" height="250" alt="Screenshot 2">|
|
||||
|------------------------------------------|------------------------------------------|
|
||||
|||
|
||||
|||
|
||||
|<img src="docs/img/ss-3.png" width="400" height="250" alt="Screenshot 3">|<img src="docs/img/ss-4.png" width="400" height="250" alt="Screenshot 4">|
|
||||
|
||||
</div>
|
||||
|
||||
## Core Features
|
||||
|
||||
@@ -14,6 +17,7 @@ Roleplay with AI with a focus on strong narration and consistent world and game
|
||||
- Long-term memory and passage of time tracking
|
||||
- Narrative world state management to reinforce character and world truths
|
||||
- Creative tools for managing NPCs, AI-assisted character, and scenario creation with template support
|
||||
- Node editor for creating complex scenarios and re-usable modules
|
||||
- Context management for character details, world information, past events, and pinned information
|
||||
- Customizable templates for all prompts using Jinja2
|
||||
- Modern, responsive UI
|
||||
@@ -23,6 +27,10 @@ Roleplay with AI with a focus on strong narration and consistent world and game
|
||||
- [Installation and Getting started](https://vegu-ai.github.io/talemate/)
|
||||
- [User Guide](https://vegu-ai.github.io/talemate/user-guide/interacting/)
|
||||
|
||||
## Discord Community
|
||||
|
||||
Need help? Join the new [Discord community](https://discord.gg/8bGNRmFxMj)
|
||||
|
||||
## Supported APIs
|
||||
|
||||
- [OpenAI](https://platform.openai.com/overview)
|
||||
@@ -31,12 +39,14 @@ Roleplay with AI with a focus on strong narration and consistent world and game
|
||||
- [Cohere](https://www.cohere.com/)
|
||||
- [Groq](https://www.groq.com/)
|
||||
- [Google Gemini](https://console.cloud.google.com/)
|
||||
- [OpenRouter](https://openrouter.ai/)
|
||||
|
||||
Supported self-hosted APIs:
|
||||
- [KoboldCpp](https://koboldai.org/cpp) ([Local](https://koboldai.org/cpp), [Runpod](https://koboldai.org/runpodcpp), [VastAI](https://koboldai.org/vastcpp), also includes image gen support)
|
||||
- [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui) (local or with runpod support)
|
||||
- [LMStudio](https://lmstudio.ai/)
|
||||
- [TabbyAPI](https://github.com/theroyallab/tabbyAPI/)
|
||||
- [Ollama](https://ollama.com/)
|
||||
|
||||
Generic OpenAI api implementations (tested and confirmed working):
|
||||
- [DeepInfra](https://deepinfra.com/)
|
||||
|
||||
@@ -18,4 +18,4 @@ services:
|
||||
environment:
|
||||
- PYTHONUNBUFFERED=1
|
||||
- PYTHONPATH=/app/src:$PYTHONPATH
|
||||
command: ["/bin/bash", "-c", "source /app/talemate_env/bin/activate && python src/talemate/server/run.py runserver --host 0.0.0.0 --port 5050 --frontend-host 0.0.0.0 --frontend-port 8080"]
|
||||
command: ["uv", "run", "src/talemate/server/run.py", "runserver", "--host", "0.0.0.0", "--port", "5050", "--frontend-host", "0.0.0.0", "--frontend-port", "8080"]
|
||||
@@ -126,5 +126,4 @@ class RunPodVLLMClient(ClientBase):
|
||||
self.model_name = kwargs["model"]
|
||||
if "runpod_id" in kwargs:
|
||||
self.api_auth = kwargs["runpod_id"]
|
||||
log.warning("reconfigure", kwargs=kwargs)
|
||||
self.set_client(**kwargs)
|
||||
|
||||
166
docs/dev/howto/add-a-worldstate-template-type.md
Normal file
@@ -0,0 +1,166 @@
|
||||
# Adding a new world-state template
|
||||
|
||||
I am writing this up as I add phrase detection functionality to the `Writing Style` template, so that in the future, hopefully when new template types need to be added this document can just given to the LLM of the month, to do it.
|
||||
|
||||
## Introduction
|
||||
|
||||
World state templates are reusable components that plug in various parts of talemate.
|
||||
|
||||
At this point there are following types:
|
||||
|
||||
- Character Attribute
|
||||
- Character Detail
|
||||
- Writing Style
|
||||
- Spice (for randomization of content during generation)
|
||||
- Scene Type
|
||||
- State Reinforcement
|
||||
|
||||
Basically whenever we want to add something reusable and customizable by the user, a world state template is likely a good solution.
|
||||
|
||||
## Steps to creating a new template type
|
||||
|
||||
### 1. Add a pydantic schema (python)
|
||||
|
||||
In `src/talemate/world_state/templates` create a new `.py` file with reasonable name.
|
||||
|
||||
In this example I am extending the `Writing Style` template to include phrase detection functionality, which will be used by the `Editor` agent to detect certain phrases and then act upon them.
|
||||
|
||||
There already is a `content.py` file - so it makes sense to just add this new functionality to this file.
|
||||
|
||||
```python
|
||||
class PhraseDetection(pydantic.BaseModel):
|
||||
phrase: str
|
||||
instructions: str
|
||||
# can be "unwanted" for now, more added later
|
||||
classification: Literal["unwanted"] = "unwanted"
|
||||
|
||||
@register("writing_style")
|
||||
class WritingStyle(Template):
|
||||
description: str | None = None
|
||||
phrases: list[PhraseDetection] = pydantic.Field(default_factory=list)
|
||||
|
||||
def render(self, scene: "Scene", character_name: str):
|
||||
return self.formatted("instructions", scene, character_name)
|
||||
```
|
||||
|
||||
If I were to create a new file I'd still want to read one of the existing files first to understand imports and style.
|
||||
|
||||
### 2. Add a vue component to allow management (vue, js)
|
||||
|
||||
Next we need to add a new vue component that exposes a UX for us to manage this new template type.
|
||||
|
||||
For this I am creating `talemate_frontend/src/components/WorldStateManagerTemplateWritingStyle.vue`.
|
||||
|
||||
## Bare Minimum Understanding for New Template Components
|
||||
|
||||
When adding a new component for managing a template type, you need to understand:
|
||||
|
||||
### Component Structure
|
||||
|
||||
1. **Props**: The component always receives an `immutableTemplate` prop with the template data.
|
||||
2. **Data Management**: Create a local copy of the template data for editing before saving back.
|
||||
3. **Emits**: Use the `update` event to send modified template data back to the parent.
|
||||
|
||||
### Core Implementation Requirements
|
||||
|
||||
1. **Template Properties**: Always include fields for `name`, `description`, and `favorite` status.
|
||||
2. **Data Binding**: Implement two-way binding with `v-model` for all editable fields.
|
||||
3. **Dirty State Tracking**: Track when changes are made but not yet saved.
|
||||
4. **Save Method**: Implement a `save()` method that emits the updated template.
|
||||
|
||||
### Component Lifecycle
|
||||
|
||||
1. **Initialization**: Use the `created` hook to initialize the local template copy.
|
||||
2. **Watching for Changes**: Set up a watcher for the `immutableTemplate` to handle external updates.
|
||||
|
||||
### UI Patterns
|
||||
|
||||
1. **Forms**: Use Vuetify form components with consistent validation.
|
||||
2. **Actions**: Provide clear user actions for editing and managing template items.
|
||||
3. **Feedback**: Give visual feedback when changes are being made or saved.
|
||||
|
||||
The WorldStateManagerTemplate components follow a consistent pattern where they:
|
||||
- Display and edit general template metadata (name, description, favorite status)
|
||||
- Provide specialized UI for the template's unique properties
|
||||
- Handle the create, read, update, delete (CRUD) operations for template items
|
||||
- Maintain data integrity by properly handling template updates
|
||||
|
||||
You absolutely should read an existing component like `WorldStateManagerTemplateWritingStyle.vue` first to get a good understanding of the implementation.
|
||||
|
||||
## Integrating with WorldStateManagerTemplates
|
||||
|
||||
After creating your template component, you need to integrate it with the WorldStateManagerTemplates component:
|
||||
|
||||
### 1. Import the Component
|
||||
|
||||
Edit `talemate_frontend/src/components/WorldStateManagerTemplates.vue` and add an import for your new component:
|
||||
|
||||
```javascript
|
||||
import WorldStateManagerTemplateWritingStyle from './WorldStateManagerTemplateWritingStyle.vue'
|
||||
```
|
||||
|
||||
### 2. Register the Component
|
||||
|
||||
Add your component to the components section of the WorldStateManagerTemplates:
|
||||
|
||||
```javascript
|
||||
components: {
|
||||
// ... existing components
|
||||
WorldStateManagerTemplateWritingStyle
|
||||
}
|
||||
```
|
||||
|
||||
### 3. Add Conditional Rendering
|
||||
|
||||
In the template section, add a new conditional block to render your component when the template type matches:
|
||||
|
||||
```html
|
||||
<WorldStateManagerTemplateWritingStyle v-else-if="template.template_type === 'writing_style'"
|
||||
:immutableTemplate="template"
|
||||
@update="(template) => applyAndSaveTemplate(template)"
|
||||
/>
|
||||
```
|
||||
|
||||
### 4. Add Icon and Color
|
||||
|
||||
Add cases for your template type in the `iconForTemplate` and `colorForTemplate` methods:
|
||||
|
||||
```javascript
|
||||
iconForTemplate(template) {
|
||||
// ... existing conditions
|
||||
else if (template.template_type == 'writing_style') {
|
||||
return 'mdi-script-text';
|
||||
}
|
||||
return 'mdi-cube-scan';
|
||||
},
|
||||
|
||||
colorForTemplate(template) {
|
||||
// ... existing conditions
|
||||
else if (template.template_type == 'writing_style') {
|
||||
return 'highlight5';
|
||||
}
|
||||
return 'grey';
|
||||
}
|
||||
```
|
||||
|
||||
### 5. Add Help Message
|
||||
|
||||
Add a help message for your template type in the `helpMessages` object in the data section:
|
||||
|
||||
```javascript
|
||||
helpMessages: {
|
||||
// ... existing messages
|
||||
writing_style: "Writing style templates are used to define a writing style that can be applied to the generated content. They can be used to add a specific flavor or tone. A template must explicitly support writing styles to be able to use a writing style template.",
|
||||
}
|
||||
```
|
||||
|
||||
### 6. Update Template Type Selection
|
||||
|
||||
Add your template type to the `templateTypes` array in the data section:
|
||||
|
||||
```javascript
|
||||
templateTypes: [
|
||||
// ... existing types
|
||||
{ "title": "Writing style", "value": 'writing_style'},
|
||||
]
|
||||
```
|
||||
@@ -10,20 +10,19 @@ To run the server on a different host and port, you need to change the values pa
|
||||
|
||||
#### :material-linux: Linux
|
||||
|
||||
Copy `start.sh` to `start_custom.sh` and edit the `--host` and `--port` parameters in the `uvicorn` command.
|
||||
Copy `start.sh` to `start_custom.sh` and edit the `--host` and `--port` parameters.
|
||||
|
||||
```bash
|
||||
#!/bin/sh
|
||||
. talemate_env/bin/activate
|
||||
python src/talemate/server/run.py runserver --host 0.0.0.0 --port 1234
|
||||
uv run src/talemate/server/run.py runserver --host 0.0.0.0 --port 1234
|
||||
```
|
||||
|
||||
#### :material-microsoft-windows: Windows
|
||||
|
||||
Copy `start.bat` to `start_custom.bat` and edit the `--host` and `--port` parameters in the `uvicorn` command.
|
||||
Copy `start.bat` to `start_custom.bat` and edit the `--host` and `--port` parameters.
|
||||
|
||||
```batch
|
||||
start cmd /k "cd talemate_env\Scripts && activate && cd ../../ && python src\talemate\server\run.py runserver --host 0.0.0.0 --port 1234"
|
||||
uv run src\talemate\server\run.py runserver --host 0.0.0.0 --port 1234
|
||||
```
|
||||
|
||||
### Letting the frontend know about the new host and port
|
||||
@@ -71,8 +70,7 @@ Copy `start.sh` to `start_custom.sh` and edit the `--frontend-host` and `--front
|
||||
|
||||
```bash
|
||||
#!/bin/sh
|
||||
. talemate_env/bin/activate
|
||||
python src/talemate/server/run.py runserver --host 0.0.0.0 --port 5055 \
|
||||
uv run src/talemate/server/run.py runserver --host 0.0.0.0 --port 5055 \
|
||||
--frontend-host localhost --frontend-port 8082
|
||||
```
|
||||
|
||||
@@ -81,7 +79,7 @@ python src/talemate/server/run.py runserver --host 0.0.0.0 --port 5055 \
|
||||
Copy `start.bat` to `start_custom.bat` and edit the `--frontend-host` and `--frontend-port` parameters.
|
||||
|
||||
```batch
|
||||
start cmd /k "cd talemate_env\Scripts && activate && cd ../../ && python src\talemate\server\run.py runserver --host 0.0.0.0 --port 5055 --frontend-host localhost --frontend-port 8082"
|
||||
uv run src\talemate\server\run.py runserver --host 0.0.0.0 --port 5055 --frontend-host localhost --frontend-port 8082
|
||||
```
|
||||
|
||||
### Start the backend and frontend
|
||||
@@ -98,5 +96,4 @@ Start the backend and frontend as usual.
|
||||
|
||||
```batch
|
||||
start_custom.bat
|
||||
```
|
||||
|
||||
```
|
||||
@@ -19,7 +19,7 @@ On the right hand side click the **:material-plus-box: ADD CLIENT** button.
|
||||
|
||||
The client configuration window will appear. Here you can choose the type of client you want to add.
|
||||
|
||||

|
||||

|
||||
|
||||
## Choose an API / Client Type
|
||||
|
||||
@@ -55,7 +55,7 @@ Select the API you want to use and click through to follow the instructions to c
|
||||
|
||||
Whenever you add your first client, Talemate will automatically assign it to all agents. Once the client is configured and assigned, all agents should have a green dot next to them. (Or grey if the agent is currently disabled)
|
||||
|
||||

|
||||

|
||||
|
||||
You can tell the client is assigned to the agent by checking the tag beneath the agent name, which will contain the client name if it is assigned.
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
|
||||
## Quick install instructions
|
||||
|
||||
!!! warning
|
||||
python 3.12 is currently not supported.
|
||||
|
||||
### Dependencies
|
||||
|
||||
--8<-- "docs/snippets/common.md:python-versions"
|
||||
|
||||
1. node.js and npm - see instructions [here](https://nodejs.org/en/download/package-manager/)
|
||||
1. python 3.10 or 3.11 - see instructions [here](https://www.python.org/downloads/)
|
||||
1. python- see instructions [here](https://www.python.org/downloads/)
|
||||
1. uv - see instructions [here](https://github.com/astral-sh/uv#installation)
|
||||
|
||||
### Installation
|
||||
|
||||
@@ -26,19 +25,15 @@ If everything went well, you can proceed to [connect a client](../../connect-a-c
|
||||
|
||||
1. Open a terminal.
|
||||
2. Navigate to the project directory.
|
||||
3. Create a virtual environment by running `python3 -m venv talemate_env`.
|
||||
4. Activate the virtual environment by running `source talemate_env/bin/activate`.
|
||||
3. uv will automatically create a virtual environment when you run `uv venv`.
|
||||
|
||||
### Installing Dependencies
|
||||
|
||||
1. With the virtual environment activated, install poetry by running `pip install poetry`.
|
||||
2. Use poetry to install dependencies by running `poetry install`.
|
||||
1. Use uv to install dependencies by running `uv pip install -e ".[dev]"`.
|
||||
|
||||
### Running the Backend
|
||||
|
||||
1. With the virtual environment activated and dependencies installed, you can start the backend server.
|
||||
2. Navigate to the `src/talemate/server` directory.
|
||||
3. Run the server with `python run.py runserver --host 0.0.0.0 --port 5050`.
|
||||
1. You can start the backend server using `uv run src/talemate/server/run.py runserver --host 0.0.0.0 --port 5050`.
|
||||
|
||||
### Running the Frontend
|
||||
|
||||
@@ -46,4 +41,4 @@ If everything went well, you can proceed to [connect a client](../../connect-a-c
|
||||
2. If you haven't already, install npm dependencies by running `npm install`.
|
||||
3. Start the server with `npm run serve`.
|
||||
|
||||
Please note that you may need to set environment variables or modify the host and port as per your setup. You can refer to the `runserver.sh` and `frontend.sh` files for more details.
|
||||
Please note that you may need to set environment variables or modify the host and port as per your setup. You can refer to the various start scripts for more details.
|
||||
@@ -2,12 +2,9 @@
|
||||
|
||||
## Windows
|
||||
|
||||
### Installation fails with "Microsoft Visual C++" error
|
||||
|
||||
If your installation errors with a notification to upgrade "Microsoft Visual C++" go to https://visualstudio.microsoft.com/visual-cpp-build-tools/ and click "Download Build Tools" and run it.
|
||||
### Frontend fails with errors
|
||||
|
||||
- During installation make sure you select the C++ development package (upper left corner)
|
||||
- Run `reinstall.bat` inside talemate directory
|
||||
- ensure none of the directories leading to your talemate directory have special characters in them, this can cause issues with the frontend. so no `(1)` in the directory name.
|
||||
|
||||
## Docker
|
||||
|
||||
|
||||
@@ -1,42 +1,32 @@
|
||||
## Quick install instructions
|
||||
|
||||
!!! warning
|
||||
python 3.12 is currently not supported
|
||||
1. Download the latest Talemate release ZIP from the [Releases page](https://github.com/vegu-ai/talemate/releases) and extract it anywhere on your system (for example, `C:\Talemate`).
|
||||
2. Double-click **`start.bat`**.
|
||||
- On the very first run Talemate will automatically:
|
||||
1. Download a portable build of Python 3 and Node.js (no global installs required).
|
||||
2. Create and configure a Python virtual environment.
|
||||
3. Install all back-end and front-end dependencies with the included *uv* and *npm*.
|
||||
4. Build the web client.
|
||||
3. When the console window prints **"Talemate is now running"** and the logo appears, open your browser at **http://localhost:8080**.
|
||||
|
||||
1. Download and install Python 3.10 or Python 3.11 from the [official Python website](https://www.python.org/downloads/windows/).
|
||||
- [Click here for direct link to python 3.11.9 download](https://www.python.org/downloads/release/python-3119/)
|
||||
1. Download and install Node.js from the [official Node.js website](https://nodejs.org/en/download/prebuilt-installer). This will also install npm.
|
||||
1. Download the Talemate project to your local machine. Download from [the Releases page](https://github.com/vegu-ai/talemate/releases).
|
||||
1. Unpack the download and run `install.bat` by double clicking it. This will set up the project on your local machine.
|
||||
1. Once the installation is complete, you can start the backend and frontend servers by running `start.bat`.
|
||||
1. Navigate your browser to http://localhost:8080
|
||||
!!! note "First start can take a while"
|
||||
The initial download and dependency installation may take several minutes, especially on slow internet connections. The console will keep you updated – just wait until the Talemate logo shows up.
|
||||
|
||||
If everything went well, you can proceed to [connect a client](../../connect-a-client).
|
||||
### Optional: CUDA support
|
||||
|
||||
## Additional Information
|
||||
If you have an NVIDIA GPU and want CUDA acceleration for larger embedding models:
|
||||
|
||||
### How to Install Python 3.10 or 3.11
|
||||
1. Close Talemate (if it is running).
|
||||
2. Double-click **`install-cuda.bat`**. This script swaps the CPU-only Torch build for the CUDA 12.8 build.
|
||||
3. Start Talemate again via **`start.bat`**.
|
||||
|
||||
1. Visit the official Python website's download page for Windows at [https://www.python.org/downloads/windows/](https://www.python.org/downloads/windows/).
|
||||
2. Find the latest version of Python 3.10 or 3.11 and click on one of the download links. (You will likely want the Windows installer (64-bit))
|
||||
4. Run the installer file and follow the setup instructions. Make sure to check the box that says Add Python 3.10 to PATH before you click Install Now.
|
||||
## Maintenance & advanced usage
|
||||
|
||||
### How to Install npm
|
||||
| Script | Purpose |
|
||||
|--------|---------|
|
||||
| **`start.bat`** | Primary entry point – performs the initial install if needed and then starts Talemate. |
|
||||
| **`install.bat`** | Runs the installer without launching the server. Useful for automated setups or debugging. |
|
||||
| **`install-cuda.bat`** | Installs the CUDA-enabled Torch build (run after the regular install). |
|
||||
| **`update.bat`** | Pulls the latest changes from GitHub, updates dependencies, rebuilds the web client. |
|
||||
|
||||
1. Download Node.js from the official site [https://nodejs.org/en/download/prebuilt-installer](https://nodejs.org/en/download/prebuilt-installer).
|
||||
2. Run the installer (the .msi installer is recommended).
|
||||
3. Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).
|
||||
|
||||
### Usage of the Supplied bat Files
|
||||
|
||||
#### install.bat
|
||||
|
||||
This batch file is used to set up the project on your local machine. It creates a virtual environment, activates it, installs poetry, and uses poetry to install dependencies. It then navigates to the frontend directory and installs the necessary npm packages.
|
||||
|
||||
To run this file, simply double click on it or open a command prompt in the same directory and type `install.bat`.
|
||||
|
||||
#### start.bat
|
||||
|
||||
This batch file is used to start the backend and frontend servers. It opens two command prompts, one for the frontend and one for the backend.
|
||||
|
||||
To run this file, simply double click on it or open a command prompt in the same directory and type `start.bat`.
|
||||
No system-wide Python or Node.js is required – Talemate uses the embedded runtimes it downloads automatically.
|
||||
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 33 KiB |
BIN
docs/img/0.30.0/auto-direction-unavailable.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
docs/img/0.30.0/auto-progress-on.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
docs/img/0.30.0/client-ratelimit-notification.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
docs/img/0.30.0/client-ratelimit-popup.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
docs/img/0.30.0/client-ratelimit.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
docs/img/0.30.0/connect-a-client-add-client-modal.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
docs/img/0.30.0/connect-a-client-ready.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
docs/img/0.30.0/conversation-content-settings.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
docs/img/0.30.0/conversation-general-settings.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
docs/img/0.30.0/create-template-scene-type.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
docs/img/0.30.0/creator-agent-item.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
docs/img/0.30.0/creator-autocomplete-settings.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
docs/img/0.30.0/director-auto-direction-settings.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
docs/img/0.30.0/editor-has-messages.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
docs/img/0.30.0/editor-revision-history.png
Normal file
|
After Width: | Height: | Size: 131 KiB |
BIN
docs/img/0.30.0/editor-revision-issue-identified.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
docs/img/0.30.0/editor-revision-rewriting.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
docs/img/0.30.0/editor-revision-settings-dedupe.png
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
docs/img/0.30.0/editor-revision-settings-rewrite.png
Normal file
|
After Width: | Height: | Size: 117 KiB |
BIN
docs/img/0.30.0/editor-revision-settings-unslop.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
docs/img/0.30.0/inference-preset-group-applied.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
docs/img/0.30.0/inference-preset-group-apply.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docs/img/0.30.0/inference-presets-1.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
docs/img/0.30.0/inference-presets-custom-group-1.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
docs/img/0.30.0/inference-presets-custom-group-2.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
docs/img/0.30.0/save-graph.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
docs/img/0.30.0/scene-tool-character-actions.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
docs/img/0.30.0/scene-tool-creative-actions.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
docs/img/0.30.0/scene-tool-creative-introduce-2.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
docs/img/0.30.0/scene-tool-intro-char-1.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
docs/img/0.30.0/scene-tool-intro-char-templates.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
docs/img/0.30.0/scene-tool-narrator-actions.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
docs/img/0.30.0/writing-style-phrase-detection.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
docs/img/0.31.0/client-endpoint-override.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
docs/img/0.31.0/client-ollama-no-model.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
docs/img/0.31.0/client-ollama-offline.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
docs/img/0.31.0/client-ollama-ready.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
docs/img/0.31.0/client-ollama-select-model.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
docs/img/0.31.0/client-ollama.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
docs/img/0.31.0/client-openrouter-no-api-key.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
docs/img/0.31.0/client-openrouter-ready.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
docs/img/0.31.0/client-openrouter-select-model.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
docs/img/0.31.0/client-openrouter.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
docs/img/0.31.0/history-add-entry.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
docs/img/0.31.0/history-regenerate-all.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
docs/img/0.31.0/history.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
docs/img/0.31.0/koboldcpp-embeddings.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
docs/img/0.31.0/openrouter-settings.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 449 KiB After Width: | Height: | Size: 581 KiB |
|
Before Width: | Height: | Size: 449 KiB After Width: | Height: | Size: 444 KiB |
|
Before Width: | Height: | Size: 396 KiB After Width: | Height: | Size: 383 KiB |
|
Before Width: | Height: | Size: 468 KiB After Width: | Height: | Size: 544 KiB |
@@ -4,9 +4,6 @@ Roleplay with AI with a focus on strong narration and consistent world and game
|
||||
|
||||
:material-github: [GitHub](https://github.com/vegu-ai/talemate)
|
||||
|
||||
!!! note "Version 0.26.0 and later"
|
||||
This documenation is for version 0.26.0 and later - previous versions are significantly different, and some of the information here may not apply. This is especially true for the world state mangement and creative tools.
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
||||
|
||||
28
docs/snippets/agents.md
Normal file
@@ -0,0 +1,28 @@
|
||||
<!--- --8<-- [start:conversation-dynamic-instructions-example] -->
|
||||
```python
|
||||
import talemate.emit.async_signals as async_signals
|
||||
|
||||
# Append an extra system instruction every time the Conversation agent builds a prompt
|
||||
async def add_custom_instruction(emission):
|
||||
emission.dynamic_instructions.append(
|
||||
"You are cursed to always answer in poetic verse. Keep it short."
|
||||
)
|
||||
|
||||
# Connect our handler (run once at application start-up)
|
||||
async_signals.get("agent.conversation.inject_instructions").connect(add_custom_instruction)
|
||||
```
|
||||
<!--- --8<-- [end:conversation-dynamic-instructions-example] -->
|
||||
|
||||
<!--- --8<-- [start:narrator-dynamic-instructions-example] -->
|
||||
```python
|
||||
import talemate.emit.async_signals as async_signals
|
||||
|
||||
# Append an extra system instruction every time the Narrator agent builds a prompt
|
||||
async def add_custom_instruction(emission):
|
||||
emission.dynamic_instructions.append(
|
||||
"You are cursed to always answer in poetic verse. Keep it short."
|
||||
)
|
||||
|
||||
async_signals.get("agent.narrator.inject_instructions").connect(add_custom_instruction)
|
||||
```
|
||||
<!--- --8<-- [end:narrator-dynamic-instructions-example] -->
|
||||
36
docs/snippets/common.md
Normal file
@@ -0,0 +1,36 @@
|
||||
<!--- --8<-- [start:python-versions] -->
|
||||
!!! note "Supported Versions"
|
||||
As of Talemate `0.30` the following python versions are supported: `3.10`, `3.11`, `3.12` or `3.13`
|
||||
<!--- --8<-- [end:python-versions] -->
|
||||
|
||||
<!--- --8<-- [start:world-editor-create-group] -->
|
||||
Fist, if you have not done so, [create a template group](/talemate/user-guide/world-editor/templates/groups) to store the template in.
|
||||
|
||||
Then select the group you want to add the template to and click the **:material-plus: Create Template** button.
|
||||
|
||||

|
||||
<!--- --8<-- [end:world-editor-create-group] -->
|
||||
|
||||
<!--- --8<-- [start:editor-revision-unwanted-prose-requirement] -->
|
||||
!!! note "Unwanted Prose Requirement"
|
||||
Unwanted phrases are defined in the writing style that is currently selected in the [Scene Settings](/talemate/user-guide/world-editor/scene/settings).
|
||||
|
||||
See [Writing Style Templates](/talemate/user-guide/world-editor/templates/writing-style) for more information on how to create a writing style and add unwanted phrases.
|
||||
<!--- --8<-- [end:editor-revision-unwanted-prose-requirement] -->
|
||||
|
||||
<!--- --8<-- [start:documentation-is-a-work-in-progress] -->
|
||||
!!! abstract "Documentation is a work in progress"
|
||||
Documentation is an ongoing effort and some parts are more complete than others, with some missing entirely. Thanks for your patience, its being worked on!
|
||||
|
||||
See the [Node Editor - Crash Course](/talemate/user-guide/howto/infinity-quest-dynamic/) tutorial for an extensive introduction to the node editor.
|
||||
<!--- --8<-- [end:documentation-is-a-work-in-progress] -->
|
||||
|
||||
<!--- --8<-- [start:save-scene-project] -->
|
||||
!!! success "Save!"
|
||||
**:material-content-save: Save** the scene project.
|
||||
<!--- --8<-- [end:save-scene-project] -->
|
||||
|
||||
<!--- --8<-- [start:save-graph] -->
|
||||
!!! success "Save!"
|
||||
**:material-check-circle-outline: Save** the module.
|
||||
<!--- --8<-- [end:save-graph] -->
|
||||
60
docs/style.css
Normal file
@@ -0,0 +1,60 @@
|
||||
pre > code {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
/* Custom load admonition */
|
||||
.md-typeset .admonition.load,
|
||||
.md-typeset details.load {
|
||||
border-color: #9c27b0;
|
||||
}
|
||||
|
||||
.md-typeset .load > .admonition-title,
|
||||
.md-typeset .load > summary {
|
||||
background-color: rgba(156, 39, 176, 0.1);
|
||||
border-color: #9c27b0;
|
||||
}
|
||||
|
||||
.md-typeset .load > .admonition-title::before,
|
||||
.md-typeset .load > summary::before {
|
||||
background-color: #9c27b0;
|
||||
-webkit-mask-image: var(--md-admonition-icon--load);
|
||||
mask-image: var(--md-admonition-icon--load);
|
||||
}
|
||||
|
||||
/* custom event payload admonition */
|
||||
.md-typeset .admonition.payload,
|
||||
.md-typeset details.payload {
|
||||
border-color: #616799;
|
||||
}
|
||||
|
||||
.md-typeset .payload > .admonition-title,
|
||||
.md-typeset .payload > summary {
|
||||
background-color: rgba(97, 103, 153, 0.1);
|
||||
border-color: #616799;
|
||||
}
|
||||
|
||||
.md-typeset .payload > .admonition-title::before,
|
||||
.md-typeset .payload > summary::before {
|
||||
background-color: #616799;
|
||||
-webkit-mask-image: var(--md-admonition-icon--payload);
|
||||
mask-image: var(--md-admonition-icon--payload);
|
||||
}
|
||||
|
||||
/* custom learn more admonition (605381 color) */
|
||||
.md-typeset .admonition.learn-more,
|
||||
.md-typeset details.learn-more {
|
||||
border-color: #605381;
|
||||
}
|
||||
|
||||
.md-typeset .learn-more > .admonition-title,
|
||||
.md-typeset .learn-more > summary {
|
||||
background-color: rgba(96, 83, 129, 0.1);
|
||||
border-color: #605381;
|
||||
}
|
||||
|
||||
.md-typeset .learn-more > .admonition-title::before,
|
||||
.md-typeset .learn-more > summary::before {
|
||||
background-color: #6f5aa3;
|
||||
-webkit-mask-image: var(--md-admonition-icon--learn-more);
|
||||
mask-image: var(--md-admonition-icon--learn-more);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
# Overview
|
||||
|
||||
The conversation agent drives the AI generated dialogue.
|
||||
Also known as the **Actor** agent it is responsible for generating character driven dialogue and actions.
|
||||
|
||||
It rquires a text-generation client to be configured and assigned.
|
||||
It requires a text-generation client to be configured and assigned.
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## General
|
||||
|
||||

|
||||

|
||||
|
||||
!!! note "Inference perameters"
|
||||
Inference parameters are NOT configured through any individual agent.
|
||||
@@ -17,17 +17,11 @@ The text-generation client to use for conversation generation.
|
||||
|
||||
If checked and talemate detects a repetitive response (based on a threshold), it will automatically re-generate the resposne with increased randomness parameters.
|
||||
|
||||
##### Natural Flow
|
||||
!!! note "Deprecated"
|
||||
This will soon be removed in favor of the new [Editor Agent Revision Action](/talemate/user-guide/agents/editor/settings#revision)
|
||||
|
||||
When there are multiple characters in the scene, this will help the AI to keep the conversation flowing naturally, making sure turns are somewhat evenly distributed, and also checking that the most relevant character gets the next turn, based on the context.
|
||||
|
||||
##### Max. Auto turns
|
||||
|
||||
Maximum turns the AI gets in succession, before the player gets a turn no matter what.
|
||||
|
||||
##### Max. Idle turns
|
||||
|
||||
The maximum number of turns a character can go without speaking before the AI will force them to speak.
|
||||
!!! note "Natural flow was moved"
|
||||
The natural flow settings have been moved to the [Director Agent](/talemate/user-guide/agents/director) settings as part of the auto direction feature.
|
||||
|
||||
## Generation
|
||||
|
||||
@@ -64,6 +58,14 @@ General, broad isntructions for ALL actors in the scene. This will be appended t
|
||||
|
||||
If > 0 will offset the instructions for the actor (both broad and character specific) into the history by that many turns. Some LLMs struggle to generate coherent continuations if the scene is interrupted by instructions right before the AI is asked to generate dialogue. This allows to shift the instruction backwards.
|
||||
|
||||
## :material-script-text: Content
|
||||
|
||||

|
||||
|
||||
Enable this setting to apply a writing style to the generated content.
|
||||
|
||||
Make sure the a writing style is selected in the [Scene Settings](/talemate/user-guide/world-editor/scene/settings) to apply the writing style to the generated content.
|
||||
|
||||
## Long Term Memory
|
||||
|
||||
--8<-- "docs/snippets/tips.md:agent_long_term_memory_settings"
|
||||
@@ -1,5 +1,3 @@
|
||||
# Overview
|
||||
|
||||
The creator agent is responsible for creating the AI generated content. It requires a text-generation client to be configured and assigned.
|
||||
|
||||
Currently exposes no settings to configure the agent itself.
|
||||
Used tor most creative tasks that involves the creation of new context.
|
||||
21
docs/user-guide/agents/creator/settings.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Settings
|
||||
|
||||
Open by clicking the **Creator** agent in the agent list.
|
||||
|
||||

|
||||
|
||||
## Long Term Memory
|
||||
|
||||
--8<-- "docs/snippets/tips.md:agent_long_term_memory_settings"
|
||||
|
||||
## Autocomplete
|
||||
|
||||

|
||||
|
||||
##### Dialogue Suggestion Length
|
||||
|
||||
How many tokens to generate (max.) when autocompleting character actions.
|
||||
|
||||
##### Narrative Suggestion Length
|
||||
|
||||
How many tokens to generate (max.) when autocompleting narrative text.
|
||||
@@ -7,4 +7,10 @@ In the future it will shift / expose more of a game master role, controlling the
|
||||
Will occasionally generate clickable choices for the user during scene progression. This can be used to allow the user to make choices that will affect the scene or the story in some way without having to manually type out the choice.
|
||||
|
||||
### Guide Scene
|
||||
Will use the summarizer agent's scene analysis to guide characters and the narrator for the next generation, hopefully improving the quality of the generated content.
|
||||
Will use the summarizer agent's scene analysis to guide characters and the narrator for the next generation, hopefully improving the quality of the generated content.
|
||||
|
||||
### Auto Direction
|
||||
A very experimental feature that will cause the director to attempt to direct the scene automatically, instructing actors or the narrator to move the scene forward according to the story and scene intention.
|
||||
|
||||
!!! note "Experimental"
|
||||
This is the first iteration of this feature and is very much a work in progress. It will likely change substantially in the future.
|
||||
@@ -88,4 +88,70 @@ If enabled the director will guide the narrator in the scene.
|
||||
|
||||
##### Max. Guidance Length
|
||||
|
||||
The maximum number of tokens for the guidance. (e.g., how long should the guidance be).
|
||||
The maximum number of tokens for the guidance. (e.g., how long should the guidance be).
|
||||
|
||||
## Auto Direction
|
||||
|
||||
A very experimental first attempt at giving the reigns to the director to direct the scene automatically.
|
||||
|
||||
Currently it can only instruct actors and the narrator, but different actions will be exposed in the future. This is very early in the development cycle and will likely go through substantial changes.
|
||||
|
||||
!!! note "Both overall and current intent need to be set for auto-direction to be available"
|
||||
If either the overall or current scene intention is not set, the auto-direction feature will not be available.
|
||||
|
||||

|
||||
|
||||
Story and scene intentions are set in the [Scene Direction](/talemate/user-guide/world-editor/scene/direction) section of the World Editor.
|
||||
|
||||

|
||||
|
||||
##### Enable Auto Direction
|
||||
|
||||
Turn auto direction on and off.
|
||||
|
||||
!!! note "Auto progress needs to also be enabled"
|
||||
If auto direction is enabled, auto progress needs to be enabled as well.
|
||||
|
||||

|
||||
#### Natural flow
|
||||
|
||||
Will place strict limits on actor turns based on the provided constraints. That means regardless of what the director would like to do, the actor availability will always take precedence.
|
||||
|
||||
##### Max. Auto turns
|
||||
|
||||
Maximum turns the AI gets in succession (spread accross characters). When this limit is reached, the player will get a turn no matter what.
|
||||
|
||||
##### Max. Idle turns
|
||||
|
||||
The maximum number of turns a character can go without speaking before they are automatically given a turn by the director. (per character)
|
||||
|
||||
##### Max. Repeat Turns
|
||||
|
||||
The maximum number of times a character can go in succession without speaking before the director will force them to speak. (per character)
|
||||
|
||||
|
||||
#### Instructions
|
||||
|
||||
##### Instruct Actors
|
||||
|
||||
Allow the director to instruct actors.
|
||||
|
||||
##### Instruct Narrator
|
||||
|
||||
Allow the director to instruct the narrator.
|
||||
|
||||
##### Instruct Frequency
|
||||
|
||||
Only pass on instructions to the actors or the narrator every N turns.
|
||||
|
||||
!!! note "Evaluation of the scene happens regardless"
|
||||
The director will evaluate the scene after each round regardless of the frequency. This setting merely controls how often the instructions are actually passed on.
|
||||
|
||||
##### Evaluate Scene Intention
|
||||
|
||||
Allows the director to evaluate the current scene phase and switch to a different scene type or set a new intention.
|
||||
|
||||
The number of turns between evaluations. (0 = NEVER)
|
||||
|
||||
!!! note "Recommended to leave at 0 (never)"
|
||||
This isn't really working well at this point, so recommended to leave at 0 (never)
|
||||
17
docs/user-guide/agents/editor/revisions.md
Normal file
@@ -0,0 +1,17 @@
|
||||
Revisions were introduced in version `0.30.0` and allow the editor to detect and fix repetition and unwanted prose.
|
||||
|
||||
Please see the [settings](/talemate/user-guide/agents/editor/settings/#revision) for more information on how to configure **:material-typewriter: Revisions**.
|
||||
|
||||
Once automatic revisions are enabled, if the editor finds an issue in a message you will see the following status updates:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Once the revision is complete the editor agent will indicate that that it made some changes by showing the :material-message-text-outline: icon next to its name.
|
||||
|
||||

|
||||
|
||||
Click the :material-message-text-outline: icon to open the Agent Messages dialog to view the changes.
|
||||
|
||||

|
||||
@@ -1,5 +1,7 @@
|
||||
# Settings
|
||||
|
||||
## General
|
||||
|
||||

|
||||
|
||||
##### Fix exposition
|
||||
@@ -20,12 +22,125 @@ Applies the same rules as above to the user input messages.
|
||||
|
||||
Will take the generate message and attempt to add more detail to it.
|
||||
|
||||
##### Fix continuity errors
|
||||
## Long Term Memory
|
||||
|
||||
Will attempt to fix continuity errors in the generated text.
|
||||
--8<-- "docs/snippets/tips.md:agent_long_term_memory_settings"
|
||||
|
||||
!!! example "Experimental, and doesn't work most of the time"
|
||||
There is something about accurately identifying continuity errors that is currently very
|
||||
difficult for AI to do. So this feature is very hit and miss. More miss than hit.
|
||||
## Revision
|
||||
|
||||
Also takes long to process, so probably leave it turned off.
|
||||

|
||||
|
||||
When :material-typewriter: revision is enabled the editor will analyze and attempt to fix character messages, narrator messages, and contextual generation (such as character attributes, details, world context, etc.).
|
||||
|
||||
Currently it can detect the following issues:
|
||||
|
||||
- Repetition of phrases / concepts
|
||||
- Unwanted prose as defined in the writing style
|
||||
|
||||
The revision action is split into three parts:
|
||||
|
||||
- Find any issues through fuzzy, regex and semantic similarity (embeddings) matching
|
||||
- Analyze the issues and plan a fix
|
||||
- Apply the fix
|
||||
|
||||
This means it comes at a noticable delay IF it finds issues, but the improvements may be worth it.
|
||||
|
||||
##### Enable Revision
|
||||
|
||||
Check this to enable revision.
|
||||
|
||||
##### Automatic Revision
|
||||
|
||||
Check this to enable automatic revision - this will analyze each incoming actor or narrator message and attempt to fix it if there are issues.
|
||||
|
||||
##### Automatic Revision Targets
|
||||
|
||||
When automatic revision is enabled, you can choose which types of messages to automatically revise:
|
||||
|
||||
- **Character Messages** - Automatically revise actor actions and dialogue
|
||||
- **Narration Messages** - Automatically revise narrator actions and descriptions
|
||||
- **Contextual generation** - Automatically revise generated context such as character attributes, details, world context, scene intros, etc.
|
||||
|
||||
By default, both Character Messages and Narration Messages are enabled. You can enable or disable each type independently based on your preferences.
|
||||
|
||||
##### Revision Method
|
||||
|
||||
Which method to use to fix issues.
|
||||
|
||||
- `Dedupe (Fast and dumb)` - this is the default
|
||||
- `Unslop (AI assisted)` - calls 1 additional prompt after generation to remove repetition, purple prose, unnatural dialogue, and over-description
|
||||
- `Targeted Rewrite (AI assisted)` - analyzes text for specific issues and rewrites only problematic parts
|
||||
|
||||
**Dedupe (Fast and dumb)**
|
||||
|
||||

|
||||
|
||||
When **Dedupe** is active it will be restricted to finding repetition and removing it without replacing it with something else, nor understanding the intent or context, so it may sometimes cause disjointed dialogue. This method is much faster as it will never prompt the AI for analysis and fixes. (If repetition detection is set to semantic similarity, it will still use the embedding function to find repetition, but it will not prompt the AI for analysis and fixes.)
|
||||
|
||||
**Unslop (AI assisted)**
|
||||
|
||||

|
||||
|
||||
When **Unslop** is active, it calls 1 additional prompt after a generation and will attempt to remove repetition, purple prose, unnatural dialogue, and over-description. May cause details to be lost. This is a general-purpose cleanup method that can also use unwanted prose detection when enabled.
|
||||
|
||||
**Targeted Rewrite (AI assisted)**
|
||||
|
||||

|
||||
|
||||
When **Targeted Rewrite** is active, unwanted prose detection becomes available and when issues are detected the AI will attempt to rewrite the message to fix the issues. This method checks for specific problems first, then only rewrites if enough issues are found.
|
||||
|
||||
#### Repetition
|
||||
|
||||
##### Repetition Detection Method
|
||||
|
||||
How is repetition detected.
|
||||
|
||||
- `Fuzzy` - fuzzy matching will match based on character-level similarity, finding text that is approximately the same with small differences (like typos, missing letters, or minor variations). This is faster but less context-aware than semantic matching.
|
||||
- `Semantic Similarity` - will match based on the semantic meaning of the text using the Memory Agent's embedding function. (default)
|
||||
|
||||
!!! warning "Semantic Similarity"
|
||||
Uses the memory agent's embedding function to compare the text. Will use batching when available, but has the potential to do A LOT of calls to the embedding model.
|
||||
|
||||
##### Similarity Threshold
|
||||
|
||||
How similar does the text need to be to be considered repetitive. (50 - 100%)
|
||||
|
||||
You want to keep this relatively high.
|
||||
|
||||
##### Repetition Range
|
||||
|
||||
This is the number of **MESSAGES** to consider in the history when checking for repetition.
|
||||
|
||||
At its default of `15` it means the last 15 messages will be considered.
|
||||
|
||||
##### Repetition Min. Length
|
||||
|
||||
The minimum length of a phrase (in characters) to be considered for repetition. Shorter phrases will be ignored.
|
||||
|
||||
### AI-Assisted Methods (Unslop & Targeted Rewrite)
|
||||
|
||||
Once switched to either **Unslop** or **Targeted Rewrite** mode, additional settings become available.
|
||||
|
||||
#### Preferences for Rewriting (Targeted Rewrite only)
|
||||
|
||||
##### Test parts of sentences, split on commas
|
||||
|
||||
If active this means that when a sentence doesn't produce a hit, if it has one or more commas it will split the sentence on the commas and test each part individually.
|
||||
|
||||
##### Minimum issues
|
||||
|
||||
The minimum amount of issues that need to be detected to trigger a rewrite.
|
||||
|
||||
#### Unwanted Prose (Both Unslop & Targeted Rewrite)
|
||||
|
||||
##### Detect Unwanted Prose
|
||||
|
||||
Check this to enable unwanted prose detection. Available for both **Unslop** and **Targeted Rewrite** methods.
|
||||
|
||||
--8<-- "docs/snippets/common.md:editor-revision-unwanted-prose-requirement"
|
||||
|
||||
##### Unwanted Prose Threshold
|
||||
|
||||
Similarity threshold for unwanted prose detection. (0.4 - 1.0)
|
||||
|
||||
You want to keep this relatively high.
|
||||
|
||||
@@ -14,6 +14,10 @@ Used for creative tasks like scene and character generation
|
||||
|
||||
Will eventually become a Game Master type agent. Right now used for some very rudimentary scene direction. Allows complex scene control via the scoped api scripting.
|
||||
|
||||
### Editor
|
||||
|
||||
Will try to correct markup and optionally revise text to fix repetition and unwanted prose.
|
||||
|
||||
### Long-term Memory
|
||||
|
||||
Attempts to select and add relevant information to the current context window.
|
||||
|
||||
@@ -21,6 +21,12 @@ Sentence transformer model that is decently fast and accurate and will likely be
|
||||
|
||||
### Instructor Models
|
||||
|
||||
!!! warning "Support of these likely deprecated"
|
||||
Its become increasingly difficult to install support for these while keeping other dependencies up to date.
|
||||
See [this issue](https://github.com/vegu-ai/talemate/issues/176) for more details.
|
||||
|
||||
Use the `Alibaba-NLP/Gte-Base-En-V1.5` embedding instead, its pretty close in accuracy and much smaller.
|
||||
|
||||
Instructor embeddings, coming in three sizes: `base`, `large`, and `xl`. XL is the most accurate but also has the biggest memory footprint and is the slowest. Using `cuda` is recommended for the `xl` and `large` models.
|
||||
|
||||
### OpenAI text-embedding-3-small
|
||||
|
||||
25
docs/user-guide/agents/memory/koboldcpp.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# KoboldCpp Embeddings
|
||||
|
||||
Talemate can leverage an embeddings model that is already loaded in your KoboldCpp instance.
|
||||
|
||||
## 1. Start KoboldCpp with an embeddings model
|
||||
|
||||
Launch KoboldCpp with the `--embeddingsmodel` flag so that it loads an embeddings-capable GGUF model alongside the main LLM:
|
||||
|
||||
```bash
|
||||
koboldcpp_cu12.exe --model google_gemma-3-27b-it-Q6_K.gguf --embeddingsmodel bge-large-en-v1.5.Q8_0.gguf
|
||||
```
|
||||
|
||||
## 2. Talemate will pick it up automatically
|
||||
|
||||
When Talemate starts, the **Memory** agent probes every connected client that advertises embedding support. If it detects that your KoboldCpp instance has an embeddings model loaded:
|
||||
|
||||
1. The Memory backend switches the current embedding to **Client API**.
|
||||
2. The `client` field in the agent details shows the name of the KoboldCpp client.
|
||||
3. A banner informs you that Talemate has switched to the new embedding. <!-- stub: screenshot -->
|
||||
|
||||

|
||||
|
||||
## 3. Reverting to a local embedding
|
||||
|
||||
Open the memory agent settings and pick a different embedding. See [Memory agent settings](/talemate/user-guide/agents/memory/settings).
|
||||
@@ -5,5 +5,6 @@ nav:
|
||||
- Google Cloud: google.md
|
||||
- Groq: groq.md
|
||||
- Mistral.ai: mistral.md
|
||||
- OpenRouter: openrouter.md
|
||||
- OpenAI: openai.md
|
||||
- ...
|
||||
11
docs/user-guide/apis/openrouter.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# OpenRouter API Setup
|
||||
|
||||
Talemate can use any model accessible through OpenRouter.
|
||||
|
||||
You need an OpenRouter API key and must set it in the application config. You can create and manage keys in your OpenRouter dashboard at [https://openrouter.ai/keys](https://openrouter.ai/keys).
|
||||
|
||||
Once you have generated a key open the Talemate settings, switch to the `APPLICATION` tab and then select the `OPENROUTER API` category. Paste your key in the **API Key** field.
|
||||
|
||||

|
||||
|
||||
Finally click **Save** to store the credentials.
|
||||
@@ -4,4 +4,5 @@ nav:
|
||||
- Recommended Local Models: recommended-models.md
|
||||
- Inference Presets: presets.md
|
||||
- Client Types: types
|
||||
- Endpoint Override: endpoint-override.md
|
||||
- ...
|
||||
24
docs/user-guide/clients/endpoint-override.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Endpoint Override
|
||||
|
||||
Starting in version 0.31.0 it is now possible for some of the remote clients to override the endpoint used for the API.
|
||||
|
||||
THis is helpful wehn you want to point the client at a proxy gateway to serve the api instead (LiteLLM for example).
|
||||
|
||||
!!! warning "Only use trusted endpoints"
|
||||
Only use endpoints that you trust and NEVER used your actual API key with them, unless you are hosting your endpoint proxy yourself.
|
||||
|
||||
If you need to provide an api key there is a separate field for that specifically in the endpoint override settings.
|
||||
|
||||
## How to use
|
||||
|
||||
Clients that support it will have a tab in their settings that allows you to override the endpoint.
|
||||
|
||||

|
||||
|
||||
##### Base URL
|
||||
|
||||
The base URL of the endpoint. For example, `http://localhost:4000` if you're running a local LiteLLM gateway,
|
||||
|
||||
##### API Key
|
||||
|
||||
The API key to use for the endpoint. This is only required if the endpoint requires an API key. This is **NOT** the API key you would use for the official API. For LiteLLM for example this could be the `general_settings.master_key` value.
|
||||
@@ -8,9 +8,9 @@ If you wish to alter the inference parameters sent with the generation requests
|
||||
|
||||

|
||||
|
||||
Navigate to the :material-tune: **Presets** tab then select the preset you wish to edit.
|
||||
Navigate to the :material-tune: **Presets** tab then select the :material-matrix: **Inference** tab.
|
||||
|
||||

|
||||

|
||||
|
||||
!!! warning
|
||||
Not all clients support all parameters, and generally it is assumed that the client implementation handles the parameters in a sane way, especially if values are passed for all of them. All presets are used and will be selected depending on the action the agent is performing. If you don't know what these mean, it is recommended to leave them as they are.
|
||||
@@ -52,4 +52,28 @@ Used mostly for the director when directing the scene flow. Need to be creative
|
||||
|
||||
### Summarization
|
||||
|
||||
Used for summarizing the scene progress into narrative text.
|
||||
Used for summarizing the scene progress into narrative text.
|
||||
|
||||
|
||||
## Preset Groups
|
||||
|
||||
Initially there is a `Default` group in which the presets are edited, but if you want you can create additional groups to create - for example - model / client specific presets.
|
||||
|
||||
To add a new group, type the title in to the **New Group Name** field in the upper right and press `Enter`.
|
||||
|
||||

|
||||
|
||||
|
||||
The new group will be added and automatically selected for editing.
|
||||
|
||||

|
||||
|
||||
Once you have adjusted the presets to your liking you can save the group by clicking the :material-content-save: **Save** button.
|
||||
|
||||
### Setting the group for the client
|
||||
|
||||
In the client listing find the :material-tune: selected preset and click it to expand the meny containing the groups.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
19
docs/user-guide/clients/rate-limiting.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Rate Limiting
|
||||
|
||||
You can rate limit a client to N requests per minute.
|
||||
|
||||

|
||||
|
||||
Once the limit is hit you will get a popup notification.
|
||||
|
||||

|
||||
|
||||
Here you can either choose to wait for the rate limit to reset, or to abort the generation.
|
||||
|
||||
If you abort the generation, the current stack of actions will be canceled and control will be given back to the user. This is essentially the same as Cancelling the generation through normal means.
|
||||
|
||||
If you chose to wait the notification will collapse to the top of the screen with a timer counting down the remaining time.
|
||||
|
||||
Clicking the notification will expand it again.
|
||||
|
||||

|
||||
@@ -8,6 +8,8 @@ nav:
|
||||
- Mistral.ai: mistral.md
|
||||
- OpenAI: openai.md
|
||||
- OpenAI Compatible: openai-compatible.md
|
||||
- Ollama: ollama.md
|
||||
- OpenRouter: openrouter.md
|
||||
- TabbyAPI: tabbyapi.md
|
||||
- Text-Generation-WebUI: text-generation-webui.md
|
||||
- ...
|
||||
59
docs/user-guide/clients/types/ollama.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# Ollama Client
|
||||
|
||||
If you want to add an Ollama client, change the `Client Type` to `Ollama`.
|
||||
|
||||

|
||||
|
||||
Click `Save` to add the client.
|
||||
|
||||
### Ollama Server
|
||||
|
||||
The client should appear in the clients list. Talemate will ping the Ollama server to verify that it is running. If the server is not reachable you will see a warning.
|
||||
|
||||

|
||||
|
||||
Make sure that the Ollama server is running (by default at `http://localhost:11434`) and that the model you want to use has been pulled.
|
||||
|
||||
It may also show a yellow dot next to it, saying that there is no model loaded.
|
||||
|
||||

|
||||
|
||||
Open the client settings by clicking the :material-cogs: icon, to select a model.
|
||||
|
||||

|
||||
|
||||
Click save and the client should have a green dot next to it, indicating that it is ready to go.
|
||||
|
||||

|
||||
|
||||
### Settings
|
||||
|
||||
##### Client Name
|
||||
|
||||
A unique name for the client that makes sense to you.
|
||||
|
||||
##### API URL
|
||||
|
||||
The base URL where the Ollama HTTP endpoint is running. Defaults to `http://localhost:11434`.
|
||||
|
||||
##### Model
|
||||
|
||||
Name of the Ollama model to use. Talemate will automatically fetch the list of models that are currently available in your local Ollama instance.
|
||||
|
||||
##### API handles prompt template
|
||||
|
||||
If enabled, Talemate will send the raw prompt and let Ollama apply its own built-in prompt template. If you are unsure leave this disabled – Talemate's own prompt template generally produces better results.
|
||||
|
||||
##### Allow thinking
|
||||
|
||||
If enabled Talemate will allow models that support "thinking" (`assistant:thinking` messages) to deliberate before forming the final answer. At the moment Talemate has limited support for this feature when talemate is handling the prompt template. Its probably ok to turn it on if you let Ollama handle the prompt template.
|
||||
|
||||
!!! tip
|
||||
You can quickly refresh the list of models by making sure the Ollama server is running and then hitting **Save** again in the client settings.
|
||||
|
||||
### Common issues
|
||||
|
||||
#### Generations are weird / bad
|
||||
|
||||
If letting talemate handle the prompt template, make sure the [correct prompt template is assigned](/talemate/user-guide/clients/prompt-templates/).
|
||||
|
||||
48
docs/user-guide/clients/types/openrouter.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# OpenRouter Client
|
||||
|
||||
If you want to add an OpenRouter client, change the `Client Type` to `OpenRouter`.
|
||||
|
||||

|
||||
|
||||
Click `Save` to add the client.
|
||||
|
||||
### OpenRouter API Key
|
||||
|
||||
The client should appear in the clients list. If you haven't set up OpenRouter before, you will see a warning that the API key is missing.
|
||||
|
||||

|
||||
|
||||
Click the `SET API KEY` button. This will open the API settings window where you can add your OpenRouter API key.
|
||||
|
||||
For additional instructions on obtaining and setting your OpenRouter API key, see [OpenRouter API instructions](/talemate/user-guide/apis/openrouter/).
|
||||
|
||||

|
||||
|
||||
Click `Save` and after a moment the client should have a red dot next to it, saying that there is no model loaded.
|
||||
|
||||
Click the :material-cogs: icon to open the client settings and select a model.
|
||||
|
||||
.
|
||||
|
||||
Click save and the client should have a green dot next to it, indicating that it is ready to go.
|
||||
|
||||
### Ready to use
|
||||
|
||||

|
||||
|
||||
### Settings
|
||||
|
||||
##### Client Name
|
||||
|
||||
A unique name for the client that makes sense to you.
|
||||
|
||||
##### Model
|
||||
|
||||
Choose any model available via your OpenRouter account. Talemate dynamically fetches the list of models associated with your API key so new models will show up automatically.
|
||||
|
||||
##### Max token length
|
||||
|
||||
Maximum context length (in tokens) that OpenRouter should consider. If you are not sure leave the default value.
|
||||
|
||||
!!! note "Available models are fetched automatically"
|
||||
Talemate fetches the list of available OpenRouter models when you save the configuration (if a valid API key is present). If you add or remove models to your account later, simply click **Save** in the application settings again to refresh the list.
|
||||