gradbot

Library Listed

Open source framework to vibecode and prototype voice agents with Gradium APIs

Checked · Sources

Downloads
31
Dependents
3
Stars
152
Forks
35
Contributors
8
Commits
97
Latest release
0.6.4 ·

About

From the project README ·

Gradbot

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_server centrally; 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.

DemoWhat it doesKey concepts
simple_chatBasic voice conversationMinimal starting point, dynamic voice/prompt switching
fantasy_shopHaggling game: buy a sword from NPCsTool calling, multi-character, game state, deferred tools
hotelHotel booking agent for Paris, Bali, DubaiDeferred 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 listingsVoice/text profile intake, Tavily web search, scoring, saved listings
business_bankBanking agent with PIN auth and loan applicationsSecurity flows, multi-step business logic
restaurant_orderingMultilingual voice ordering agent for a fast-food restaurantMenu browsing, order customization, multilingual support
npc_3d_game3D office exploration: solve voice riddles, handle NPC check-insThree.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:

FileWhat to editWhat it controls
main.pySystem prompt, tool definitions, tool handlersThe AI's personality and capabilities
static/index.htmlUI layout, colors, game state displayWhat the user sees
config.yamlTTS/STT/session settingsVoice 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_chat for basic conversations, or fantasy_shop for tool calling and game state.
  • Deferred tool calls: delay tool_handle.send() and the AI keeps talking while waiting. See hotel for an example.
  • Voice selection: any voice from the Gradium voice library can be used by passing its voice_id to SessionConfig.
  • Mid-conversation changes: input_handle.send_config(new_config) switches voice, language, or prompt without restarting.

Integrations

CategoryServices
STTGradium streaming ASR
TTSGradium streaming TTS (full voice library, 5 languages)
LLMAny OpenAI-compatible API: OpenAI, Groq, OpenRouter, Ollama, LM Studio, etc.
TelephonyTwilio Media Streams
ToolsMCP (Model Context Protocol), Tavily web search, custom JSON Schema tools
TransportWebSocket (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:

LayerFormatUsed by
Environment variablesGRADIUM_API_KEY, LLM_API_KEY, LLM_BASE_URL, LLM_MODELAll modes
YAML configdemos/config.yaml + per-demo overridesPython demos
TOML configconfigs/gradbot.tomlRust 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.

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.

gradbot beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
gradbot This page Listed

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
minutes App Listed

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
whisrs App Listed

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

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
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 days
  • dormancy: last activity 2026-09-07, 63 days ago, E = 365: active
  • featured: 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 missing
  • listed: 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
Adoption0 active dependents, 0 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents0crates.io database dumpYes
New dependents (365 days)0crates.io database dumpYes
Peak active dependents0crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 2 months ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-09-07GitHub repositoryYes
Latest release2026-03-11crates.io database dumpYes
First release2026-03-11crates.io database dumpYes
Latest version0.6.4crates.io database dumpYes
Days the oldest outside issue waits for a reply203GitHub repositoryYes
Maintainer replies over 365 days1GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docsfalsecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution1 releases, 31 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases1crates.io database dumpYes
Downloads over 30 days31crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository152 stars, 35 forks, 8 contributors, 97 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars152GitHub repositoryYes — one part of the repository route
GitHub forks35GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account8GitHub contributorsYes — one part of the repository route
Commits on the default branch97GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseApache-2.0 OR MITcrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesNo native code foundcrates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly3crates.io database dumpNo

Corrections and review history

Report a correction

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.