Description
Spanlens is an open-source LLM observability and monitoring platform designed for developers working with OpenAI, Anthropic, and Gemini models. It provides comprehensive tools to track, analyze, and optimize the performance and cost of AI applications. The platform is available as a hosted SaaS solution or can be self-hosted using a Docker image, offering flexibility for various deployment needs.
Read More
Core functionalities include detailed request logging, capturing every LLM call with information such as model used, tokens, cost, latency, and full request/response bodies. Users can filter, group, and export this data for in-depth analysis. Cost tracking offers per-request breakdowns, daily rollups, and budget alerts to help manage expenditure effectively. For multi-step AI workflows, Spanlens provides agent tracing, visualizing processes as waterfall span trees to identify performance bottlenecks.
Security features are robust, including anomaly detection for latency or cost deviations and PII (Personally Identifiable Information) scanning. PII patterns are flagged for review, and API keys are auto-masked before storage, ensuring sensitive data protection. The platform also offers a model recommender, suggesting cheaper models for specific use cases based on observed call patterns, complete with cost-saving estimates.
Spanlens supports evaluation (Evals) by scoring responses using an LLM-as-judge, enabling developers to compare different prompt versions and models based on quality, cost, and latency. Experimentation and dataset replay capabilities allow for rigorous testing of prompt changes. User analytics provide insights into per-end-user and per-session costs, volume, and errors, helping identify high-budget consumers.
Integration is designed to be straightforward, requiring a simple change to the provider's base URL or using a drop-in SDK. It supports streaming responses and saves request logs asynchronously to minimize latency overhead. Spanlens is compatible with existing OpenTelemetry setups, allowing LLM-specific attributes to be layered on top of standard span data. The platform is built by a small team with a background in production LLM application development and is MIT licensed, ensuring all features are available in both hosted and self-hosted builds.
- CategoryAI DevOps & Cloud Tools
- Pricing ModelFreemium
- DeploymentCloud, Self-hosted
- PlatformsWeb
Spanlens's Core Features
Open-source LLM observability and monitoring
Request logging with model, tokens, cost, latency, and full body
Cost tracking with per-request breakdown and daily rollups
Agent tracing for multi-step workflows as waterfall span trees
Anomaly detection for latency or cost deviations
PII and injection scanning with API key auto-masking
Model recommender for cost optimization with savings estimates
LLM-as-judge evaluations for response quality scoring
Experiments and datasets for replaying prompts across versions and models
User analytics for per-end-user and per-session cost, volume, and errors
Self-hostable with Docker under MIT license
Supports OpenAI, Anthropic, Gemini, Mistral, and Ollama
OpenTelemetry (OTLP/HTTP) ingest and export
Data export in CSV, JSON, or JSONL formats
AES-256-GCM encrypted API key storage
How to use Spanlens?
Integrate: Change your provider baseURL to the Spanlens proxy or use the drop-in SDK.
Capture Data: Spanlens automatically logs requests, costs, latency, and agent traces.
Monitor Performance: View request logs, cost breakdowns, and agent traces in the dashboard.
Optimize Costs: Utilize the model recommender and cost tracking features to identify savings.
Enhance Security: Review PII and injection scan flags in the Security dashboard.
Evaluate Models: Run experiments and use LLM-as-judge evals to compare prompt versions and models.
Spanlens's Use Cases
- Debugging LLM Applications
- Optimizing LLM Costs
- Monitoring AI Performance
- Ensuring Data Security
- A/B Testing Prompts and Models
- Managing Team Workloads
- Tracking Customer Spend
- Compliance for Regulated Workloads







