/npctalk:fish-voice-serverfrom npctalk
Deploys Fish Audio's open-weights voice models (Drama 3, S2 Pro) on serverless GPU (Modal, fal) with a POST /speak API for realtime zero-shot voice cloning. Covers SGLang-Omni, cold starts, scaling, sampling settings, and fine-tuning.
Ships in npctalk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
server/drama3.py (default) and server/s2pro.py are Modal apps with the same API, so a game switches models by
changing one URL. Both run Fish Audio's open weights through SGLang-Omni on one H100 and stream audio as it's
generated.
Drama 3 (fishaudio/drama-3) | S2 Pro (fishaudio/s2-pro) | |
|---|---|---|
| Size | 35B mixture of experts, 3B active, FP8 (~37 GB) | Smaller; leaves room for fine-tuned voices on the same GPU |
| First audio from a PC | ~0.33-0.5 s warm | ~0.5 s warm |
Acting [tags] | Better (crying, laughing, whispering) | Good |
| Voice likeness, zero-shot (Lamar, below) | 0.643 at defaults, 0.660 tuned, 0.704 best of 8 | 0.680 with the same clip, 0.707 with its best clip |
| Fine-tuning | Not done here | LoRA in server/finetune/ (0.785, the best result, but it needs training) |
uv tool install modal && modal setup
modal secret create npcvoice-auth NPCVOICE_TOKEN=$(python -c "import secrets; print(secrets.token_urlsafe(32))")
modal run server/drama3.py::download_weights # once: ~40 GB into the npcvoice-models volume
npctalk voice make --name Narrator --audio narrator.wav && npctalk voice upload voices/Narrator
modal deploy server/drama3.py # prints https://<workspace>--npcvoice-drama.modal.run
export NPCVOICE_URL=https://<workspace>--npcvoice-drama.modal.run NPCVOICE_TOKEN=<the token>
npctalk health # waits through a cold start (1-3 min)
npctalk say "[laughing] Nah, you trippin'." --voice Narrator/clone --out test.wav
Everything is named npcvoice-* (apps, volumes, secrets) so it stays apart from the rest of a Modal workspace.
Keep the URL private: /health needs no token and wakes the GPU.
POST /speak Authorization: Bearer <NPCVOICE_TOKEN>
{"text": "[angry] Get out of my face!", "voice": "Trevor/clone"} a voice prepared on the server
{"text": "...", "reference_audio_url": "https://.../me.wav", "reference_text": "what me.wav says"}
optional: "temperature", "top_p", "multi" (all clips in the voice's folder), "best_of" (1-8, drama3.py)
→ 200, X-Sample-Rate: 44100, body: 16-bit mono PCM, streamed as it's generated
(with best_of > 1: the whole line at once, and X-Takes: per-take likeness / word error / length)
GET /health no auth → {"ok": true, "model": "drama-3", "voices": 21}
/voices/<Name>/clone.wav + clone.lab (transcript), plus ref_0..2 and mood
folders (/voices/<Name>/angry/ref_0.wav). The server encodes every clip when it starts, so a named voice
costs nothing per request; a clip sent by URL costs ~9 s the first time. Restart the server after uploading
voices (modal app stop npcvoice-drama)."[sigh] Man... [laughing] nah.". Drama 3 and S2 Pro both voice
them; other engines treat them as hints.examples/gta-v/mod/Tts.cs (ModalTts, C#) and npctalk/server.py (Python) both read the stream
in 4 KB chunks and start playing at the first chunk.| Change | Result |
|---|---|
Sampling temperature 0.7, top_p 0.8 instead of Drama 3's defaults (1.0 / 0.9) | 0.660 (10 runs) vs 0.643, better on 8 of 10 lines (t = 2.5) |
| Temperature 0.5 or 0.3 | Worse (0.609, 0.628) and more rambling takes |
The ~30 s clone.wav vs one 6-10 s clip | 0.680 vs 0.610-0.630: clone the long clip |
| All four clips as references at once | No better (0.641 vs 0.637) |
best_of: 8 with checks (below) | 0.704 vs 0.660 for one take, better on 9 of 10 lines (t = 3.9) |
So SAMPLING = {"temperature": 0.7, "top_p": 0.8} is the server default, and pre-rendered lines use best of 8.
About 1 take in 10 rambles to the token limit (47.6 s for a 15-word line) or trails off into noises. For lines
that don't need streaming (cutscenes, a director's clips) best_of: N renders N takes in one batch and:
1.5 + 0.45 s per word, + 1 s);Picking by one model alone over-fits it: WavLM-only picks scored 0.692 at 4 takes; ECAPA-only raised ECAPA a lot but WavLM less; both together kept most of each. An unchecked pick scored 0.708 but let a 14-second whimper through. Best of 8 takes ~4-6 s per line with the scoring models on the GPU.
MIN_CONTAINERS = 0, SCALEDOWN = 300: the H100 (about $4/hour) stops 5 minutes after the last request; the
next request waits 1-3 minutes (weights load, kernels warm up, every voice is encoded).modal deploy server/keepwarm.py, then
modal run server/keepwarm.py --url $NPCVOICE_URL --hours 12 (it says what that costs: ~$45-50).server/finetune/: prepare_dataset.py (Demucs → Whisper word timings → 2-15 s clips → speaker filter →
loudness), train.py (LoRA r8, α16, lr 1e-4; step 250 was best), fish_finetune.py (two fixes fish-speech
needed for S2 Pro). Read references/finetune.md before starting.
Gotchas for all of this: references/gotchas.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
fish-audio, tts-server, voice-cloning, serverless-gpu, game-audio
8 skills in this plugin
/make-npcs-talkMake NPCs in a game talk back. The player speaks or types, the NPC answers in character, in a cloned voice, about 1-2 seconds later, and can act on what was said. Covers the whole loop and the order to build it in (who is being talked to, what the scene is, speech-to-text, an LLM in character, Fish Audio voices on a GPU, streamed playback from the NPC, subtitles, mouth movement, actions), the four hooks a game has to provide, latency budgets, costs, testing in the real game, and the rules (single-player, voices you have the rights to, nothing of the game shipped). Use when the user wants NPCs, characters, villagers, companions or enemies in any game to hold conversations, react to the player's voice, or be voiced by Fish Audio (S2 Pro or Drama 3) and an LLM./npc-actionsMake NPCs physically react to a conversation and follow spoken orders. Pick an action (punch, slap, hug, kneel and beg, flee, flip off, square up, nothing...) from what the player said and what the NPC replied, with TypeSafe's Jev returning a typed choice and a probability in ~0.1 s, per-action thresholds, a repeat cooldown, orders ("get on your knees") that override mood and make the LLM rewrite the line, and mapping action names onto the game's animations with checks at load. Use when NPCs should act out what they say, obey commands, or when actions picked by an LLM are too random, too timid or too frequent.npx claudepluginhub christos-antono/npctalk --plugin npctalkOther plugins' skills for the same job