Spanlens: Open-Source Platform to Monitor, Trace, and Optimize LLM API Calls
Spanlens is a free, MIT-licensed observability platform designed to help developers monitor API calls made to major LLM providers including OpenAI, Anthropic, Gemini, Mistral, and local Ollama models. Setup requires just one line of code, either by redirecting the client's base URL to the Spanlens proxy or running a CLI wizard that automatically updates existing code. The platform logs every request with details such as token counts, latency, cost, and full prompt and response data, while its dashboard provides cost breakdowns per request, model, and end user. Advanced features include agent workflow visualization, anomaly detection against a 7-day rolling baseline, and real-time alerts via Email, Slack, or Discord. Spanlens also includes a PII and prompt-injection scanner, a cost-saving recommendation engine, prompt versioning with A/B testing, and an LLM-as-judge evaluation framework for scoring model outputs.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in