LLM Speedtest MCP

Compare first-text latency, total latency, and estimated output throughput across provider APIs from a local stdio MCP server. Uses your own API keys.

Documentation

LLM Speedtest MCP

Benchmark AI model inference speed β€” like speedtest.net, but for LLMs.

Run it locally inside your AI tool (Claude Desktop, Cursor, Hermes, etc.) and say "benchmark my models" to get TPS, TTFT, and latency comparisons across all your configured providers.

πŸš€ Quick Start

Install from source with Node.js 20 or newer (required by the patched dependency tree). The package is not currently published on npm, so use the built local entry point rather than npx llm-speedtest-mcp.

git clone https://github.com/thakoreh/llm-speedtest-mcp.git
cd llm-speedtest-mcp
git checkout v0.1.1
npm ci
npm run build
node dist/index.js --version

The tested source release is v0.1.1. See CHANGELOG.md. The GitHub tag pins the source installation; the package remains unpublished on npm.

Use the absolute path to dist/index.js in your MCP client configuration. On Windows, forward slashes work in JSON paths, for example C:/tools/llm-speedtest-mcp/dist/index.js.

Configure in Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "llm-speedtest": {
      "command": "node",
      "args": ["/absolute/path/to/llm-speedtest-mcp/dist/index.js"]
    }
  }
}

Configure in Cursor

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "llm-speedtest": {
      "command": "node",
      "args": ["/absolute/path/to/llm-speedtest-mcp/dist/index.js"]
    }
  }
}

πŸ”‘ Setting Up API Keys

Set environment variables for the providers you want to test:

export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GROQ_API_KEY="gsk_..."
export OPENROUTER_API_KEY="sk-or-..."
export DEEPSEEK_API_KEY="sk-..."
export MINIMAX_API_KEY="..."
export ZAI_API_KEY="..."          # or ZHIPU_API_KEY
export KIMI_API_KEY="..."         # or MOONSHOT_API_KEY

For Claude Desktop/Cursor, set these in your shell profile or in the MCP server config's env field.

πŸ› οΈ MCP Tools

list_providers

Shows which providers are configured (which env vars are set). Does NOT show key values.

benchmark_models

Runs a standardized prompt through all detected providers. Measures:

  • TTFT β€” Time to First Token (ms)
  • TPS β€” Tokens per Second
  • Total Latency β€” Wall clock time (ms)
  • Token Count β€” Estimated output tokens

benchmark_model

Benchmark a single specific model with a custom prompt.

Both benchmark tools accept an optional timeout_ms (1–300000, default 60000) per model. MCP cancellation aborts the provider requests. Failed requests return isError: true for a single benchmark or when all models fail; mixed results retain per-model error rows. Provider error bodies and network exception text are omitted because they can contain credentials. HTTP errors retain their status code.

Run node dist/index.js --help for command usage or --version for the package version. With no arguments the process serves MCP over stdio; it does not print a prompt.

πŸ“Š Example Output

Illustrative output only; these values are not measured benchmark evidence or current provider rankings.

╔══════════════════════════════════════════════════════════════════════════╗
β•‘                    LLM SPEED TEST RESULTS                                β•‘
╠══════════════════════════════════════════════════════════════════════════╣
β•‘ Provider         β”‚ Model                       β”‚ TTFT   β”‚ TPS    β”‚ Total  β”‚ Tokens β•‘
β•‘                  β”‚                             β”‚ (ms)   β”‚ (t/s)  β”‚ (ms)   β”‚        β•‘
╠══════════════════════════════════════════════════════════════════════════╣
β•‘ OpenAI           β”‚ gpt-4o                      β”‚    320 β”‚  42.15 β”‚   6100 β”‚    256 β•‘
β•‘ Groq             β”‚ llama-3.3-70b-versatile     β”‚     45 β”‚ 185.30 β”‚    520 β”‚    256 β•‘
β•‘ Anthropic        β”‚ claude-sonnet-4-20250514    β”‚    280 β”‚  58.22 β”‚   4500 β”‚    256 β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸ† Fastest: Groq / llama-3.3-70b-versatile at 185.3 tokens/sec
⚑ Lowest TTFT: Groq / llama-3.3-70b-versatile at 45ms

πŸ—οΈ Supported Providers

These are built-in example model IDs, not a live availability catalog. Check the provider's current documentation before running; unavailable models return errors. The source's PROVIDERS table controls the accepted IDs.

ProviderEnv VariableModels
OpenAIOPENAI_API_KEYgpt-4o, gpt-4o-mini
AnthropicANTHROPIC_API_KEYclaude-sonnet-4-20250514, claude-haiku-4-20250414
GroqGROQ_API_KEYllama-3.3-70b-versatile, mixtral-8x7b-32768
OpenRouterOPENROUTER_API_KEYdeepseek/deepseek-r1, google/gemini-2.0-flash-001
DeepSeekDEEPSEEK_API_KEYdeepseek-chat, deepseek-reasoner
MiniMaxMINIMAX_API_KEYMiniMax-M1, MiniMax-Text-01
Zhipu/ZAIZAI_API_KEY or ZHIPU_API_KEYglm-4-plus, glm-4-flash
Kimi/MoonshotKIMI_API_KEY or MOONSHOT_API_KEYmoonshot-v1-8k, moonshot-v1-32k

πŸ”’ Trust & Security

This tool is designed to be trusted.

  • This tool never sends your keys anywhere except directly to the AI provider you're testing.
  • Zero telemetry. Zero analytics. Zero callhome.
  • Under 500 lines of code β€” audit it yourself in 5 minutes.
  • No database, no file system writes, no network calls except to provider APIs.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    YOUR MACHINE                          β”‚
β”‚                                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚  β”‚  AI Tool     β”‚     β”‚  llm-speedtest-mcp       β”‚      β”‚
β”‚  β”‚  (Claude/    │────▢│                          β”‚      β”‚
β”‚  β”‚   Cursor/    β”‚ MCP β”‚  Reads API keys from     β”‚      β”‚
β”‚  β”‚   Hermes)    │◀────│  environment variables   β”‚      β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚  only. Never logs them.  β”‚      β”‚
β”‚                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β”‚                                  β”‚                      β”‚
β”‚                                  β”‚ Direct API calls     β”‚
β”‚                                  β”‚ (streaming)          β”‚
β”‚                                  β”‚                      β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚                    β–Ό             β–Ό             β–Ό        β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚              β”‚ OpenAI   β”‚ β”‚ Anthropicβ”‚ β”‚  Groq    β”‚    β”‚
β”‚              β”‚ API      β”‚ β”‚ API      β”‚ β”‚  API     β”‚    β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                    β–²             β–²             β–²        β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚                     YOUR keys go ONLY                   β”‚
β”‚                     to the provider.                    β”‚
β”‚                     Nothing in between.                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

  βœ… No proxy    βœ… No relay    βœ… No telemetry
  βœ… No database βœ… No logging  βœ… No file writes

Why This Is Safe

  1. Reads keys from env only β€” No custom key input, no forms, no prompts for keys.
  2. Keys never logged β€” Not in console, not in debug output, not in error messages.
  3. Direct provider calls β€” Each API call goes straight from fetch() to the provider's API endpoint.
  4. Runtime dependencies are the MCP SDK and Zod - No axios, analytics packages, or tracking in this server's application code.
  5. No file I/O β€” The server reads env vars and makes HTTP requests. That's it.
  6. Auditable β€” The entire source is under 500 lines. Read every line in 5 minutes.

πŸ“¦ Development

git clone https://github.com/thakoreh/llm-speedtest-mcp.git
cd llm-speedtest-mcp
npm install
npm run build
npm start

How to interpret the numbers

  • TTFT is elapsed time from starting the HTTP request to receiving the first text delta, including network and server delay. It does not measure the first hidden reasoning token.
  • Total latency runs from request start until the stream ends.
  • Output tokens are estimated as roughly four JavaScript string characters per token. TPS uses that estimate divided by the elapsed interval after the first text delta. It is not a provider-reported token count or billing measure.
  • benchmark_models runs the configured model requests concurrently. A single run is a local observation, not a controlled provider comparison or a quality evaluation.

Empty-text streams produce an error instead of a fabricated token count or a benchmark winner.

Offline regression tests

npm test
npm run test:package

The tests start the real MCP server over stdio using the SDK client in fresh subprocesses. Preloads replace provider fetch calls with local fixtures. Tests cover both stream formats, elapsed timing, fragmented UTF-8/CRLF data, all eight providers, missing/invalid input, errors after partial output, credential-safe errors, timeouts, cancellation, repeated calls, and command help. Test fixtures use dummy keys and never call a provider API. test:package builds a tarball, installs it with production dependencies in a separate temporary directory, and reruns the MCP tests against the installed entry point. Package installation needs registry access; the provider tests remain offline.

πŸ“„ License

MIT Β© Hiren Thakore