Dev.to WebDev 🛠 Dev 👁 0 📖 5 min read

Local Voice AI Characters on Windows 11: Node.js, Ollama, and WebSockets

I am still pretty new to coding since I mostly come from the writing side, so building a local web app on Windows 11 where I can actually talk out loud to AI characters felt wild when it spoke back for the first time. Th

I am still pretty new to coding since I mostly come from the writing side, so building a local web app on Windows 11 where I can actually talk out loud to AI characters felt wild when it spoke back for the first time. The whole thing runs on Node.js on my boyfriend's PC, which packs 16 GB VRAM and 42 GB RAM. I am so glad he lets me hijack his machine becuause my own setup would have choked before the first model even loaded.

The annoying part is that I just wanted one clean app that opens and works. Instead I ended up juggling a Python venv and multiple local servers every single time I want to chat.

Local Speech to Text With Phonon-2 (and Windows venv Chaos)

For speech to text I went with phonon-2 from Fermion Research. It is a tiny English model around 158 MB to 164 MB built as a compressed derivative of NVIDIA's parakeet-tdt-0.6b-v3, averaging a 5.21% word error rate across the seven English Open ASR leaderboard test sets. It runs on CPU and exposes a local API compatible with standard dictation and audio clients.

Installing it on Windows 11 gave me massive headecks becuause I ran into so manny package incompabilities with my global Python install and PyTorch dependencies. Things kept breaking until I gave up fighting Windows and locked phonon-2 inside its own isolated venv.

Now every session starts by opening PowerShell and booting the STT server manually on port 8010:

& "C:\Users\elle\Documents\Python\phonon-2\venv\Scripts\phonon.exe" serve --port 8010

Once port 8010 is up, transcription comes back super fast at around 71ms on my tests. Pasting that giant file path every time still drives me crazy.

Adding Voices With Kyutai Pocket TTS (and Surviving the GPU Side)

To let my characters talk back, I wired up pocket-tts from Kyutai Labs, which supports Python 3.10 through 3.14 on PyTorch 2.5 or newer. Normally you launch its persistent local server in a second terminal tab like this:

python -m pocket_tts serve

Kyutai built pocket-tts to run on CPU out of the box and does not officially support GPU execution. There is not even a device flag on TTSModel.load_model(), so getting it onto CUDA means manually moving the nn.Module with tts_model.to("cuda") and pushing output tensors back to CPU via .detach().cpu().numpy() before encoding audio. Resolving the GPU side on Windows 11 was absolute hell with PyTorch CUDA builds and device mismatches. Once I finally got it working on GPU though, the audio generation speeds were blazing fast.

Real-Time Sentence Streaming Over WebSockets (Plus Real Latency Numbers)

Early on, waiting for the language model to finish an entire reply and then waiting for TTS to synthesize the whole paragraph killed the vibe of a real conversation. To fix that dead air, I built real-time sentence streaming straight off the first token (TTFT) coming out of the local SLM.

As Node.js receives streamed tokens from Ollama, it watches punctuation boundaries in real time. The instant a complete sentence lands, it drops that sentence into a queue bucket for TTS synthesis and pipes the generated audio straight back to the browser over WebSockets. You start hearing sentence one almost immediately while the model is still generating sentence two and three in the background.

Here is an actual latency readout from a live voice turn on my machine:

TTFT: 416ms [Anubis-Mini-8B-v1] | TTS #1: 652ms/1020ms | STT: 71ms

At 71ms for STT, 416ms to first token, and the first spoken sentence arriving in 652ms/1020ms, talking to a character finally feels snappy instead of like leaving voicemails.

Character Brains on Ollama: Gemma 4 12B vs Anubis-Mini-8B-v1

On the Ollama side I tested plenty of models on 16 GB VRAM and two really stuck with me.

gemma4:12b completely amazed me. Google released it on June 3, 2026 under Apache 2.0 with a 256K context window, a unified multimodal architecture handling images and audio natively, and roughly a 6.7 GB footprint in Q4 quantization on Ollama. My characters actually hold onto their personality quirks across long messy voice sessions without turning into stiff customer support bots.

I also had a great run with Anubis-Mini-8B-v1 by TheDrummer, an 8B model released in September 2026 tuned specifically for creativity, usability, and entertainment. At 4.92 GB in Q4_K_M GGUF format it flies on 16 GB VRAM, hits that 416ms TTFT easily, and brings way more attitude when a character needs weird humor.

Why I Am Sad About This Setup (and Watching WebLLM + Google Dev Drops)

Right now my Node.js web app stitches together phonon-2 on port 8010, Ollama on port 11434, and pocket-tts over local HTTP plus WebSockets to the frontend. It runs great once every terminal tab is alive, yet I still feel kinda sad staring at all those windows. I wanted this whole project to run cleanly without a fragile venv and without launching so manny external servers by hand.

That is why the browser AI releases dropping lately caught my attention so hard:

  • MLC WebLLM (@mlc-ai/web-llm) runs quantized models inside the browser via WebGPU and WebAssembly behind an OpenAI compatible API, caching weights locally. Its October 2026 release added Gemma 4 E2B instruction tuned models (q4f16_1 and q4f32_1) with text and audio input, followed by Gemma 4 prefill speedups in v0.2.87 and new MiniCPM5, SmolLM3, and LFM2.5 support in November 2026.
  • Google AI Edge LiteRT-LM (@litert-lm/core) and LiteRT.js have been moving fast too. Google launched LiteRT.js in July 2026 for WebGPU and WASM inference, and the LiteRT-LM Web SDK stream loads models directly on GPU with image and audio inputs while supporting Gemma 4 12B on web and speech models including Qwen3-ASR, Kokoro, and Qwen3-TTS.
  • Chrome Built-in Prompt API (LanguageModel) shipped on desktop in Chrome 148 back in May 2026 with text, image, and audio inputs plus promptStreaming(), needing 22 GB free disk space, 16 GB RAM, and at least 4 GB VRAM for audio input.

Combined with community browser ports of Pocket TTS like wasm-pocket-tts in Rust and WebAssembly or pocket-tts-onnx-export on ONNX Runtime Web, an entire local voice character app could eventually live inside a single browser tab with zero Python installs.

If anyone on here has already moved a multi server Node.js voice pipeline over to @litert-lm/core, WebLLM, or ONNX Runtime Web on Windows 11, drop your real TTFT and TTS numbers in the comments because I would love to ditch my terminal circus.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.