Aditya Dutt Pandey

Build · 2026

Published · 3 min read

Answering out loud in four Indian languages, in 20 to 30 ms, on 512 MB

A voice assistant that answers questions in four Indic languages from real documents. The target is under 200 ms; the production extractive step has measured around 25 ms after speech-to-text when Render and Qdrant share a region. Why the fast path never calls a hosted LLM, and how async recovery works on a 512 MB host.

The target is under 200 ms. The free-tier host has 512 MB of memory; that is a separate resource constraint, not a latency guarantee.

The production report for this build measured 20 to 30 ms from the transcribed question to the extractive answer, with Render and Qdrant in the same region. The current measured step is around 25 ms. That clock starts after speech-to-text, which runs outside it. It is a measurement of the hot path, not a guarantee that every answer arrives under 200 ms.

Each of those constraints rules out an obvious design.

Why 200 ms

In conversation a pause means something. If someone takes two seconds to answer, you assume they're unsure. A voice assistant that pauses feels broken before it says anything. 200 ms is roughly where it still feels like talking.

The fast path never generates

The default build is to retrieve some documents and ask a large language model to write an answer. It reads well. It's also slow, and every generated word is a chance to make something up.

So the fast path is extractive. It finds the passage that answers the question and returns the answer straight from it. Pulling a span out of a document is fast, and it can't invent anything because every word was already there.

Sparse search, in Qdrant

Retrieval uses BM25 sparse search in Qdrant. BM25 matches terms such as names, numbers and specific phrases; this hot path does not combine BM25 with dense vector search.

The measured 20 to 30 ms production report is for the extractive step after speech-to-text, with Render and Qdrant in the same region. The 512 MB host is a memory constraint, not what makes that latency hold.

Speculate first, check later

That's where the name comes from. The system returns the fast extractive answer first, then an async recovery chain can check and replace it. Recovery is outside the latency target and can change the displayed answer.

Some questions don't fit the fast path: the answer is spread across several passages, or the best passage doesn't quite answer it. Recovery checks groundedness, uses speculative drafts and verification, then synthesizes across passages when needed. It can improve an answer, but it does not guarantee correctness. This slower work also does not change the hot-path measurement above.

512 MB decided the design

Speech comes in through Sarvam's speech-to-text, which handles the Indic languages, and everything after it had to fit in 512 MB. That ruled out loading a big model next to the search indexes.

Same as the Raspberry Pis I ran Tixin on, the small box helped. Every component had to justify its memory.

What I'd do again

Set the latency budget first and design backwards from it. If you start with the model and hope it's fast enough, it won't be. Extract before you generate, because a lot of questions already have their answer written down somewhere, and finding it is faster than rewriting it. Keep the fast path fast and the slow path correct, and don't merge them into one path that's neither.

By , CTO of tunyt

← All writing