Spaces:
Running
title: Browser Voice Agent Demo
emoji: 🎙️
colorFrom: indigo
colorTo: purple
sdk: static
app_build_command: npm run build
app_file: dist/index.html
custom_headers:
cross-origin-embedder-policy: require-corp
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: cross-origin
Browser Voice Agent Demo
Browser-first, on-device voice agent demo with Gradio-style camouflage. The app is served locally with Vite during development and built as static assets for public deployment.
Stack
Vitefor local development, preview, and bundlingBunfor package management and tests@mlc-ai/web-llmfor local browser LLM inference@huggingface/transformersfor local ASR- Vendored Pocket TTS browser worker derived from
KevinAHM/pocket-tts-web
Local Development
bun install
bun run dev
Then open http://localhost:3000.
The same dev server now carries the isolation headers, so Pocket can take the threaded path without a separate custom preview server.
For a production-like static serve, use:
bun run preview
That serves the built dist/ output with the same COOP/COEP/CORP headers.
Test
bun test
Build
bun run build
The production output is emitted to dist/.
Pocket TTS Runtime
The app now ships a built-in Pocket TTS browser runtime and same-origin model assets:
src/vendor/pocket-tts/inference-worker.jssrc/vendor/pocket-tts/sentencepiece.jssrc/vendor/pocket-tts/CODE-LICENSEsrc/vendor/pocket-tts/onnx/*src/vendor/pocket-tts/tokenizer.modelsrc/vendor/pocket-tts/voices.binsrc/vendor/onnxruntime-web/*
Those files are copied into dist/ during bun run build and served locally from:
/pocket-tts/inference-worker.js/pocket-tts/sentencepiece.js/pocket-tts/onnx/*/pocket-tts/tokenizer.model/pocket-tts/voices.bin/onnxruntime-web/*
The vendored worker code is Apache 2.0; its license file is preserved in src/vendor/pocket-tts/CODE-LICENSE.
For best Pocket performance, serve the app with:
Cross-Origin-Opener-Policy: same-originCross-Origin-Embedder-Policy: require-corp
Without those headers, the worker still runs, but ONNX Runtime drops back to single-threaded WASM.