Thox-ai/thoxvoice-chat
ThoxVoice Chat
This header card configures the Hugging Face Space (Docker SDK). The Space is a hosted demo/mirror; the source of truth is the private GitHub repo `ttracx/thoxvoice-chat`. Model-stack keys are provided via Space secrets (never hardcoded) — see Deploy on Hugging Face Spaces.
THOX.ai's on-device agent-teams realtime conversation product. Talk (voice, soon video) with a team of THOX agents in one live session — running on your own machine through THOX model stacks, cloud strictly optional.
Forked from `smolagents/hf-realtime-voice` and reshaped from a single-assistant, voice-only, remote-backend demo into a local-first, multi-agent, voice+video product.
Status: MVP vertical slice — AI layer + local realtime backend + re-skinned frontend, 23 headless tests green. Real STT/TTS and LiveKit video are the next phases. See `docs/CUSTOMIZATION_PLAN.md`.
What's different from upstream
The browser client's OpenAI-Realtime-GA WebSocket protocol is kept verbatim — the THOX customization sits behind it (the directUrl seam). See `docs/adr/0002-thox-realtime-seam.md`.
Quick start (local, headless-friendly)
# 1. Python env (kept off C: to save space)
python -m venv .venv
.venv\Scripts\python -m pip install -r thox/requirements.txt # Windows
# source .venv/bin/activate && pip install -r thox/requirements.txt # POSIX
# 2. Run the test suite (no models, no GPU needed — uses EchoBackend)
.venv\Scripts\python -m pytest -q # -> 23 passed
# 3. Run the server (serves the UI + the local realtime backend)
.venv\Scripts\python -m uvicorn thox.realtime.server:app --port 8080
# 4. Open http://localhost:8080 , open Settings, set the server URL to
# `localhost:8080` (the client appends /v1/realtime), and start talking/typing.With no environment configured, the stack falls back to the deterministic EchoBackend so it always answers. Start Ollama (ollama serve, default llama3.1) and it's used automatically — local-first, no config.
Point the model stack somewhere else (swap = env, not code)
export THOX_OLLAMA_MODEL=llama3.1 # on-device default
export THOX_OPENAI_BASE_URL=http://localhost:8000/v1 # vLLM / thoxllm-factory
export THOX_ANTHROPIC_API_KEY=sk-ant-... # cloud fallback (opt-in)
export THOX_PRIORITY=ollama,openai,anthropic,echo # force routing orderArchitecture at a glance
Browser (upstream client, THOX skin)
│ OpenAI Realtime GA over WebSocket (directUrl -> localhost)
v
thox/realtime -- RealtimeSession -- TeamOrchestrator (who speaks?)
│ │
│ v
thox/core -- ThoxRouter (thoxcore) -- Ollama - vLLM - Anthropic - Echo- `thox/core` — the model-stack seam: typed router + swappable backends, local-first fallback.
- `thox/agents` — agent teams: personas + turn routing (mention / affinity / round-robin).
- `thox/realtime` — local realtime backend speaking the client's protocol; STT/TTS seam.
Full diagrams: `docs/ARCHITECTURE.md` · portfolio view: `docs/ecosystem_map.md`.
The agent team (default)
Address one directly with @Sable … or Vera: …; otherwise the orchestrator picks by skill affinity, then round-robin. Define your own team via TeamOrchestrator / ThoxAgent.
Tests
.venv\Scripts\python -m pytest -q # 23 tests: router fallback, team routing, full WS turn loopAll headless — no GPU, no models, no network — via the EchoBackend.
Repo layout
See `docs/ARCHITECTURE.md`. Upstream docs are preserved at `docs/UPSTREAM_README.md`, `CONTEXT.md`, and `DESIGN.md`.
Deploy on Hugging Face Spaces
This repo is Space-ready (Docker SDK, header card at the top of this README). The Space is a hosted demo/mirror — the source of truth is the GitHub repo.
- The
Dockerfilerunsthox.realtime.server:appon port7860. - With no config, the Space boots on the deterministic
EchoBackend. - To enable real model responses, add Space secrets/variables (never commit keys):
hf spaces secrets add <owner>/thoxvoice-chat --secrets THOX_ANTHROPIC_API_KEY=sk-ant-...
hf spaces variables add <owner>/thoxvoice-chat --env THOX_ENABLE_OLLAMA=0- Hardware: the MVP (voice text-turn loop) runs on the free/basic CPU tier. Phase-1.5 local STT/TTS and Phase-2 LiveKit video will want a GPU tier (e.g.
t4-small+) — set it then, not now.
Credits
- Upstream client & audio pipeline: `smolagents/hf-realtime-voice` (Pollen Robotics × Hugging Face), OpenAI Realtime GA protocol.
- THOX layer, agent teams, and
thoxcorerouter: THOX.ai.
