Labsco
Jwrede logo

llmprobe

โ˜… 1

from Jwrede

Probe LLM API endpoints and report health metrics including time to first token, latency, and throughput. Check single models or run full config-based health checks.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

llmprobe

llmprobe

Synthetic monitoring and CI smoke tests for LLM inference endpoints. Measure TTFT, latency, throughput, and errors. Single binary, zero SDKs.

llmprobe MCP server

llmprobe is a CLI tool for LLM serving reliability. It probes hosted APIs or OpenAI-compatible inference servers, then reports the metrics that matter for production user experience: time to first token (TTFT), total latency, generation throughput (tokens/sec), and error rates.

Use it as a one-off health check, a continuous monitor, or a CI gate that blocks deploys when your LLM provider is degraded.

demo

Public benchmark

llm-bench uses llmprobe to run a continuous public benchmark of major LLM APIs. It publishes a live dashboard at bench.jonathanwrede.de and raw JSONL data in Jwrede/llm-bench-data.

This is the intended use case: repeated synthetic probes that make LLM latency, TTFT regressions, throughput drops, and provider degradation visible before users report them.

What it measures

MetricWhat it means
TTFTTime from request send to first content token. This is what users feel as "lag" before the response starts streaming.
LatencyTotal time from request to stream close.
Tok/sGeneration throughput: tokens produced per second after the first token. Calculated as token_count / (latency - ttft).
TokensTotal output tokens. Prefers provider usage metadata when available, falls back to SSE event counting.
Statushealthy if all thresholds pass, degraded if any threshold is exceeded, error if the request failed.

Commands

llmprobe probe

One-off health check. Probes all configured endpoints and prints results.

llmprobe probe                        # table output
llmprobe probe -f json                # JSON output
llmprobe probe --fail-on degraded     # exit 1 if any endpoint is degraded
llmprobe probe -c custom-config.yml   # custom config path

Exit codes for CI:

--fail-onExit 0Exit 1
error (default)healthy or degradedany error
degradedhealthy onlydegraded or error
nonealwaysnever

llmprobe watch

Continuous monitoring. Probes all endpoints on an interval and prints a summary line per iteration.

llmprobe watch                          # default 60s interval
llmprobe watch --interval 30s           # custom interval
llmprobe watch --tui                    # live terminal dashboard with TTFT chart
llmprobe watch --tui --load data.jsonl  # load historical data into the dashboard
llmprobe watch -f json                  # JSONL output (one line per result)
llmprobe watch --prometheus :9090       # expose Prometheus metrics
llmprobe watch --otel localhost:4317     # export OpenTelemetry metrics via OTLP/gRPC

The --tui flag launches a live terminal dashboard with a TTFT chart, color legend, and statistics table. Use --load to import historical JSONL data (from llmprobe watch -f json > data.jsonl).

llmprobe

$ llmprobe watch --interval 30s

Watching 4 endpoints every 30s (Ctrl+C to stop)

[14:01:02] All 4 endpoints healthy.
[14:01:32] All 4 endpoints healthy.
[14:02:02] 3 healthy, 1 degraded, 0 errors. DEGRADED: openai/gpt-4o (TTFT 1820ms)
[14:02:32] All 4 endpoints healthy.

llmprobe report

Generate a Markdown summary from JSONL probe data with p50/p95/p99 percentiles for TTFT, latency, and throughput per endpoint.

llmprobe report data.jsonl

Output:

| Provider | Model | Probes | Errors | TTFT p50 | TTFT p95 | ... | Tok/s p50 | ...
|----------|-------|--------|--------|----------|----------|-----|-----------|----
| openai   | gpt-4o | 100  | 2      | 115ms    | 188ms    | ... | 46.9      | ...

llmprobe baseline

Create a baseline file from historical JSONL data for regression detection.

llmprobe baseline data.jsonl -o baseline.json

Reference the baseline in your config to use multiplier-based thresholds:

baseline: baseline.json

providers:
  - name: openai
    api_key: ${OPENAI_API_KEY}
    models:
      - name: gpt-4o
        thresholds:
          max_ttft_multiplier: 2.0       # fail if TTFT > 2x baseline p50
          max_latency_multiplier: 2.5    # fail if latency > 2.5x baseline p50

This lets you detect regressions relative to your own historical data rather than setting absolute thresholds.

llmprobe version

Print the installed binary version.

llmprobe version

CI integration

Use llmprobe probe as a pre-deploy gate:

# .github/workflows/deploy.yml
- name: Check LLM providers
  env:
    OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
  run: |
    go install github.com/Jwrede/llmprobe@latest
    llmprobe probe --fail-on degraded

This blocks the deploy if any LLM provider is experiencing degraded performance right now.

When a probe fails, the output shows only the failing endpoints:

Failed endpoints (1/4):
  openai/gpt-4o  DEGRADED  TTFT=280ms  Latency=950ms  Tok/s=32.1

MCP server

llmprobe MCP server

llmprobe includes a built-in Model Context Protocol server, allowing Claude Code and other MCP hosts to check LLM API health directly from an agent workflow.

Running the server

llmprobe mcp

This starts the MCP server over stdio.

Registering with Claude Code

claude mcp add --transport stdio llmprobe -- llmprobe mcp

Once registered, Claude Code can call llmprobe tools during any conversation.

Available tools

ToolDescription
probe_allProbe all configured endpoints from probes.yml. Returns TTFT, latency, throughput, and health status for every model. Accepts an optional config parameter for a custom config path.
probe_modelProbe a single model without a config file. Requires provider, model, and api_key_env. Supports optional base_url for OpenAI-compatible endpoints and optional label for display.
list_providersList all providers and models in the config file with their thresholds. Use this to discover available models before probing.
get_configReturn the full parsed configuration including defaults, providers, models, and thresholds.

Example use case: An agent calls list_providers to see what models are configured, then probe_all to verify they are healthy before deploying changes.

Prometheus metrics

Run with --prometheus to expose metrics for scraping:

llmprobe watch --interval 30s --prometheus :9090

Available metrics at /metrics:

MetricTypeLabels
llmprobe_ttft_secondsgaugeprovider, model
llmprobe_latency_secondsgaugeprovider, model
llmprobe_tokens_per_secondgaugeprovider, model
llmprobe_token_countgaugeprovider, model
llmprobe_statusgaugeprovider, model
llmprobe_probes_totalcounterprovider, model
llmprobe_errors_totalcounterprovider, model
llmprobe_ttft_seconds_histhistogramprovider, model
llmprobe_latency_seconds_histhistogramprovider, model
llmprobe_tokens_per_second_histhistogramprovider, model

The llmprobe_status gauge encodes health as: 1 = healthy, 0.5 = degraded, 0 = error. Use this for alerting in Grafana or Alertmanager.

OpenTelemetry metrics

Run with --otel to export probe metrics to an OTLP/gRPC collector.

llmprobe watch --interval 30s --otel localhost:4317

Exported metric names:

MetricDescription
llmprobe.ttft.secondsTime to first token in seconds
llmprobe.latency.secondsTotal request latency in seconds
llmprobe.tokens_per_secondGeneration throughput
llmprobe.token_countOutput token count from the last probe
llmprobe.status1 = healthy, 0.5 = degraded, 0 = error
llmprobe.probes.totalTotal probes executed
llmprobe.errors.totalTotal probe errors

All metrics include provider and model attributes.

Architecture

probes.yml
  -> Config loader (YAML + env var expansion)
    -> Probe engine (concurrent goroutines per provider/model)
      -> Provider clients (raw HTTP + SSE parsing, no SDKs)
        -> Results (TTFT, latency, tokens/sec, status)
          -> Output (table, JSON, JSONL)

Each provider client is a thin HTTP wrapper that sends a streaming request and parses the response. No LLM SDKs are imported. The SSE parser handles both data-only events (OpenAI, Google) and named events (Anthropic). The Bedrock client implements SigV4 signing and AWS binary event stream parsing from scratch.

TTFT is measured from the moment the HTTP request is sent to the first event that contains actual content text (not role assignments or metadata).

Providers

ProviderEndpointAuthStreaming format
OpenAI/v1/chat/completionsAuthorization: BearerSSE, [DONE] sentinel
Anthropic/v1/messagesx-api-key headernamed-event SSE
Google/v1beta/models/{model}:streamGenerateContent?alt=ssekey query paramSSE
Azure OpenAI/openai/deployments/{model}/chat/completionsapi-key headerSSE, [DONE] sentinel
AWS Bedrock/model/{model}/converse-streamSigV4AWS binary event stream
OpenAI-compat/v1/chat/completions (custom base_url)Authorization: BearerSSE

OpenAI-compatible covers: Groq, Together AI, Fireworks, DeepSeek, Mistral, OpenRouter, Ollama, vLLM, and any endpoint that speaks the OpenAI chat completions API.

Roadmap

  • More provider-specific examples for self-hosted OpenAI-compatible endpoints
  • More report formats for long-running monitoring windows
  • Optional runbook templates for common LLM endpoint failures