OpenLIT — OpenTelemetry LLM Observability
Monitor LLM costs, latency, and quality with OpenTelemetry-native tracing. GPU monitoring and guardrails built in. 2.3K+ stars.
Instalación lista para agent
Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.
npx -y tokrepo@latest install 13e3c714-032f-4323-b9ee-69f38e613f45 --target codexEjecutar después de confirmar el plan con dry-run.
What it is
OpenLIT is an open-source observability platform built on OpenTelemetry that monitors LLM application costs, latency, and output quality. With a single line of code, it auto-instruments calls to OpenAI, Anthropic, Google, and other LLM providers. It also provides GPU monitoring and built-in guardrails for content safety.
It targets AI engineers and platform teams who want standardized observability for LLM applications using the OpenTelemetry ecosystem they already know.
How it saves time or tokens
OpenLIT's one-line setup eliminates the boilerplate of manually instrumenting every LLM call. By surfacing cost breakdowns per model, endpoint, and user, it identifies where tokens are being wasted. The latency tracking helps optimize slow requests, and the quality monitoring catches degraded outputs before users notice. All data flows through standard OpenTelemetry pipelines, so it integrates with existing observability stacks (Grafana, Jaeger, Datadog).
How to use
- Install and initialize:
pip install openlit
- Add one line to instrument all LLM calls:
import openlit
openlit.init()
# Now use any LLM library as usual
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model='gpt-4o',
messages=[{'role': 'user', 'content': 'Hello'}]
)
# OpenLIT automatically traces this call
- View traces in the OpenLIT dashboard or export to any OpenTelemetry-compatible backend.
Example
import openlit
from openai import OpenAI
from anthropic import Anthropic
# Initialize once at startup
openlit.init()
# All LLM calls are automatically traced
oai = OpenAI()
ant = Anthropic()
# OpenAI call -- traced with cost, latency, tokens
oai_response = oai.chat.completions.create(
model='gpt-4o',
messages=[{'role': 'user', 'content': 'Summarize this article'}]
)
# Anthropic call -- also traced automatically
ant_response = ant.messages.create(
model='claude-sonnet-4-20250514',
max_tokens=1024,
messages=[{'role': 'user', 'content': 'Summarize this article'}]
)
# Compare costs and latency in the OpenLIT dashboard
Related on TokRepo
- AI gateway tools -- Langfuse and other LLM observability platforms
- AI tools for monitoring -- Monitoring and observability tools
Common pitfalls
- OpenLIT auto-instruments supported libraries. If you use a niche LLM provider without a supported SDK, you need manual instrumentation via OpenTelemetry spans.
- The built-in dashboard requires Docker to run. For teams already using Grafana or Datadog, export traces via OTLP instead of running a separate dashboard.
- GPU monitoring requires additional system-level permissions. Ensure the process has access to nvidia-smi or equivalent GPU metrics endpoints.
Preguntas frecuentes
OpenLIT auto-instruments OpenAI, Anthropic, Google (Gemini), Mistral, Cohere, Bedrock, and several other providers. It also supports vector databases like Pinecone, Chroma, and Qdrant. The instrumentation hooks into the provider SDK, so no code changes are needed beyond the init() call.
Both provide LLM observability. OpenLIT is built on OpenTelemetry, making it compatible with any OTLP-compatible backend (Grafana, Jaeger, Datadog). Langfuse is a standalone platform with its own backend. Choose OpenLIT if you want to integrate LLM monitoring into an existing OpenTelemetry stack.
Yes. OpenLIT exports data via OpenTelemetry Protocol (OTLP). You can send traces, metrics, and logs to Grafana, Jaeger, Datadog, New Relic, or any OTLP-compatible backend. This avoids adding yet another monitoring dashboard to your stack.
Yes. OpenLIT automatically calculates costs based on token usage and model pricing. It breaks down costs per model, per endpoint, and per user. This helps identify expensive queries and optimize token usage across your application.
OpenLIT includes built-in guardrails that check LLM outputs for content safety issues. You can configure rules to detect PII, toxic content, or off-topic responses. Guardrails run as part of the tracing pipeline and flag issues in the dashboard without blocking the response.
Referencias (3)
- OpenLIT GitHub Repository— OpenLIT provides OpenTelemetry-native LLM observability
- OpenLIT Documentation— OpenLIT supports auto-instrumentation for major LLM providers
- OpenTelemetry Documentation— OpenTelemetry is the standard for observability data collection
Relacionados en TokRepo
Fuente y agradecimientos
Discusión
Activos relacionados
Phoenix — Open Source AI Observability
Phoenix is an AI observability platform for tracing, evaluating, and debugging LLM apps. 9.1K+ stars. OpenTelemetry, evals, prompt management.
APO — LLM-Powered Observability Workflows
APO (AutoPilot Observability) combines OpenTelemetry and eBPF with agentic workflows to triage alerts and find root causes with verifiable charts.
openllmetry-js — OpenTelemetry for LLM Apps
Add OpenTelemetry traces to Node.js LLM apps with OpenLLMetry JS so you can debug latency, tool calls, and RAG steps. Works with a standard OTEL backend.
Logfire — Python Observability on OpenTelemetry
Logfire is Pydantic’s Python SDK for traces/metrics/logs on OpenTelemetry, helping teams add observability with minimal code and query data with SQL.