Skip to content

Live Assistant

Roi Horowitz edited this page Dec 2, 2026 · 3 revisions

Live Assistant

A GM-only helper in Foundry. The bot listens to your game's Discord voice channel and, when you ask, suggests what an NPC says, what's in the place the party just walked into, or what happens next. Answers are built from the story and everything in Foundry, and only you see them.

It's off by default, on both sides: the bot's .env and a Foundry setting. Players never see the button or the window.

What it does

  • Hears the table. The bot joins one voice channel and turns each person's speech into text ("Name: text"). It keeps the recent transcript in memory.
  • Answers when you ask. Type a question or press a quick button (What would they say?, What's here?, What next?, A name). Text typed in the box goes along with a quick button as extra detail ("Celdar is wearing the chain"). The answer streams in. Fast is quicker; Deep thinks longer.
  • Answers about this moment. It reacts to the last thing said at the table, in the language the table speaks, and writes in the style of your own journals: prose paragraphs, not bullet lists.
  • NPCs you can read aloud. What would they say? (select the NPC's token first) writes a roleplay passage: how the NPC looks and speaks and what they say right now, then up to 3 short branches under headings such as "If they press" or "If they threaten". It always uses the Deep model, because it's read at the table.
  • Knows your game. Each question carries the recent transcript, the active scene and its journal, the combat tracker, your selected and targeted tokens, journal and story-compendium passages that match the question (pick the compendiums under Story compendiums), and the Assistant Notes journal. A line under each answer says what was sent, and a readout shows the estimated tokens.
  • Remembers what you keep. Save to memory adds an answer to the Assistant Notes journal (GM-only). End session and summarise drafts a session summary you can edit before it's saved. Clear the transcript starts fresh without stopping.
  • Never speaks, never posts to players. It answers only when you ask.

Set it up

1. Turn it on in the bot

In the bot's .env (see Bot Setup):

ASSISTANT=on
ASSISTANT_LLM=anthropic
ANTHROPIC_API_KEY=your key

Then run npm run register (this adds the /assistant command) and restart the bot. Pick the speech-to-text and Claude providers below.

2. Turn it on in Foundry

Configure Settings → Squire → Live assistant, then reload. A hat button appears in the Tokens scene controls, for GMs only. See Foundry Setup.

3. Start listening

Join your voice channel in Discord, open the assistant in Foundry, pick the channel in the window and press Listen. The bot joins, tells the channel it is listening, and shows "Listening for the GM" as its status. Stop ends it.

The bot listens in one voice channel at a time. If it's already listening for another world, Listen is refused until that one stops.

Speech-to-text: pick one

The bot sends short clips of each person's speech to a transcriber that speaks the OpenAI-compatible /v1/audio/transcriptions API. Set where it lives with ASSISTANT_STT_URL.

Local Whisper (audio stays on your machine)

Squire ships a small Whisper server in bot/whisper. Best with an NVIDIA GPU: text appears about half a second after someone stops talking. It also runs on CPU with a smaller model, more slowly.

cd bot/whisper
python -m venv .venv
.venv\Scripts\pip install -r requirements.txt
.venv\Scripts\python server.py --model large-v3-turbo

The first start downloads the model (about 1.5 GB) and the first request after a start is slow while it warms up. Docker works too:

docker build -t squire-whisper .
docker run --gpus all -p 127.0.0.1:8790:8790 squire-whisper

Hebrew tables: run server.py --model ivrit-ai/whisper-large-v3-turbo-ct2 --lang he for much better Hebrew at the same speed. When you press Listen, Foundry sends your campaign's names (characters, tokens, scenes, journal titles) so the transcriber spells them right.

The default ASSISTANT_STT_URL=http://127.0.0.1:8790 already points at it. The full flags are in bot/whisper/README.md.

Never expose local Whisper to the internet. It has no password. Keep it on 127.0.0.1 (the Docker example binds there) or a private network.

A cloud endpoint (no GPU needed)

On a VPS or a NAS without a GPU, point the bot at a hosted OpenAI-compatible transcription API:

ASSISTANT_STT_URL=https://api.openai.com
ASSISTANT_STT_KEY=your key
ASSISTANT_STT_MODEL=whisper-1

The cloud service receives the audio. Set ASSISTANT_STT_LANGUAGE (e.g. he, en) if you always play in one language; leave it empty to detect.

Claude: pick one

ASSISTANT_LLM Needs First words Whole answer
anthropic ANTHROPIC_API_KEY about 2-3 seconds a few seconds
claude-code Claude Code signed in on the bot's machine 6-8 seconds 10-15 seconds

Be honest about speed. With Claude Code, every question starts a fresh claude process, so expect 10-15 seconds per answer. The Anthropic API is much faster. Use it if you want answers mid-conversation.

Claude Code setup. On the machine that runs the bot, install and sign in to Claude Code, then run:

claude setup-token

Without a long-lived token, the sign-in can expire while nobody is watching. If claude isn't on the bot's PATH, set CLAUDE_PATH to the program itself. On Windows use claude.exe, not a .cmd shim:

ASSISTANT_LLM=claude-code
CLAUDE_PATH=C:\Users\you\.local\bin\claude.exe

Claude runs with no tools: it can't read your files or run anything. It only gets the text the module sends.

Models. ASSISTANT_MODEL_FAST (default haiku) answers Fast; ASSISTANT_MODEL_DEEP (default sonnet) answers Deep, the What would they say? button and the session summary.

Players: consent and opt-out

  • Listening starts only when you press Listen.
  • The bot posts a notice in the voice channel's text chat saying it is listening, that nothing is recorded, and how to opt out. Anyone who joins the channel later gets the same notice, with a mention.
  • Any player can run /assistant optout (private reply). The bot stops listening to them at once and deletes their lines already in the transcript. /assistant optin turns it back on. The bot stores only their user ID.

Tell your players before you start. It's their voice.

Privacy: what leaves your machines

  • Transcript text and Foundry context go to Anthropic, with both providers (Claude Code and the API). That means what people said, plus the scene, journal passages, combat and token details sent with each question.
  • Audio goes to the transcriber. With local Whisper it never leaves your machine. With a cloud endpoint, that service receives the audio.
  • No audio is stored, by Squire or in its logs. Bot logs hold counts and timings, never text.
  • The transcript lives only in the bot's memory, for the last 4 hours at most. It is cleared when you press Stop, or after the session summary comes back if you asked for one first. It is never written to disk.
  • The Assistant Notes journal is GM-only. It holds only what you choose to save.
  • Transcripts are speech-to-text and contain mistakes. Check summaries before you save them.

Costs

  • Local Whisper: free, uses your GPU or CPU.
  • Cloud transcription: billed by the provider, per minute of audio.
  • Anthropic API: billed per use. Each question sends your context (up to Live assistant context size, 15000 tokens by default; only passages that match the question are sent, so usually less). Lower it to spend less.
  • Claude Code: uses your Claude plan's limits.

Troubleshooting

Problem Try
No assistant button The Live assistant setting is off, you're not a GM, or the page wasn't reloaded after enabling it. The button is in the Tokens controls.
"The bot's live assistant is off" Set ASSISTANT=on in the bot's .env and restart it.
No /assistant command Run npm run register after setting ASSISTANT=on.
"Already listening for ..." The bot is in another world's session. Stop it there first.
"The transcriber isn't working" Local Whisper isn't running, or ASSISTANT_STT_URL is wrong. Open http://127.0.0.1:8790/health.
Bot won't start ASSISTANT_LLM must be claude-code or anthropic, and anthropic needs ANTHROPIC_API_KEY.
Claude Code errors or asks to sign in Run claude setup-token on the bot's machine. Check CLAUDE_PATH.
Slow answers Normal for Claude Code (10-15 seconds). Switch to anthropic.
Empty or missing text for short clips Clips under 0.4 seconds are dropped on purpose.
A player's words aren't heard They ran /assistant optout, or they were muted or in another channel.

More in Troubleshooting.

Clone this wiki locally