{"slug": "pivo-studio-local-speech-from-one-rust-binary", "title": "PiVo Studio: local speech from one Rust binary", "summary": "PiVo Studio, released by the PiVo team on GitHub and Hugging Face, runs the 1.4-million-parameter PiVo text-to-speech model from a single Rust binary with no Python or ONNX Runtime dependency, producing first audio in about 30 to 50 ms on one x86-64 CPU thread. The engine reads the model's four ONNX graphs with its own protobuf decoder and hand-written f32 kernels, and its output differs from the Python reference by at most 5.4 × 10⁻⁵ in the final audio samples. It generates speech at 1.6 to 2.3 times faster than real time, peaks at about 50 MB of memory with roughly 6 MB of weights, and ships a command line, an OpenAI-compatible /v1/audio/speech HTTP endpoint and a browser studio.", "body_md": "# PiVo Studio: local speech from one Rust binary\n\nPiVo Studio runs our 1.4M-parameter voices without Python or ONNX Runtime: a command line, an OpenAI-compatible speech API and a web studio in one Rust binary, with first audio after about 30 to 50 ms on a single CPU thread.\n\n[PiVo](https://empero.org/research/pivo/) is our 1.4-million-parameter text-to-speech model. Its reference runtime needs Python, NumPy and ONNX Runtime, which is fine on a workstation and awkward almost everywhere else. PiVo Studio needs none of them: it is one Rust binary that runs PiVo with its own code, from the command line, as an HTTP server or as a web studio in your browser.\n\nThe code is on [GitHub](https://github.com/empero-org/PiVo-studio) and the model on [Hugging Face](https://huggingface.co/empero-ai/PiVo-1.4M). You can hear both voices on the [PiVo page](https://empero.org/research/pivo/).\n\n## Try it\n\nYou need a Rust toolchain. In a clone of the repository:\n\n```\ncargo build --release\ngit clone https://huggingface.co/empero-ai/PiVo-1.4M models/PiVo-1.4M\n./target/release/pivo-studio studio\n```\n\nThe studio opens at http://127.0.0.1:8000. Type some text, pick Pi or Vo and press Speak, or Ctrl+Enter. Playback starts while the rest of the text is still being generated, with a live waveform and readouts for the time to first audio and the real-time factor. Every clip stays in a history you can replay and download as WAV.\n\nA pronunciation inspector shows how PiVo reads your text: the normalized words, the phones for each word and any word that is missing from the dictionary. The page works offline, with no CDN and no tracking.\n\n## No runtime underneath\n\nPiVo Studio does not wrap ONNX Runtime. It reads the four ONNX graphs with a small protobuf decoder of its own, takes the weights out of them and runs the model with hand-written f32 kernels, built on dot products and matrix-vector products that the compiler vectorizes for AVX2 and NEON. The pronunciation dictionary is compiled into the binary, so the model files are the only thing it needs at runtime, and it checks their hashes when it loads them.\n\nWe compared it with the Python reference stage by stage. The largest difference anywhere in the pipeline is 5.4 × 10⁻⁵, in the final audio samples.\n\n| Stage | Largest difference from the reference | \n|---|---|\n| Encoder | 1.8 × 10⁻⁶ | \n| Durations | 3.2 × 10⁻⁶ | \n| Decoder features (187 frames) | 1.7 × 10⁻⁵ | \n| Audio samples | 5.4 × 10⁻⁵ | \n\n## Fast enough to stream\n\nOn one x86-64 CPU thread, PiVo Studio generates a sentence in 0.44 to 0.64 times its length, 1.6 to 2.3 times faster than real time. The Python reference runs at about real time. When streaming, the first audio arrives after about 30 to 50 ms, even for long documents, because the engine splits text into clauses and produces audio 10 ms at a time. The whole process peaks at about 50 MB of memory, of which the weights are about 6 MB.\n\nWe have not measured it on a phone yet. That comes next.\n\n## An API you already know\n\n`pivo-studio serve` starts the same engine as an HTTP server with an OpenAI-compatible `/v1/audio/speech` endpoint, so existing code only needs a different base URL:\n\n``` python\nfrom openai import OpenAI\nclient = OpenAI(base_url=\"http://127.0.0.1:8000/v1\", api_key=\"not-needed\")\nclient.audio.speech.create(model=\"pivo\", voice=\"Vo\", input=\"Hello from PiVo.\").write_to_file(\"vo.wav\")\n```\n\nBesides WAV and raw PCM it can stream: `stream-pcm` sends each 10 ms frame as soon as it exists, and `sse` sends the frames as server-sent events. There are also endpoints for the list of voices, for phonemizing text and for health checks. An API key, a limit on concurrent jobs, the host and the port are all settings.\n\n## In your own app\n\nThe engine also builds as a static or shared library with a C interface, with examples for Swift on iOS, Kotlin on Android and plain C. `pivo-studio pack` turns a model into a single `.pivomodel` file of about 6 MB to ship inside an app:\n\n```\nPivoEngine *e = pivo_load_bundle(bundle_bytes, bundle_len);\nPivoStream *s = pivo_stream_new(e, \"Hello, world.\", NULL);\nwhile (pivo_stream_next_frame(s, frame, frame_n) > 0) { /* play the frame */ }\n```\n\nNothing in the engine is fixed to PiVo-1.4M. Widths, layers, heads, voices and the vocabulary come from the model files, so a future PiVo with other dimensions or more voices should load without code changes.\n\n## License\n\nPiVo Studio is released under the Empero PiVo Attribution License 1.0. You can use, change and redistribute it, as long as anything built with it says \"Made with Empero PiVo\" or \"Powered by Empero PiVo\" where its users can see it. Commercial products also credit Empero with a link to empero.org, and companies with more than US$20M in annual revenue need a commercial license, which you can ask for at [\\[email protected\\]](https://empero.org/cdn-cgi/l/email-protection#483a2d3b2d293a2b20082d25382d3a2766273a2f). The PiVo weights themselves are Apache-2.0.\n\nIf you build something with it, we would like to hear about it.", "url": "https://wpnews.pro/news/pivo-studio-local-speech-from-one-rust-binary", "canonical_source": "https://empero.org/writing/pivo-studio", "published_at": "2026-11-05 13:08:12+00:00", "updated_at": "2026-11-05 13:26:55.490850+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-tools", "ai-products", "developer-tools", "natural-language-processing"], "entities": ["PiVo Studio", "PiVo", "Rust", "ONNX Runtime", "GitHub", "Hugging Face", "Python", "OpenAI"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/pivo-studio-local-speech-from-one-rust-binary", "markdown": "https://wpnews.pro/news/pivo-studio-local-speech-from-one-rust-binary.md", "text": "https://wpnews.pro/news/pivo-studio-local-speech-from-one-rust-binary.txt", "jsonld": "https://wpnews.pro/news/pivo-studio-local-speech-from-one-rust-binary.jsonld"}}