Skip to main content

voice-latency

A per-hop latency budget for voice agents. It models two architectures, cascaded (STT then LLM then TTS) and realtime (one speech-to-speech model), adds framework overhead, and tells you where the milliseconds go.

The numbers are the point. Every provider figure lives in one Python file with a source and a date. If you have measured better, open a PR. That is how a latency benchmark stays honest.

This package powers the calculator at mahimai.ca/tools/latency-calculator; the site reads the same data, so the two never disagree.

Install

pip install voice-latency      # or: uv pip install voice-latency

Use it

from voice_latency import estimate

# Cascaded pipeline (default)
e = estimate(stt="Deepgram Nova-3", llm="GPT-4o mini", tts="Cartesia Sonic",
             transport="PSTN / SIP", endpointing=700, calls=25)
print(e.total_p50, e.total_p95)   # 1326 1589
print(e.max_hop)                  # 'endp'  (the endpointing delay you set)

# Realtime, speech-to-speech
r = estimate(mode="realtime", realtime="Gemini Live (Flash)",
             framework="LiveKit Agents", transport="WebRTC")
for hop in r.rows:
    print(f"{hop.label:<26} {hop.p50:>4}ms  p95 {hop.p95}ms")

From the terminal:

voice-latency                                   # default cascaded turn
voice-latency --mode realtime --realtime "OpenAI GPT Realtime"
voice-latency --framework "Google ADK (bidi streaming)" --transport WebRTC
voice-latency list                              # every provider it knows
voice-latency export --out data.json            # the dataset as JSON

The model

A turn's latency is the sum of independent hops. The p50 total sums the per-hop p50s. Percentiles do not add, so the p95 total adds each hop's spread (p95 minus p50) in quadrature on top of the p50 total. Hops:

  • cascaded: network in, jitter, STT, endpointing, LLM, TTS, network out
  • realtime: network in, jitter, endpointing, speech-to-speech model, network out
  • an orchestration framework, if any, adds one overhead hop

Constants (cross-region penalty, concurrency load, endpointing math, thresholds) live in MODEL in src/voice_latency/data.py.

The data

All of it is in src/voice_latency/data.py: STT, LLM, TTS, realtime speech-to-speech models, transport, and frameworks. Figures are illustrative defaults unless a source says otherwise. They are not vendor-published or independently benchmarked.

Improve them. See CONTRIBUTING.md. A PR that adds a source is worth more than a PR that just changes a number.

License

MIT.

Download files

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

Source Distribution

voice_latency-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

voice_latency-0.1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file voice_latency-0.1.0.tar.gz.

File metadata

  • Download URL: voice_latency-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for voice_latency-0.1.0.tar.gz
Algorithm Hash digest
SHA256 44fdf1767e41fdfc63039b9853fc732a4eb268636e4e170f0ccdbc2cb730793e
MD5 8b1bb2c030fdf8aa37cd3d12f6e18b55
BLAKE2b-256 f30d3294e5c2f7576c0fe6134702704997ac2371b06aea899dbed38cb3903218

See more details on using hashes here.

Provenance

The following attestation bundles were made for voice_latency-0.1.0.tar.gz:

Publisher: publish.yml on mahimailabs/voice-latency

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file voice_latency-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: voice_latency-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for voice_latency-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc55fdb2f09b73312069ca72ed5d0f9d19e3bba8fdf81c2355eee698396638e4
MD5 3bad6ba6a7a7f4482dc4a39d4a8c6ced
BLAKE2b-256 aa7b6911f9d067fc9bd3bcc719228365c71046202b982d771df933c8095ac762

See more details on using hashes here.

Provenance

The following attestation bundles were made for voice_latency-0.1.0-py3-none-any.whl:

Publisher: publish.yml on mahimailabs/voice-latency

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page