skillfed

opentelemetry-instrumentation-litellm

OpenTelemetry LiteLLM instrumentation

opentelemetry-instrumentation-litellm v0.62.3 748.1K downloads/30d#5,166 on PyPI7,377
Permissive license Apache-2.0 Active released

What it is and what it does

This package wraps LiteLLM to emit OpenTelemetry spans and metrics for every LLM call. Because LiteLLM normalizes responses from all providers into a single OpenAI-style format, the instrumentation produces consistent gen_ai.* spans regardless of whether you're calling different providers or custom LLM implementations. By default it logs prompts, completions, and embeddings to span attributes for visibility and debugging; you can disable this via the TRACELOOP_TRACE_CONTENT environment variable if the data is sensitive.

The package depends on opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions-ai, and opentelemetry-semantic-conventions, and requires Python 3.10 or later. It integrates directly into your LiteLLM calls with a single .instrument() call, making it straightforward to add observability to existing LLM applications without rewriting call sites.

Use it for:

  • Debug LLM application behavior by viewing exact prompts and completions in traces alongside latency and error data.
  • Monitor token usage and cost across multiple LLM providers in a unified observability platform.
  • Audit LLM interactions for compliance or quality review by exporting traces to a central collector.
  • Correlate LLM calls with upstream application requests using OpenTelemetry's trace context propagation.
  • Measure and optimize LLM performance across different providers or models using consistent metrics.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds OpenTelemetry tracing to LiteLLM, capturing LLM prompts, completions, and embeddings as spans and metrics across all LLM providers that LiteLLM supports.

Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real problem: getting consistent observability across LiteLLM's multi-provider abstraction. The privacy control via environment variable is a thoughtful addition. Install it if you're using LiteLLM and need tracing; skip it only if you have no observability requirements.

Install

opentelemetry-instrumentation-litellm on PyPI

pip

pip install opentelemetry-instrumentation-litellm

uv

uv add opentelemetry-instrumentation-litellm

poetry

poetry add opentelemetry-instrumentation-litellm

Installing opentelemetry-instrumentation-litellm

Before you install

Low friction: pure Python wheel, four lightweight OpenTelemetry dependencies, active maintenance with a release 4 days ago and no known vulnerabilities.

License in practice

Apache-2.0 is permissive; you can use, modify, and distribute this package freely in commercial or proprietary projects with minimal restrictions.

Quickstart

pip install opentelemetry-instrumentation-litellm

from opentelemetry.instrumentation.litellm import LiteLLMInstrumentor

LiteLLMInstrumentor().instrument()

Requires Python 3.10 or later.

Verify before relying

  • Whether the instrumentation works with all LiteLLM custom providers or only a subset
  • Performance overhead of tracing on high-volume LLM applications
  • Compatibility with specific OpenTelemetry exporters and collectors

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<4,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions-ai, opentelemetry-semantic-conventions
Maintenance actively maintained — 4 days since the last release
Last repo commit
First released
Downloads 748,066/month — #5,166 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: opentelemetry_instrumentation_litellm-0.62.3-py3-none-any.whl

Tags

opentelemetry litellm tracingllm instrumentation monitoringtrace llm prompts completionsopentelemetry ai instrumentationlitellm observability spansgen_ai tracing opentelemetryllm provider tracing
observabilityllm-instrumentationopentelemetry

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-langchain

Adds distributed tracing to Langchain LLM…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-llamaindex

Adds distributed tracing to LlamaIndex…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-openai

Captures traces of OpenAI API calls (prompts,…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-groq

Automatically captures traces of Groq SDK API…

permissive · top 5,000 on PyPI

promptlayer

PromptLayer is a Python SDK for managing,…

permissive · top 15,000 on PyPI

openlit

OpenLIT provides OpenTelemetry-native…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation-ollama

Adds distributed tracing to Ollama Python…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-replicate

Adds OpenTelemetry tracing to Replicate API…

permissive · top 5,000 on PyPI

opentelemetry-semantic-conventions-ai

Provides OpenTelemetry semantic conventions and…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-transformers

Adds distributed tracing to HuggingFace…

permissive · top 5,000 on PyPI

Further reading