Skip to main content

llmlatency

Measured latency and uptime for AI inference APIs, as a small Python client for the open dataset published at llmlatency.dev.

Probes run every five minutes from four regions and are never routed through a gateway or an aggregator, so the numbers describe the providers themselves rather than a proxy in front of them.

  • Network probe — DNS → TCP → TLS → time to first byte.
  • Inference probe — time to first token on a real completion request.

These are different quantities, an order of magnitude apart, and this library never mixes them in one ranking.

Install

pip install llmlatency

No dependencies — standard library only.

Use it from Python

import llmlatency

llmlatency.regions()
# ['ap-tokyo', 'eu-hetzner', 'sa-east', 'us-central']

llmlatency.fastest("eu-hetzner")
# {'rank': 1, 'provider': 'nscale', 'p50_ms': 99, 'p95_ms': 203,
#  'uptime_pct': 100, 'samples': 289}

for row in llmlatency.ranking("us-central")[:3]:
    print(row["rank"], row["provider"], row["p50_ms"], "ms")

llmlatency.provider("anthropic")          # one provider across every region
llmlatency.generated_at()                 # snapshot timestamp, ISO-8601 UTC

Fetch once and pass the snapshot around if you make several queries:

data = llmlatency.fetch()
fast = {r: llmlatency.fastest(r, data=data) for r in llmlatency.regions(data)}

Use it from the shell

llmlatency fastest                        # fastest provider in every region
llmlatency ranking --region eu-hetzner --top 5
llmlatency provider openai
llmlatency fastest --probe inference --json

Data, methodology, licence

The dataset is CC-BY-4.0; this client library is MIT.

Limitations, stated up front. Vantage points are cloud data centres, not consumer networks, so absolute values are lower than an end user would see — the comparison between providers is the meaningful part. Provider coverage changes over time as APIs appear and shut down.

Metadata

Release files for llmlatency 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llmlatency 0.1.0
File Size Uploaded
llmlatency-0.1.0.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llmlatency 0.1.0
File Interpreter ABI Platform
llmlatency-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.5 kB

Release files / llmlatency-0.1.0.tar.gz

Download URL llmlatency-0.1.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
908d3ba9752b7fc68e5e17932e235c2342b92233cb7c4ff09389046033625ee2
BLAKE2b-256 checksum
How to use checksums
15419620df986517a9f7c76f8cfb04ffeccd9cfd29d8b3c230dc592e28495ce1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / llmlatency-0.1.0-py3-none-any.whl

Download URL llmlatency-0.1.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44fbd4c69a32431d1e4084425f4d5a2bc313ddc1501df015d9a469c2801461cc
BLAKE2b-256 checksum
How to use checksums
a149a5715046ddbb1f0b3e8c26b2c234a8212b51db371777f51d1c1d0a153543
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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