{
  "markdown": "# LLM Latency Tracker\n\n**Independent, provider-neutral latency & uptime for AI inference APIs — measured, not scraped.**\n\n🌐 **Live: [llmlatency.dev](https://llmlatency.dev)** · 📊 [JSON API](https://llmlatency.dev/api/rankings.json) · 🤖 [MCP server](https://llmlatency.dev/mcp) · 🗓️ [Deprecation calendar](https://llmlatency.dev/deprecations)\n\n![License](https://img.shields.io/badge/code-MIT-blue) ![Data](https://img.shields.io/badge/data-CC--BY--4.0-green) ![Agent-Ready](https://img.shields.io/badge/agent--ready-Level%205-orange) ![Python](https://img.shields.io/badge/python-3.12%2B-3776ab)\n\nMost \"AI API latency\" numbers come from the providers themselves, or from a benchmark run once and never updated. This project **measures** it continuously, from multiple regions, and publishes the result as an open dataset.\n\n- **Edge latency** — full DNS → TCP → TLS → time-to-first-byte, measured with the Python standard library (no API key required).\n- **Inference latency** — real time-to-first-token via a streaming request (optional, needs a provider key).\n- **Uptime** — success rate per provider, per region.\n- **Regions** — Europe (Germany), US (Central), Asia (Tokyo), South America (São Paulo). More welcome.\n- **~45 providers** — OpenAI, Anthropic, Google, Mistral, DeepSeek, xAI, Groq, Together, Fireworks, Cerebras, OpenRouter, Perplexity, plus Chinese models (GLM/Zhipu, Kimi/Moonshot, Qwen, MiniMax) and many more.\n- **Deprecation calendar** — upcoming model retirements + migration targets, verified from official provider docs.\n\nThe site is a self-updating static site (Cloudflare Pages). The value isn't the code — it's the continuously-accumulated, distributed measurement archive. The code is open so the methodology is transparent.\n\n## For developers\n\n```bash\n# All regions, provider rankings for the last 24h — measured latency + uptime:\ncurl https://llmlatency.dev/api/rankings.json\n```\n\n- **JSON API:** [`/api/rankings.json`](https://llmlatency.dev/api/rankings.json) · **OpenAPI:** [`/openapi.json`](https://llmlatency.dev/openapi.json)\n- **Any page as Markdown:** send `Accept: text/markdown` to any page URL, or append `.md`.\n- **For LLM ingestion:** [`/llms.txt`](https://llmlatency.dev/llms.txt) (index) and [`/llms-full.txt`](https://llmlatency.dev/llms-full.txt) (full corpus).\n- **License:** data is **CC-BY-4.0** — free to use with attribution.\n\n## For AI agents\n\nThere's a real **MCP server** (Streamable HTTP) exposing a `get_ai_api_latency` tool backed by the live data:\n\n```bash\ncurl -X POST https://llmlatency.dev/mcp \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\n       \"params\":{\"name\":\"get_ai_api_latency\",\"arguments\":{\"region\":\"eu-hetzner\"}}}'\n```\n\n### Run the MCP server locally\n\nThe hosted endpoint above needs no setup. If you prefer a local stdio server (or want to build it from source), `mcp_server.py` is a dependency-free proxy over the same public JSON API:\n\n```bash\npython3 mcp_server.py            # stdio MCP, stdlib only\n# or\ndocker build -t llm-latency-mcp . && docker run -i llm-latency-mcp\n```\n\nAlso available: an [MCP Server Card](https://llmlatency.dev/.well-known/mcp/server-card.json) (`/.well-known/mcp/server-card.json`), a browser **WebMCP** tool, an [API catalog](https://llmlatency.dev/.well-known/api-catalog) (RFC 9727) and an [Agent Skills index](https://llmlatency.dev/.well-known/agent-skills/index.json). Regions: `eu-hetzner`, `us-central`, `ap-tokyo`, `sa-east` (omit for all).\n\n## How it works\n\n```\nconfig.py       — registry of providers + this node's REGION (env)\nprobe.py        — network probe (DNS→TCP→TLS→TTFB, stdlib, no key) + inference probe (TTFT, needs key)\nrun.py          — one probe cycle across all providers (run on a schedule)\ndb.py           — SQLite time-series (the accumulated measurement archive)\naggregate.py    — measurements → p50 / p95 / uptime rankings per region & provider\nsitegen.py      — rankings → static site (JSON API, OpenAPI, llms.txt, schema.org, MCP surface)\ningest.py       — central endpoint that collects measurements from remote probe nodes\nship.py         — probe node → central node shipper (watermark-based, never loses data on outage)\ndeprecations.py — model deprecation/migration calendar (only verified, sourced entries)\n```\n\nEach probe node runs with its own `REGION`, measures every provider, and writes to the time-series. For multi-region, remote nodes ship their measurements to a central node that aggregates and builds the site.\n\n## Run it yourself (no keys needed)\n\n```bash\ngit clone https://github.com/mazamaka/llm-latency-tracker\ncd llm-latency-tracker\nREGION=local python3 run.py         # take edge-latency measurements\npython3 aggregate.py --region local # see the ranking from this location\n```\n\nRuns on plain Python 3.12+ (standard library). `httpx` / `loguru` are optional.\n\n**Inference probes (real TTFT):**\n\n```bash\ncp .env.example .env                # add keys for the providers you want to measure\npip install -r requirements.txt\nREGION=local python3 run.py\npython3 aggregate.py --region local --type inference\n```\n\n**Build the site locally:**\n\n```bash\nBASE_URL=https://example.com python3 sitegen.py   # → ./site/\npython3 -m pytest -q                              # tests\n```\n\nSee [`deploy/`](deploy/) for a container + a generic multi-region deployment guide.\n\n## Contributing\n\nEspecially welcome:\n\n- **New providers** — add a `Provider(...)` entry in [`config.py`](config.py) (host + public models endpoint is enough for edge probes).\n- **New regions** — spin up a probe node in a new location and ship to a central node.\n- **Fixes & tests** — CI runs `pytest` + `ruff` on every push.\n\nSee **[CONTRIBUTING.md](CONTRIBUTING.md)** for dev setup, how to add a provider/region, and PR guidelines. Please keep the project's principle: **measured, not scraped, and honest about the dataset's age.**\n\n## License\n\n- **Code:** [MIT](LICENSE)\n- **Data** (rankings, API output): **CC-BY-4.0** — attribute [llmlatency.dev](https://llmlatency.dev).\n\n<!-- DATASET:BEGIN -->\n\n### Daily snapshot — 2026-09-01\n\nMeasured latency across **45 AI inference providers** in 4 regions. Method: distributed edge (DNS→TCP→TLS→TTFB) + inference (TTFT) probes, last 24h. License: CC-BY-4.0.\n\n| Region | Fastest provider (p50) | p50 | p95 | Uptime |\n|---|---|---|---|---|\n| Asia (Tokyo) | fireworks | 18 ms | 66 ms | 100% |\n| Europe (Germany) | nscale | 98 ms | 199 ms | 100% |\n| South America (São Paulo) | openrouter | 59 ms | 96 ms | 100% |\n| US (Central) | google | 47 ms | 108 ms | 100% |\n\n- Full dataset: [`data/rankings/2026-09-01.json`](data/rankings/2026-09-01.json) ([latest](data/rankings/latest.json))\n- Citable archive (DOI): [`10.5281/zenodo.21954788`](https://doi.org/10.5281/zenodo.21954788) — daily aggregates, CC-BY-4.0\n- Hugging Face dataset: <https://huggingface.co/datasets/llmlatency/llm-latency-tracker>\n- Kaggle dataset: <https://www.kaggle.com/datasets/llmlatency/llm-latency-tracker>\n- Archived in Software Heritage: [`swh:1:snp:2778cbabd72a70a629ee35fbd5ac536d1ccb7a9a`](https://archive.softwareheritage.org/swh:1:snp:2778cbabd72a70a629ee35fbd5ac536d1ccb7a9a)\n- Python client: <https://pypi.org/project/llmlatency/>\n- Live rankings and methodology: <https://llmlatency.dev>\n- Machine-readable API: <https://llmlatency.dev/api/rankings.json>\n- Model deprecation calendar: <https://llmlatency.dev/deprecations>\n\n_Snapshot generated 2026-09-01T07:47:48Z — this table is regenerated daily._\n\n<!-- DATASET:END -->\n",
  "bytes": 7508,
  "sha": "d0335979677d0aee160ae9f79e91e4a7aa3cb694f6c0f0b2c93884ce88587a71",
  "repo_slug": "mazamaka/llm-latency-tracker",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_dev_llmlatency_llm_latency_tracker_585fa099/readme"
}