← All comparisons

Spanlens vs LiteLLM · 2026

Different jobs. One routes traffic, the other explains it.

Summary

LiteLLM is a gateway and Spanlens is an observability platform, so treating this as a head-to-head is slightly wrong from the start. LiteLLM normalises over a hundred providers, handles retries and fallbacks, and hands logging to a backend you choose. Spanlens is a backend of that kind, with cost attribution, agent traces, evaluation, and anomaly detection built in and no config file to maintain. Plenty of teams end up running both.

At a glance: Spanlens vs LiteLLM (2026)

Side-by-side feature comparison of Spanlens and LiteLLM in 2026.
FeatureSpanlensLiteLLM
Primary jobObservabilityRouting
LicenceMITCustom
Self-hostYesYes
GitHub stars (2026-07-30)1055,038
Providers normalised behind one interface10100+
Usable with no config fileYesNo
One-line baseURL swapYesYes
Model registry to maintainNoYes
OpenTelemetry (OTLP) ingestYesPartial
Built-in request log UIYesPartial
Full request and response bodies storedYesPartial
Per-request USD costYesYes
Dated model variant pricingYesPartial
Cost by prompt versionYesNo
Cost by end user and sessionYesPartial
Requires an external backend to retain logsNoYes
Agent trace waterfallYesNo
Critical path markedYesNo
LLM-as-judge evaluationYesNo
Prompt versioning and A/B with significance testYesNo
Statistical anomaly detectionYesNo
PII and prompt-injection scanningYesNo
Provider fallback and retriesNoYes
Load balancing across deploymentsNoYes
Per-key spend capsPartialYes
Response cachingYesYes

Updated 2026-07-30. Scroll for the grouped view with notes below.

Why teams pick Spanlens over LiteLLM

Observability is the product, not a callback

LiteLLM records what happened by handing it to something else: you register a callback and pick a backend. Spanlens is that backend, with the request log, cost views, traces, evaluation, and anomaly detection as the product itself rather than as configuration you assemble.

Nothing to configure before the first request

LiteLLM wants a config file describing your models, keys, and routing before it is useful, and that file keeps growing. Spanlens needs a base URL and a key, and the provider is inferred from the path, so there is no model registry to maintain.

Cost matched to the exact model version

Providers return dated ids such as gpt-4o-mini-2024-07-18, and a price table that only knows gpt-4o-mini will quietly produce the wrong number. Spanlens matches exact ids first and falls back to the longest boundary-aware prefix, then rolls the result up by prompt version and by end user.

Agent traces with the critical path marked

Spanlens shows a multi-step agent run as a span tree and marks the longest dependency chain, so you know which of five tool calls is actually costing you the wall-clock time. A gateway sees each call separately and cannot reconstruct the shape.

Evaluation and Prompt A/B in the same place as the logs

LLM-as-judge scoring, human annotation with judge-to-human correlation, and traffic-split prompt A/B with a Welch t-test all sit next to the requests they describe. With LiteLLM these are separate tools you wire together.

Logs survive the analytics store going down

Spanlens writes request logs to ClickHouse and, if that write fails, queues the row in Postgres and replays it when ClickHouse recovers. Silent log loss during an outage is the failure mode that makes observability untrustworthy.

Feature-by-feature

What each one is for
Feature
Spanlens
LiteLLM
Primary job
Observability
Routing
Licence
LiteLLM does not use a standard OSI template; read it if licence terms matter to you.
MIT
Custom
Self-host
GitHub stars (2026-07-30)
10
55,038
Providers normalised behind one interface
10
100+
Setup
Feature
Spanlens
LiteLLM
Usable with no config file
One-line baseURL swap
Model registry to maintain
OpenTelemetry (OTLP) ingest
Observability
Feature
Spanlens
LiteLLM
Built-in request log UI
LiteLLM ships a UI; the depth of the log view is not its focus.
Full request and response bodies stored
Per-request USD cost
Dated model variant pricing
Cost by prompt version
Cost by end user and session
Requires an external backend to retain logs
Traces, quality, and safety
Feature
Spanlens
LiteLLM
Agent trace waterfall
Critical path marked
LLM-as-judge evaluation
Prompt versioning and A/B with significance test
Statistical anomaly detection
PII and prompt-injection scanning
Traffic management
Feature
Spanlens
LiteLLM
Provider fallback and retries
Load balancing across deployments
Per-key spend caps
Spanlens enforces monthly plan quotas, not arbitrary per-key budgets.
Response caching

Last updated 2026-07-30 · Spot something inaccurate? Let us know.

When LiteLLM might be the better fit

We don't think every team should pick us. Here's where LiteLLM legitimately wins.

Far and away the larger project

LiteLLM has 55,038 GitHub stars against Spanlens at 10, verified 30 July 2026, and it ships continuously. If community size and breadth of exercised integrations are your main criteria, this is not a close call.

Provider coverage is much wider

LiteLLM normalises well over a hundred providers behind one OpenAI-shaped interface. Spanlens proxies ten. If you are calling something unusual, check the Spanlens list before assuming it is covered.

Routing, fallbacks, and budgets are its job

Retries, provider failover, load balancing, rate limits, and per-key spend caps are core LiteLLM features with years behind them. Spanlens deliberately does not try to be your traffic manager.

They compose well, so this may not be a choice

A common shape is LiteLLM for routing with Spanlens as the observability backend behind it. If you already run LiteLLM, you probably want to add Spanlens rather than replace anything.

Frequently asked questions

Why pick Spanlens over LiteLLM for "Observability is the product, not a callback"?

LiteLLM records what happened by handing it to something else: you register a callback and pick a backend. Spanlens is that backend, with the request log, cost views, traces, evaluation, and anomaly detection as the product itself rather than as configuration you assemble.

Why pick Spanlens over LiteLLM for "Nothing to configure before the first request"?

LiteLLM wants a config file describing your models, keys, and routing before it is useful, and that file keeps growing. Spanlens needs a base URL and a key, and the provider is inferred from the path, so there is no model registry to maintain.

Why pick Spanlens over LiteLLM for "Cost matched to the exact model version"?

Providers return dated ids such as gpt-4o-mini-2024-07-18, and a price table that only knows gpt-4o-mini will quietly produce the wrong number. Spanlens matches exact ids first and falls back to the longest boundary-aware prefix, then rolls the result up by prompt version and by end user.

Why pick Spanlens over LiteLLM for "Agent traces with the critical path marked"?

Spanlens shows a multi-step agent run as a span tree and marks the longest dependency chain, so you know which of five tool calls is actually costing you the wall-clock time. A gateway sees each call separately and cannot reconstruct the shape.

Why pick Spanlens over LiteLLM for "Evaluation and Prompt A/B in the same place as the logs"?

LLM-as-judge scoring, human annotation with judge-to-human correlation, and traffic-split prompt A/B with a Welch t-test all sit next to the requests they describe. With LiteLLM these are separate tools you wire together.

Why pick Spanlens over LiteLLM for "Logs survive the analytics store going down"?

Spanlens writes request logs to ClickHouse and, if that write fails, queues the row in Postgres and replays it when ClickHouse recovers. Silent log loss during an outage is the failure mode that makes observability untrustworthy.

When is LiteLLM a better fit than Spanlens for "Far and away the larger project"?

LiteLLM has 55,038 GitHub stars against Spanlens at 10, verified 30 July 2026, and it ships continuously. If community size and breadth of exercised integrations are your main criteria, this is not a close call.

When is LiteLLM a better fit than Spanlens for "Provider coverage is much wider"?

LiteLLM normalises well over a hundred providers behind one OpenAI-shaped interface. Spanlens proxies ten. If you are calling something unusual, check the Spanlens list before assuming it is covered.

When is LiteLLM a better fit than Spanlens for "Routing, fallbacks, and budgets are its job"?

Retries, provider failover, load balancing, rate limits, and per-key spend caps are core LiteLLM features with years behind them. Spanlens deliberately does not try to be your traffic manager.

When is LiteLLM a better fit than Spanlens for "They compose well, so this may not be a choice"?

A common shape is LiteLLM for routing with Spanlens as the observability backend behind it. If you already run LiteLLM, you probably want to add Spanlens rather than replace anything.

If your problem is routing across many providers with fallbacks, use LiteLLM. If your problem is knowing what each request cost and why a trace was slow, add Spanlens. The two are not mutually exclusive.

Free tier · No credit card · Self-host with Docker