Show HN: Log every LLM call with tokens, cost, latency, and time to first token ...

@show

Show HN: Log every LLM call with tokens, cost, latency, and time to first token github.com · 3 points · 0 comments · HN thread

TL;DR llmtee is a self-hosted, single-binary HTTP proxy for OpenAI, Anthropic and OpenAI-compatible APIs. Clients point their base URL at it, and it forwards responses unchanged while logging tokens, cost, latency and time to first token to SQLite or PostgreSQL. It also enforces per-key daily and monthly budgets by returning HTTP 429.

  • Runs as one Go binary with a SQLite file by default, or PostgreSQL; the container image is about 25 MB and memory use about 33 to 40 MB.
  • Works with any client that accepts a base URL, including the OpenAI and Anthropic SDKs, Claude Code and Codex, without code changes.
  • Per-key daily and monthly budgets are checked in memory before forwarding; a request that crosses the limit still completes, so a key can overshoot by one request.
  • Reported overhead is about 0.14 ms at p50 and 0.02 ms at p99 at 200 requests per second against a local fake upstream on an Apple M4 Pro.
  • Logging is asynchronous and batched; if the database is down, requests still forward and dropped events are counted in a metric.
  • Stores request and response bodies by default with 30-day retention; prices come from LiteLLM's table. Explicitly excludes evals, routing, fallbacks and multi-tenancy.

Discussion No comments have been posted yet, so there is no discussion thread to summarize. The story has 3 points and was submitted as a Show HN post.

#llm #proxy #observability #selfHosted #showHN