Prompt Biasing
Prompt biasing
The transcription model takes an optional 896-character "prompt" that biases its output. Use it to teach the model your server's vocabulary so callsigns, location names, and slang transcribe correctly.
How it works
The model treats the prompt as recent context. It will prefer words from the prompt when audio is ambiguous. Style is also copied: a prompt full of comma-separated lists produces comma-separated outputs. A prompt written as natural sentences produces natural sentences.
Setting a prompt
In shared/config.lua:
Config.STT.prompt = 'Police roleplay radio. Officers say things like "1-Adam-10 to dispatch, 10-4, en route to Mission Row". Common ten-codes: 10-4, 10-9, 10-20, 10-23, 10-50, 10-99. Code 1, Code 2, Code 3, Code 4. NATO phonetic: Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey X-ray Yankee Zulu.'
Rules
- Keep it under 896 characters. Longer prompts get truncated from the start.
- Put critical jargon at the end. If the prompt is too long, the start gets cut.
- Write in the style you want output. Sentences make the model produce sentences.
- Include rare words at least once. The model will then prefer them on ambiguous audio.
Examples
Police roleplay
Config.STT.prompt = 'Police radio chatter. Dispatch this is 1-Adam-10, 10-4, show me 10-23 at Mission Row, requesting Code 3 backup. Officers use NATO phonetic alphabet. Ten-codes 10-4, 10-9, 10-20, 10-31, 10-50, 10-76, 10-99. Locations include Los Santos, Mission Row, Sandy Shores, Paleto Bay, Vinewood, Davis. Departments LSPD, LSSD, BCSO, SAHP.'
Drug RP server
Config.STT.prompt = 'Street roleplay. Players sell weed, coke, meth, oxy. Common phrases include "what you got", "how much", "running it", "block hot", "five-o", "ones up", "ten deep". Locations: Grove Street, Davis, Forum Drive, Strawberry, Vespucci. Gangs: Families, Ballas, Vagos.'
Mechanic shop
Config.STT.prompt = 'Mechanic roleplay. Customers ask for tune ups, oil changes, brake pads, transmission flush, paint jobs, tire rotation. Mechanic says engine bay, suspension, headers, intake, turbo. Prices in dollars.'
Testing prompts
Restart the resource after changing the prompt. Speak a few sample phrases. Watch the server console for the transcription output and tune from there.
If the model starts hallucinating prompt words on silent audio, tighten Config.STT.energyThresholdMul so VAD only fires on louder speech.