gradbot
Library Listed
Open source framework to vibecode and prototype voice agents with Gradium APIs
- Downloads
- 31
- Dependents
- 3
- Stars
- 152
- Forks
- 35
- Contributors
- 8
- Commits
- 97
- Latest release
- 0.6.4 ·
About
Open-source voice agent framework.
~50 lines of code. Any OpenAI-compatible LLM.
Gradbot gives you the event loop for voice agents. You write the logic, it handles the rest.
At its core is a multiplexing engine written in Rust that coordinates three streams in real time: speech-to-text, LLM inference, and text-to-speech while managing conversational state, turn-taking, and interruptions. It works with any OpenAI-compatible LLM (GPT-4o, Claude, Groq, Ollama, LM Studio, etc.) and uses Gradium for streaming STT/TTS across multiple voices from the Gradium voice catalog and 5 languages.
Whether you're building a haggling game or a travel booking assistant, Gradbot lets you go from idea to working voice experience in under 50 lines of code.
Read the full README
Features
- STT, LLM, and TTS coordinated in one loop: Rust multiplexer streams all three concurrently
- Turn-taking, fillers, and barge-in handled automatically: graceful audio fade-out on interruption
- Bi-directional audio streaming: with VAD and silence detection out of the box
- Async tool calling: the AI keeps talking naturally while slow tools execute in the background; lost calls are tracked and recovered
- Live transcription and tool calls in the same cycle: define tools as JSON Schema, handle results sync or async
- Full Gradium voice library, 5 languages: English, French, German, Spanish, Portuguese; unlimited voices via cloning
- Mid-session reconfiguration: change voice, language, prompt, or tools without restarting
- MCP integration: connect any MCP server for instant tool access
- Remote mode: deploy
gradbot_servercentrally; clients connect over WebSocket with the same API - Config pinning: lock down LLM credentials server-side while clients control voice and prompt
Quick Start
Install from PyPI:
pip install gradbot
Or run a demo directly (builds from source):
cd demos/simple_chat
uv sync
Set your API keys:
export GRADIUM_API_KEY=your_gradium_key
# Any OpenAI-compatible endpoint (OpenAI, Groq, Ollama, LM Studio, etc.)
export LLM_API_KEY=your_llm_key
export LLM_BASE_URL=... # optional, defaults to OpenAI
Run:
uv run uvicorn main:app --reload
# Open http://localhost:8000
Architecture
The multiplexer runs a state machine (Listening → Flushing → Processing) that handles concurrent audio streams, interruption detection, and turn management. Gradbot flushes trailing audio by pushing silence into the STT buffer so the LLM gets your complete utterance before replying. There is no extra latency from voice activity detection delays. If the user goes quiet, the LLM is prompted to re-engage naturally instead of creating dead air.
Who Should Use Gradbot
Gradbot is built for prototyping and experimentation. Use it to hack on ideas and build voice experiences without spending hours on infrastructure.
- Support agents and real-time assistants
- Coaching and educational apps
- Tool-using voice workflows
- Games and experimental interfaces
Build weird, fun stuff. Voice agents don't have to be boring.
For production, use Gradium's models through orchestrators like LiveKit and Pipecat for enterprise-grade reliability and scaling.
Demos
Every demo is a standalone FastAPI + WebSocket app. Pick one, uv sync, and run it.
| Demo | What it does | Key concepts |
|---|---|---|
| simple_chat | Basic voice conversation | Minimal starting point, dynamic voice/prompt switching |
| fantasy_shop | Haggling game: buy a sword from NPCs | Tool calling, multi-character, game state, deferred tools |
| hotel | Hotel booking agent for Paris, Bali, Dubai | Deferred tool results with natural chit-chat using Web Search API |
| paris_rental_agent (hosted demo) | Paris apartment search assistant that builds a renter profile and finds listings | Voice/text profile intake, Tavily web search, scoring, saved listings |
| business_bank | Banking agent with PIN auth and loan applications | Security flows, multi-step business logic |
| restaurant_ordering | Multilingual voice ordering agent for a fast-food restaurant | Menu browsing, order customization, multilingual support |
| npc_3d_game | 3D office exploration: solve voice riddles, handle NPC check-ins | Three.js, multi-session (clue + check-in), response classification |
Building a New Demo
Copy an existing demo and modify it yourself, or ask your AI coding assistants:
cp -r demos/simple_chat demos/my_demo
cd demos/my_demo
uv sync
Every demo has three files:
| File | What to edit | What it controls |
|---|---|---|
main.py | System prompt, tool definitions, tool handlers | The AI's personality and capabilities |
static/index.html | UI layout, colors, game state display | What the user sees |
config.yaml | TTS/STT/session settings | Voice tuning (optional) |
There is a shared demos/config.yaml that all demos inherit from. Each demo can override it with its own config.yaml.
The core pattern in every main.py:
# 1. Define tools
tools = [
gradbot.ToolDef(
"add_to_order",
"Add a pizza to the order",
'{"type": "object", "properties": {"pizza": {"type": "string"}}, "required": ["pizza"]}',
),
]
# 2. Configure the session via an on_start callback
def on_start(msg: dict) -> gradbot.SessionConfig:
return gradbot.SessionConfig(
voice_id="NbpkqMVS3CJeq2j8",
instructions="You are Marco, a friendly pizzaiolo...",
language=gradbot.Lang.En,
tools=tools,
assistant_speaks_first=True,
)
# 3. Handle tool calls
async def on_tool_call(handle, input_handle, websocket):
if handle.name == "add_to_order":
order.append(handle.args["pizza"])
await handle.send_json({"result": "Added!"})
# 4. Wire it up
@app.websocket("/ws/chat")
async def ws_chat(websocket: fastapi.WebSocket):
await gradbot.websocket.handle_session(
websocket,
config=gradbot.config.from_env(),
on_start=on_start,
on_tool_call=on_tool_call,
)
Tips
- Start from
simple_chatfor basic conversations, orfantasy_shopfor tool calling and game state. - Deferred tool calls: delay
tool_handle.send()and the AI keeps talking while waiting. Seehotelfor an example. - Voice selection: any voice from the Gradium voice library can be used by passing its
voice_idtoSessionConfig. - Mid-conversation changes:
input_handle.send_config(new_config)switches voice, language, or prompt without restarting.
Integrations
| Category | Services |
|---|---|
| STT | Gradium streaming ASR |
| TTS | Gradium streaming TTS (full voice library, 5 languages) |
| LLM | Any OpenAI-compatible API: OpenAI, Groq, OpenRouter, Ollama, LM Studio, etc. |
| Telephony | Twilio Media Streams |
| Tools | MCP (Model Context Protocol), Tavily web search, custom JSON Schema tools |
| Transport | WebSocket (OpenAI Realtime API compatible, Twilio protocol) |
Remote Mode
For hosted deployment, gradbot_server runs the STT/LLM/TTS loop on a central server while clients connect over WebSocket. This keeps LLM credentials server-side.
Running the server
cargo run -p gradbot_server -- --config server.toml
Example server.toml:
addr = "0.0.0.0"
port = 8080
gradium_base_url = "https://api.gradium.ai/api"
llm_base_url = "https://api.openai.com/v1"
llm_api_key = "$LLM_API_KEY"
llm_model_name = "gpt-4o"
[pinned]
# Fields listed here override client-provided values
# llm_extra_config = '{"reasoning": {"effort": "none"}}'
Connecting from Python
Add to config.yaml (no code changes needed):
gradbot_server:
url: "wss://your-server.com/ws"
api_key: "grd_..."
Or connect explicitly:
input_handle, output_handle = await gradbot.run(
gradbot_url="wss://your-server.com/ws",
gradbot_api_key="grd_...",
session_config=config,
input_format=gradbot.AudioFormat.OggOpus,
output_format=gradbot.AudioFormat.OggOpus,
)
# Same handles, same API - tool calls, events, everything works identically
Configuration
Gradbot supports three layers of configuration, applied in order:
| Layer | Format | Used by |
|---|---|---|
| Environment variables | GRADIUM_API_KEY, LLM_API_KEY, LLM_BASE_URL, LLM_MODEL | All modes |
| YAML config | demos/config.yaml + per-demo overrides | Python demos |
| TOML config | configs/gradbot.toml | Rust server binary |
See demos/config.example.yaml for all available YAML options and gradbot_server/config.example.toml for server configuration.
Building from Source
Rust
cargo build # debug
cargo build --release # release
cargo clippy # lint
cargo test # tests
Python bindings
cd demos/simple_chat # or any demo
uv sync # builds via maturin automatically
To rebuild after Rust changes:
uv sync --reinstall-package gradbot
Or use the Makefile:
make build DEMO=simple_chat # build + install into one demo's venv
make build-all # build + install into all demo venvs
make run DEMO=simple_chat # run with uvicorn (auto-reload, excludes .venv)
Docker
docker build -t gradbot .
docker run -e GRADIUM_API_KEY=grd_... -e LLM_API_KEY=sk-... -p 8000:8000 gradbot
Project Structure
gradbot/
├── gradbot_lib/ # Core Rust library (STT/LLM/TTS multiplexing)
├── gradbot_py/ # Python bindings (PyO3 + maturin)
│ └── gradbot/ # Python package (fastapi helpers, config, audio worklet)
├── gradbot_server/ # Standalone WebSocket server (remote mode)
├── src/ # Server binary (OpenAI & Twilio WebSocket protocols)
├── demos/ # Example applications
│ ├── app.py # Combined app mounting all demos (for Docker)
│ └── config.example.yaml # Configuration template
└── configs/ # TOML configs for the Rust server binary
Python API Reference
See gradbot_py/README.md for the full Python API documentation.
Community Contributions
Projects built by the community using Gradbot.
Dual-LLM Proxy (MiniMax): A Gradbot fork that runs two LLMs in parallel behind an OpenAI-compatible proxy — a fast "stall" model (MiniMax M2-her) streams an immediate acknowledgement while a slower "brain" model (MiniMax M2) produces the real reply with tool calls. Hides brain-model latency by filling the gap with natural-sounding stall speech.
EchoClaim: We built a call agent that knows the caller, and answers insurance related calls in human-like tone.
Built something with Gradbot? See COMMUNITY_CONTRIBUTIONS.md for instructions on how to open a PR to add your project to this list.
License
Dual-licensed under MIT or Apache-2.0, at your option.
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- Apache-2.0 OR MIT
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
Open source framework to vibecode and prototype voice agents with Gradium APIs |
31 downloads over 30 days | 3 | 152 | 0.6.4 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
any-tts Listed
A Rust TTS library with Candle backends and runtime adapters for modern open TTS models Also in Speech and audio. |
3,404 downloads over 30 days | 2 | 23 | 0.2.0 | CUDA, Metal | No native code found | Apache-2.0 OR MIT |
|
Open-source, local-first Granola/Otter alternative that Claude Code, Codex, Cursor, and any MCP client can query. Meetings, calls, and voice memos transcribed on-device into markdown you own. Also in Speech and audio. |
3,152 binary downloads per release | Not applicable | 1,595 | 0.32.1 | CUDA, Metal, Vulkan | Binds native code: alsa-sys, libsqlite3-sys, knf-rs-sys (feature diarize), ort-sys (feature diarize), whisper-rs-sys (feature coreml) | MIT |
|
Voice for the Linux desktop: dictation, read-aloud (TTS), and voice-driven LLM commands, with Groq, OpenAI, Deepgram, and local Whisper backends Also in Speech and audio. |
61 binary downloads per release | Not applicable | 149 | 0.2.0 | CUDA, Vulkan | Binds native code: alsa-sys, mac-notification-sys, wayland-sys (feature overlay), whisper-rs-sys (feature local-whisper) | MIT |
|
voxr New
Audio and speech on boostr: compressed-audio decode, resampling, DSP and grapheme to phoneme, with speech synthesis (Kokoro, VITS), voice cloning (VoxCPM2), transcription with word timings (Whisper), voice activity (Silero) and audio-text scoring (CLAP), on CPU or CUDA. Also in Speech and audio. |
642 downloads over 30 days | 2 | 2 | 0.9.1 | CUDA | No native code found | Apache-2.0 |
|
flowcat New
Self-hosted native-Rust real-time voice-agent runtime — one binary, no Python or softswitch: transports, serializers, codec, and a speech-to-speech (Gemini Live) pipeline. Also in Build LLM apps and agents. |
46 downloads over 30 days | 0 | 127 | 0.1.0 | GPU support unknown | Binds native code: audiopus_sys (feature local), ort-sys (feature vad-ort), whisper-rs-sys (feature stt-whisper-local) | Apache-2.0 |
All projects in Build LLM apps and agentsAll projects in Speech and audio
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 0 active dependents and 0 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 152 stars, 35 forks and 8 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.
- Docs are missing: the primary crate publishes no README.
What else the check found
- The last activity is on 7 Sep 2026, 63 days ago. The rules expect an update within 365 days. Dormancy rule
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.6.4 base 450, capped at 1 releases = 50, raised to the 365-day floor: E = 365 daysdormancy: last activity 2026-09-07, 63 days ago, E = 365: activefeatured: not featured: active_users 0 < 11 and new_adopters 0 < 9 and repository route stars 152 (needs 4539), forks 35 (needs 434), contributors 8 (needs 79); docs missinglisted: listed: no archive, new or featured rule applies
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the GitHub repository description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption0 active dependents, 0 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 0 | crates.io database dump | Yes | |
| New dependents (365 days) | 0 | crates.io database dump | Yes | |
| Peak active dependents | 0 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 2 months ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-09-07 | GitHub repository | Yes | |
| Latest release | 2026-03-11 | crates.io database dump | Yes | |
| First release | 2026-03-11 | crates.io database dump | Yes | |
| Latest version | 0.6.4 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 203 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 1 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | false | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution1 releases, 31 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 1 | crates.io database dump | Yes | |
| Downloads over 30 days | 31 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository152 stars, 35 forks, 8 contributors, 97 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 152 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 35 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 8 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 97 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | Apache-2.0 OR MIT | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 3 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.