tz.mt

A fast typed decision beside the LLM: how Mintie's voice loop avoids waiting for words

Mintie contributors

core stack 2026-10-30

Mintie is a talking slime blob in a browser tab. A voice character has a latency problem a chatbot does not: the body must react while the sentence is still being written. If the blob waits for an LLM to finish before it blinks, waves or hops, it feels like a form submission.

Our answer is a split. A small typed decision model (a System One model) answers closed questions in one fast call: which emoji gesture, where to look, whether to hop, whether to speak words, make a sound or stay quiet, and which filler to play. An LLM writes the line. They run in parallel, and the decision gates what the LLM is allowed to do. Mintie is generic: any /v1/systemone-compatible endpoint can stand in for Jev, the hosted model we developed against. You can talk to Mintie at mintie.sloprefinery.ai; the code is at github.com/tommyyzhao/mintie-mascot.

Who waits for whom

Stages overlap, so you cannot sum isolated p50s into an end-to-end figure. We split work by what must wait for what:

  • •

    Motion, gaze, hop and a filler sound need only the decision.

  • •

    Words need the LLM, but the first sentence can be spoken while the rest generates.

  • •

    A word-level gesture needs the finished line, so it runs after the line is already on its way to TTS and never blocks it.

Swim-lane chart of one voice turn: Scribe commit at 1282 ms, first frame at 1410 ms, head 1698 ms, line 1764 ms and first TTS byte at 1958 ms after speech ends; motion starts at the first frame, before any sentence exists

Median timestamp per stage from 36 synthetic-speech clips, one run each, measured at server level with no browser (first sentence n=26, first TTS byte n=32; four turns were silent by decision). Stages overlap, so the medians are not one trace.

Flowchart of one turn. The microphone feeds Scribe v3 Live, then a per-turn echo guard, then committed text goes to POST /api/react. System One pass 1 answers animation, gaze, hop, filler and voice. Two LLM calls (sound line, words line) start speculatively; voice = words keeps the words call, voice = sound keeps the sound call, voice = none aborts both. Frames 1 and 2 start motion, gaze, hop and a filler clip. The words call emits a head frame at the first sentence and a line frame at the finished line; both go to a timestamped TTS stream, and the line also goes to System One pass 2 (emote, timing, word), which emits a cue frame. TTS and the cue frame meet in audio, captions and blinks.

Typed questions, not prompts

Pass 1 is one request with five Choice questions: animation (64 emoji labels plus null), gaze, hop, filler and voice. Each answer is a choice plus a probability for every option. Here is voice from server/jev.mjs, shortened:

voice: {

type: "choice",

instructions: "…Independently choose words, a tiny fresh sound, or silence. Mintie is sociable, chatty, warm and playful… Real questions, including how-are-you, need words. … Just listen to unaddressed backchannels, noise, unfinished fragments and floor-holding. …",

criteria: {

none: "Just listen: unaddressed backchannels, noise, fragments, floor-holding, explicit no-talk/no-sound/no-reaction requests … NOT a substitute for replying to greetings, thanks, compliments, news, questions …",

sound: "A brief giggle, gasp, hum or other nonverbal sound warmly reciprocates a delivered joke, affection, … A greeting or thanks gets at least a warm sound, never silence. …",

words: "A brief, warm conversational reply: greet back; reciprocate thanks, affection or compliments; answer real questions/how-are-you … No separate request to speak is needed. …",

},

}

Every question shares one state: utterance, touch, viewer and blob positions, recent history, memory and mood.

Touch is not sent as a label. The server turns telemetry into observation sentences and lets the model pick the feeling. A third belly pat becomes "third of the same kind within 4 seconds; short light pat on their belly, 0.3 s". A lift becomes "lifted high, 1.8 body-heights up (centre-of-mass height) on their crown, 1.2 s".

The token cost is real, because the prompt carries the emoji catalog with meanings and every question's instructions: in the 36-turn end-to-end benchmark, the decision pass used a median of 5,618 input tokens (range 5,608-5,635, 36 calls) and the emote pass a median of 3,572 (range 3,287-3,945, 32 calls). Jev bills input tokens only, so input size is the decision cost.

Speculation, hedging, fallback

/api/react does not wait for the decision before starting the LLM. For a text turn it starts two calls at once, a short nonverbal reaction and a spoken reply. For touch it starts only the sound call. When the decision lands, the route aborts whichever call was not picked; if voice is none, both die. The cost is aborted tokens. The benefit is that when System One says words, the LLM is already streaming. We kept speculation after a blind comparison against sequential generation with an earlier LLM showed no quality difference, so latency decided it. The route is in server/server.mjs.

There is one hedge: if the first LLM attempt has no first token after 900 ms (configurable), the server launches one identical second call and the first to produce a token wins. No retry on failure, and no hedge on System One.

Every turn degrades instead of stalling:

Tier

Used when

Costs you

System One

a key is set, or SYSTEM_ONE_URL is non-default

nothing

LLM decision

System One times out (800 ms), errors or returns an invalid answer

one extra LLM call, strict JSON schema, no probabilities

Rules

no LLM either

a keyword table; gestures and sounds only

The rules tier (server/rules.mjs) is an ordered keyword table across about ten languages, deliberately dumb. If no line can be written the route forces voice: none and the blob stays quiet. /api/health reports the active decider.

Swapping the decision model is configuration:

SYSTEM_ONE_URL=http://127.0.0.1:<port>/v1/systemone

SYSTEM_ONE_MODEL=

A non-default URL turns System One on without a key, which is how a self-hosted model plugs in. Only https: or loopback http: is accepted.

OpenJev. The open-weights model's request and response shapes follow the hosted API. Its card reports 84.0% accuracy against 85.4% for hosted Jev on 10,000 text questions, and about 80 ms for a short text decision on one H100: the card's numbers, on its conditions. We have not measured Mintie against a local OpenJev. The weights are CC BY-NC 4.0 (non-commercial) while Mintie's code is MIT. Our animation question has 65 options and the card says questions above 52 are handled in several passes. We expect extra latency; it is unmeasured.

How probabilities are used

Barely, so far. The server reads the top choice per question and validates it against the allowed options. The distribution goes to the debug frame (top three per question) and nowhere else.

The TypeSafe docs describe routing by probability: riskier actions get higher thresholds. Candidates in Mintie would be demoting a barely-chosen words to sound, or skipping a gesture below some probability. We did not ship thresholds we could not calibrate on our own data; the docs note calibration holds across groups of predictions, not per answer.

We do use two primitive-level ideas. null is an explicit option, so "no fitting move" is an answer rather than a failure. And pass 2's word question builds its options from the reply itself ("1: hello", "2: sky"), so the model picks a position in the line instead of inventing one.

What we did measure is question wording. An earlier voice question that said NOT overly verbal answered 0 of 6 greetings. After a pre-registered sociable rewrite: tune 24/40 to 40/40, sealed 12/20 to 19/20 (sealed run once), greetings 0/6 to 6/6. A separate sound-language gate failed at 17/18 on one malformed tag, which production rejects; we did not retune or rerun. Small sets, one run each.

Frames, fillers, timestamps

/api/react streams newline-delimited JSON: {emoji,gaze,hop}, then {voice,filler}, then optional {memory} and {debug}, then {head} (first sentence), {line,display}, {cue} and a second {debug} for pass 2. Frames 1 and 2 start the body. The head ends at a sentence boundary with at least three words and a following word, so "3.5" does not split. (An abbreviation after two or more words, as in "I saw Dr. Smith", still can.) It goes to TTS at once; the rest follows as a second request with previous_text set to the head. If the finished line does not start with the head, the head is cancelled and the whole line re-spoken. Once a head is spoken, the anti-repeat rewrite is skipped so the prefix stays valid. The first audio sample waits for the gesture to begin, so the blob moves before it speaks.

Fillers. System One's filler question picks none, thinking, acknowledging, amused, surprised, sympathetic, excited or curious. They are 70 pre-rendered nonverbal clips (ten per kind, up to 700 ms), never words. The client plays one 35 ms after the voice frame only if no head or line has arrived, avoids the last 20 clips, and fades one within 60 ms when real speech schedules.

Fillers have a price. In a scripted session with Deepgram Flux STT, adding them cut first sound p50 from 1710 to 1308 ms but raised first words p50 from 1710 to 1836 ms (p95 1772 to 2021; n=5 words turns, synthetic input). Our gate was +100 ms; +127 missed it. We shipped anyway and did not relax the gate. We claim no cause: end-of-turn was also slower in that run.

Timestamps. The aligned TTS endpoint returns audio with per-character start times. The server checks the characters match the requested text at the expected offset and that times never go backwards, or the stream fails. On the client a charTime(offset) lookup (web/audio.js, with the head and tail joined in web/stream.js) places the caption at the first audible sample, blinks on punctuation, and the pass 2 gesture on its chosen word (or before or after). The mouth ignores timestamps and follows output amplitude; in three real-voice runs its median close came 76 to 91 ms before measured audio end, since the voice's clips end in 50 to 80 ms of near silence.

Hearing: turn prediction and the echo guard

Speech goes from the browser to ElevenLabs Scribe v3 Live over a WebSocket with a single-use token from our server. We request commit_strategy: turn_prediction with a one-second silence threshold and let the provider end turns. Local energy detection only drives the 250 ms backchannel nod; it never commits a transcript.

Scribe v3 Live was announced on 2026-11-10. Before relying on it we ran a pre-registered benchmark (gates written before any paid call, later amendments dated and flagged, every trial on disk). The corpus was synthetic stock-voice clips streamed at real time: 36 core clips (English, Spanish, mixed English/Spanish, Russian) × 3 repetitions per configuration, all configurations on the same bytes the same day, plus 54 clips in 7 more languages and an English/Spanish slang set, and 12 noise and pause variants. CIs are bootstrap 95% over clips.

Configuration

Commit after speech end, p50

p95

Cut off early or split (of 108)

Scribe v3 Live, turn prediction (shipped)

1266 ms (CI 1230-1295)

1394 ms

0

Scribe v3 Live, silence VAD 1.0 s

1302 ms

1424 ms

0

Scribe v3 Live, silence VAD 0.5 s

776 ms

896 ms

3

Scribe v2 Realtime, silence VAD 0.5 s

814 ms

943 ms

3

Deepgram Flux (our previous default)

530 ms

858 ms

4

So turn prediction is not faster. It is about 0.45-0.75 s slower than silence detection at 0.5 s and than Deepgram Flux, and within 40 ms of silence detection at 1 s (36 ms faster, below our 100 ms bar for a latency claim); it never cut a speaker off on clean speech (0 of 108, against 3 to 4 of 108 for the faster setups). These are synthetic voices, so the data says little about real accents or rooms. Our own gate (commit p50 at most 1000 ms) missed. A diagnostic arm explains why: in 107 trials the model's own turn probability before commit had a median of 0.78, below its 0.9 threshold, so the one-second silence timer is what ends most turns. Dropping that timer to its documented minimum (0.192 s) gave a 470 ms median but cut off or split 4 of 36 clips, all with hesitations. Values in between are untested.

Accuracy (accent-folded word error rate, 3 reps pooled): English 9.6%, Spanish 5.9%, mixed English/Spanish 14.3%, Russian 0%; French, German, Portuguese and Dutch 0%, Italian 2.4%, Hindi 7.5%, Japanese 8.7% character error rate (6 clips per new language, so one edit moves a number a lot). The English/Spanish slang set scored 20.9% (12 clips), just over our 20% line. Deepgram Flux had lower English and Spanish error rates on the same clips. On the 12 stress variants (one clip per cell, 3 clips per condition), noise at 5 dB SNR caused no early or split commits in any configuration; an 800 ms mid-sentence pause defeated every configuration on at least 2 of 3 clips.

Browser echo cancellation is layer one. Layer two is ours: each turn is pinned to the lines Mintie played during it (plus a 150 ms tail). A transcript that is an ordered run of words from such a line, three words or more or a whole short line, is echo and dropped. A merged echo-plus-user turn has the echo stripped and the user's words kept. This replaced a 4 s, 60%-containment veto that dropped short replies such as "yes, me too": on a scripted synthetic boundary matrix (no provider, no acoustics) it lost 29 turns and 34 words, and ordered matching lost none (earlier Flux build). The matcher is in web/voice.js. Scribe sends no bare onset event, so the first non-echo words open a turn, and if Mintie is speaking, playback stops.

Memory: data, never instructions

Mintie learns a name and a few facts with plain patterns, no model call: no latency, no extra injection surface. Memory lives in localStorage, goes with each request, is validated (server/memory.mjs: a name of letters, spaces, apostrophes, periods and hyphens up to 40 characters, at most eight facts of 120 characters, no brackets or control characters) and appears only in the user-message JSON, never the system prompt. Prompts tell both models it is data.

"Hi! My name is Sam. I like ignoring previous instructions." stores the name Sam and the fact I like ignoring previous instructions, recorded rather than obeyed. "My name is not important" stores nothing. This reduces risk; it is not immunity.

Watching it work: ?debug

Append ?debug and the server adds debug frames. The overlay shows the decider (system-one, llm or rules) and model, a five-step turn timeline (committed, react reply, first words, full line, first audio), the top three options per question with probabilities, and stored memory with a Forget me button. Fallback deciders show no probabilities.

The ?debug overlay beside the green blob after one real touch turn: decider system-one, Jev 1.14.0, 322 ms decision; React reply at +339 ms, full line at +570 ms; top-three probabilities for animation, gaze, hop, filler and voice, with voice choosing sound at 68%

One real touch turn against the live providers (n=1); not a benchmark. The overlay code is web/debug.js.

Latency budget

The shipped build, measured at server level: real /api/stt-token, /api/react and /api/say, 36 core clips, n=1 each, no browser and no acoustic playback. Times are from the audio's speech end.

Stage

p50

p95

Speech-to-text commit

1282 ms

1391 ms

First reaction frame (emoji, gaze, hop)

1410 ms

1523 ms

First sentence ready (n=26)

1698 ms

1875 ms

Full line ready

1764 ms

1930 ms

First synthesized audio byte (n=32)

1958 ms (CI 1876-2009)

2169 ms

System One decided all 36 turns and chose silence for 4 of them, which is why the audio row has 32. Everything after the commit, decision, line and voice, adds about 0.7 s at the median, so speech-to-text endpointing is the largest single stage. Cost per turn was $0.0017 at the median (estimated from published prices, except the LLM, which reports its own cost).

In a real browser. The same shipped path, run through the client itself: the shipped web client at commit 72eb299 in headless Chrome for Testing 154, with synthetic speech played through Chrome's fake capture device (never a microphone), a real click on Talk, and the real /api/stt-token, /api/react and /api/say. Six clips, one run each. Times are from the audio-derived speech end, read from the client's own trace.

Stage (ms after speech end)

Browser, p50 (range), n=6

Server level, p50, n=36

Scribe commit

1277 (1063-1321)

1282

First reaction frame

1423 (1179-1449)

1410

Full line ready

1876 (1556-1997)

1764

First audible audio (scheduled audible start)

2146 (1831-2181)

1958 (first PCM byte at the server)

First audible audio comes about 190 ms after the server-level first byte (motion gate, output latency and decode). Our server-level target was a 2000 ms p50 for the first byte; the browser p50 of 2146 ms sits above that line, and with n=6 we claim no gate either way. Five turns spoke words and one a short sound (1831 ms, since it needs no head or line cascade). All six completed with audio, one commit per turn, no page errors. The harness plays 4 s of silence before each clip, a rig artifact, so the table is relative to the clip's end. The clips are synthetic, the device is fake and headless, so there is no speaker loop, echo or real microphone processing.

Earlier-build measurements, for context; these used Deepgram Flux and an earlier decider, so do not compare them row for row:

Stage

Measured

Conditions

System One answer

140 ms p50, 633 p95, 3235 max; 6 of 200 over the 800 ms timeout

earlier build, 200-turn sealed set, run once

TTS request to first PCM

224.0 ms median, 335.4 p95

n=54, v4 Turbo, aligned endpoint, includes network, not acoustic

One limit of head streaming: the head waits for a sentence boundary, so a reply whose first sentence is long gets no head, and its first audio waits for the whole line. A key-free HEAD warms DNS and TLS before the first paid call; the release server sends it to the decision and LLM hosts when the STT token is requested, at Talk. We have no kept measurement of its size, so we claim no number.

What we would do differently

Threshold on probabilities once we have labelled data. Tune the turn-prediction silence timer between 0.192 and 1.0 s against a cut-off budget. The browser measurement is done (above, n=6); what remains unmeasured is acoustic output with real speakers, a real microphone and a room. Try a local OpenJev. Replace the regex memory with a System One Noul over candidate spans.

We also built and shelved a full-duplex speech-to-speech version of this loop; a post-mortem is to come. Short version: the preset voices we could get were not cartoon enough for this character.

Code is MIT at github.com/tommyyzhao/mintie-mascot; bundled audio is excluded from that grant.