LiteLLM
“How do we call and control our models?”
- Unified provider interface
- Routing, retries and fallbacks
- Gateway keys and access controls
- Budgets, rate limits and spend tracking
LiteLLM handles model access. Langfuse explains what happened. Promptfoo checks whether the system behaves as expected. OpenTelemetry and OTLP connect their telemetry.
Side-by-side comparisonDirect OTLP exportProduction + evaluation flows“How do we call and control our models?”
“What happened, and why?”
“Does this pass our tests?”
OpenTelemetry (OTel) provides APIs, SDKs and instrumentation to create spans and export telemetry.
OTLP is the protocol that transports that telemetry to a compatible receiver. Here, the diagrams focus on traces over HTTP.
traceparent propagates trace identity between services. OTLP itself does not route model calls, execute tests or manage prompts.Both Mermaid flows are shown below. Solid arrows carry requests and responses; dotted arrows carry telemetry.
Instrument the app for workflow spans and LiteLLM for gateway/model spans.
flowchart TB
A["Your app / agent"] <-->|"Model requests / responses"| L["LiteLLM gateway"]
L <-->|"Provider requests / responses"| M["Model providers"]
A -.->|"App spans · OTLP/HTTP"| F["Langfuse"]
L -.->|"Model spans · OTLP/HTTP"| F
classDef app fill:#f8fafc,stroke:#c7d2e2,color:#172438
classDef lite fill:#eef4ff,stroke:#8aafe8,color:#172438
classDef lang fill:#f5f0ff,stroke:#b79bdc,color:#172438
class A,M app
class L lite
class F lang
Trace continuity: inject and extract traceparent between the app and gateway. Enable supported LiteLLM tracing. Gateway-only tracing covers model requests; app instrumentation adds retrieval, tools and business logic.
Promptfoo exercises the same app path and receives traces through its built-in receiver.
flowchart TB
P["Promptfoo test runner"] <-->|"Test inputs / app outputs"| A["Your app / agent"]
A <-->|"Model requests / responses"| L["LiteLLM gateway"]
L <-->|"Provider requests / responses"| M["Model providers"]
A -.->|"App spans · OTLP/HTTP"| R["Promptfoo built-in trace receiver"]
L -.->|"Model spans · OTLP/HTTP"| R
R -->|"Trace context for grading"| P
classDef app fill:#f8fafc,stroke:#c7d2e2,color:#172438
classDef lite fill:#eef4ff,stroke:#8aafe8,color:#172438
classDef test fill:#edf8f5,stroke:#85beae,color:#172438
class A,M app
class L lite
class P,R test
Enable Promptfoo tracing, start its built-in OTLP receiver and configure app/gateway exporters to reach it. Preserve the test's traceparent. To keep the same spans in Langfuse too, configure a second exporter in each emitting process; a single endpoint setting does not fan out.
Several features appear in more than one tool. Choose by the job you need to complete: serving model traffic, understanding production behavior, or testing a change. These are practical recommendations based on each tool's main workflow.
| Shared area | How the roles differ | Good fit — and why |
|---|---|---|
| Model access & comparison | LiteLLM provides shared model access and routing. Promptfoo runs the same test cases across models or prompts. | LiteLLM for serving: centralize providers and fallbacks. Promptfoo for selection: compare quality on repeatable examples before choosing a model. |
| Usage, cost & latency | LiteLLM tracks gateway spend and applies budgets or limits. Langfuse analyzes usage and timing across instrumented workflows. Promptfoo compares test results. | LiteLLM for spend control: enforce policy in the request path. Langfuse for diagnosis: connect cost and slow steps to real requests. Promptfoo for benchmarks: compare changes under a common test workload. |
| Traces & debugging | LiteLLM emits gateway/model spans. Langfuse stores and explores application traces. Promptfoo connects traces to test cases. | Langfuse for production debugging: inspect nested operations and failures over time. Promptfoo for failing tests: use execution details in trace-aware checks. LiteLLM for gateway visibility: see the model-call portion of the flow. |
| Quality evaluations | Langfuse offers datasets, experiments and scores alongside traces. Promptfoo offers assertions, grading and repeatable evaluation runs. | Langfuse for a production feedback loop: keep quality evidence with observed behavior. Promptfoo for regression checks: turn expected behavior into reproducible pass/fail tests in CI. |
| Prompt iteration | Langfuse centrally stores and versions prompts. Promptfoo evaluates prompt alternatives. | Langfuse for prompt lifecycle: manage versions and deployment labels, and link versions to traces. Promptfoo for choosing wording: test candidate prompts against the same examples. |
| Security & safeguards | LiteLLM applies gateway access controls and can integrate runtime guardrails. Promptfoo generates adversarial tests and security findings. | LiteLLM for runtime policy: control model access at the gateway. Promptfoo for red teaming: probe failure modes and test safeguards with attack scenarios. Use both to enforce and test. |
| OTel / OTLP support | LiteLLM produces traces. Langfuse receives and analyzes them. Promptfoo can receive them during evaluations. | OTLP for interoperability: transport spans in a shared format. Langfuse for ongoing observability; Promptfoo for test-time evidence. Each uses the traces for a different purpose. |
Good when several applications or teams need common provider access, routing, budgets and controls.
Good when you need production traces, prompt versioning and quality analysis tied to real behavior.
Good when you need model comparisons, regression tests or repeatable security testing.
Use all three when you need the full loop: LiteLLM serves model traffic, Langfuse reveals production behavior, and Promptfoo tests improvements before release. A production failure can become a regression test; its trace helps explain why it failed.