Skip to main content
from livekit.agents import AgentSession
from livekit.plugins import deepgram, openai, cartesia
import voicegateway

session = AgentSession(
    stt=deepgram.STT(model="nova-3"),
    llm=openai.LLM(model="gpt-4o-mini"),
    tts=cartesia.TTS(model="sonic-3"),
)
voicegateway.attach(session)   # one line. profile every call.
# logged per call: provider, model, tokens, $cost, latency, session_id

The open-source profiler for voice agents. Add one line and every STT, LLM, and TTS call is priced and timed: cost to the cent, latency p50/p95, and conversation quality. attach() takes a LiveKit AgentSession or a Pipecat PipelineTask, and import voicegateway pulls neither framework until you use it. Prices come from voice-prices and reconcile against your real provider invoices with one command. Self-hosted, your keys, no data leaves your infra.

Using Pipecat? Same one line.
from pipecat.pipeline.task import PipelineTask
import voicegateway

task = PipelineTask(pipeline)
voicegateway.attach(task)   # profile every call, Pipecat

Quick start

# Local SQLite + the dashboard at http://localhost:8080
pip install "voicegateway[dashboard]"
voicegw init && voicegw serve

Add the voicegateway.attach(session) line above to your agent and every call is tracked. Provider plugins install with your framework: pip install "voicegateway[livekit,deepgram,openai,cartesia]" or "voicegateway[pipecat]".

Python 3.11+. The full extras matrix, the zero-install uvx path, and the OS daemon installer are in the get-started docs.

What you get

Voice AI vendors hide three numbers: whether it works, what it costs, and how to make it cheaper. VoiceGateway exposes all three, per call.

Capability What it gives you
Framework-neutral One attach() for LiveKit or Pipecat. Your keys, your plugins, no lock-in
Voice-conversation metrics Per-minute cost, latency p50/p95, interruptions, dead air, talk-over
Cost to the cent STT by audio seconds, LLM by tokens, TTS by characters, broken down per call and per model
Reconciliation voicegw reconcile checks recorded cost against your real provider invoices
Spend control guard(): daily budget cap, fallback on error, rate limit, per project
Conversation replay Scrub any past call: STT chunks, LLM tokens, TTS frames, with timing and cost
Multi-tenant attribution Per-tenant cost, scoped API keys per team, agency-ready
Fleet collector One-line installer. N agents push to one collector. Slice by agent, project, tenant

Building a text-only LLM app with no voice? LiteLLM is the better fit. See the decision table. Release history: CHANGELOG.md.

The dashboard

Self-hosted at http://localhost:8080. Bundled, no SaaS account, no data leaves your stack.

VoiceGateway dashboard: cost by provider and model
Example numbers. Click through the real thing, no login, at voicegateway.dev/demo.

Overview (7-day spend and request trend), Agents (per-agent cost, model stack, worker memory), Costs (per provider, model, project, tenant, plus latency p50/p95), Calls (replay any conversation), Latency, Server (your LiveKit rooms, SIP, egress, cost-annotated), and Diagnostics (probe your LiveKit deployment).

White-label it per project: upload a logo, set an accent color and product name, and the whole UI re-skins. One-key light/dark.

Spend control with guard()

attach() watches. guard() acts. Wrap one provider to cap spend, fall back on errors, and rate-limit. It returns a drop-in of the same type, so it slots into your session unchanged.

llm = voicegateway.guard(
    openai.LLM(model="gpt-4o-mini"),
    fallback=[openai.LLM(model="gpt-4o")],   # on a primary error
    budget="$5.00/day",                       # hard stop past the cap
    rate_limit="60/min",
)

guard() writes no metrics and attach() never double-counts, so use both together.

Fleet collector

Run one shared collector on your VPS. Every agent pushes to it: one dashboard, one cost view, across all of them.

curl -fsSL https://voicegateway.dev/collector.sh | bash

The script installs Docker if needed, generates and persists secrets, pins the image version, and health-checks the container before returning. Point your agents at it:

export VOICEGW_COLLECTOR_URL="https://collector.example.com"
export VOICEGW_API_KEY="<your-ingest-key>"
export VOICEGW_PROJECT="my-agent"

attach() reads those and batches every call to the collector instead of local SQLite. SQLite and Postgres backends, Docker Compose, and HTTPS via Caddy: deployment docs.

Coding agents (MCP)

VoiceGateway ships a Model Context Protocol server, so Claude Code, Cursor, Codex, and Cline can create projects, check costs, and inspect calls in natural language.

pipx inject voicegateway "voicegateway[dashboard]"
claude mcp add voicegateway --command "voicegw mcp --transport stdio"

Destructive ops (delete_*) require an explicit confirm=True after a preview. Remote HTTP/SSE transport and the full tool list: MCP reference.

Providers

Any provider voice-prices covers. You bring your own native plugins; VoiceGateway meters and prices them.

Modality Cloud Local
STT Deepgram, OpenAI Whisper, AssemblyAI, Groq faster-whisper
LLM OpenAI, Anthropic, Groq Ollama (any compatible)
TTS Cartesia, ElevenLabs, Deepgram Aura-2, OpenAI Kokoro, Piper

A price it does not recognize records at zero and flags for a rate-card entry, so nothing is silently dropped. Per-model IDs: configuration/providers.

Contributing

git clone https://github.com/mahimailabs/voicegateway
cd voicegateway
pip install -e ".[dev]"
pytest

Read CONTRIBUTING.md and CODE_OF_CONDUCT.md before opening a PR. Security issues go through SECURITY.md, not a public issue. Questions and ideas are welcome in Discord.

Contributors

License

MIT. Fork it, ship it.

Built in public by Mahimai Raja, founder of Mahimai AI, a voice AI company. Standing on LiveKit Agents, Pipecat, FastAPI, Pydantic, and voice-prices.

GitAds Sponsored

Sponsored by GitAds

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

voicegateway-0.25.7.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

voicegateway-0.25.7-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file voicegateway-0.25.7.tar.gz.

File metadata

  • Download URL: voicegateway-0.25.7.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for voicegateway-0.25.7.tar.gz
Algorithm Hash digest
SHA256 072ba6d7734a5f170609e9fd16619ebf7b7a937e2954f83d998e8efcc5a4b5ea
MD5 48bdcee84f30818398c8ca6bece0ab89
BLAKE2b-256 3d56c9a8d61cf0c3de8344d291e765116154fa7d1b16a9b21a76533b7e963066

See more details on using hashes here.

File details

Details for the file voicegateway-0.25.7-py3-none-any.whl.

File metadata

  • Download URL: voicegateway-0.25.7-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for voicegateway-0.25.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a9f1c88e85a6dc74dcbd88d2423b2dd5afe85fdfd8c1290f2c60ad6e3f91cf6b
MD5 0eb55460ed31dccac5971754f4e00dab
BLAKE2b-256 8cd80e92fa80da093237b5ee5d2e46c2862ce2b9a61f2655f28680a197676a57

See more details on using hashes here.

Release history Release notifications | RSS feed

0.26.1

2 files

0.26.0

2 files

0.25.8

2 files

This release

0.25.7 This release

2 files

0.25.6

2 files

0.25.5

2 files

0.25.4

1 file

0.25.3

1 file

0.25.2

1 file

0.25.1

1 file

0.25.0

1 file

0.24.13

1 file

0.24.12

1 file

0.24.11

1 file

0.24.9

1 file

0.24.8

1 file

0.24.7

1 file

0.24.6

1 file

0.24.5

1 file

0.24.4

1 file

0.24.3

1 file

0.24.2

1 file

0.24.1

1 file

0.24.0

1 file

0.23.0

1 file

0.22.3

2 files

0.22.2

2 files

0.22.1

2 files

0.22.0

2 files

0.21.1

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.1

2 files

0.13.0

2 files

0.12.0

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page