skillfed

openinference-instrumentation-litellm

OpenInference liteLLM Instrumentation

openinference-instrumentation-litellm v0.1.37 468.7K downloads/30d#6,492 on PyPI1,147
Permissive license Apache-2.0 Active released

What it is and what it does

This package wraps LiteLLM's core functions—completion, embedding, image generation, and Anthropic API calls—to automatically emit structured OpenTelemetry spans. It lets you see detailed traces of every LLM API call your application makes, including inputs, outputs, latency, and errors, without modifying your LiteLLM code.

You install it, instantiate LiteLLMInstrumentor, point it at a TracerProvider connected to an OpenTelemetry collector (like Arize Phoenix), and call instrument(). From that moment on, all instrumented LiteLLM functions emit traces. The package depends on opentelemetry-sdk, opentelemetry-instrumentation, and openinference-instrumentation to handle the tracing plumbing, and uses wrapt to hook into LiteLLM's function calls.

Use it for:

  • Debug LLM application behavior by viewing detailed traces of completion calls, embeddings, and image generation in Arize Phoenix or similar collectors.
  • Monitor production LLM services to track latency, error rates, and API usage across multiple LLM providers via OpenTelemetry exporters.
  • Correlate LLM calls with application-level traces to understand end-to-end request flow in complex systems.
  • Audit and log all LLM API interactions for compliance or troubleshooting without modifying existing LiteLLM code.
  • Analyze Anthropic API call patterns and performance when using LiteLLM's Anthropic wrapper methods.

Worth the install?

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

Auto-instruments LiteLLM function calls (completion, embedding, image generation, and Anthropic API methods) to emit OpenTelemetry-compatible traces for observability in tools like Arize Phoenix.

Yes, if you use LiteLLM and need observability. The package is actively maintained, has no known vulnerabilities, installs cleanly with low friction, and is Apache-licensed. It solves a real problem—seeing what your LLM calls are actually doing—with minimal code changes. Install it alongside an OpenTelemetry collector (Phoenix, AX, or your own) to get immediate tracing.

Install

openinference-instrumentation-litellm on PyPI

pip

pip install openinference-instrumentation-litellm

uv

uv add openinference-instrumentation-litellm

poetry

poetry add openinference-instrumentation-litellm

Installing openinference-instrumentation-litellm

Before you install

Low friction: pure Python wheel with seven runtime dependencies, all standard observability libraries (opentelemetry-sdk, opentelemetry-instrumentation, openinference packages). Active maintenance with a release 2 days old and no known vulnerabilities.

License in practice

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

Quickstart

pip install openinference-instrumentation-litellm

from openinference.instrumentation.litellm import LiteLLMInstrumentor
from opentelemetry.sdk.trace import TracerProvider

tracer_provider = TracerProvider()
LiteLLMInstrumentor().instrument(tracer_provider=tracer_provider)

Requires Python 3.10 or later; LiteLLM and an OpenTelemetry exporter (e.g., Arize Phoenix) must be installed separately to actually collect and view traces.

Verify before relying

  • Whether instrumentation overhead is negligible for high-volume LLM call scenarios.
  • Support status for LiteLLM Proxy beyond the documented 100+ LLMs.
  • Compatibility with custom LiteLLM provider implementations.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<3.15,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 7 — openinference-instrumentation, openinference-semantic-conventions, opentelemetry-api, opentelemetry-instrumentation, opentelemetry-sdk, setuptools, wrapt
Maintenance actively maintained — 2 days since the last release
Last repo commit
First released
Downloads 468,654/month — #6,492 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: openinference_instrumentation_litellm-0.1.37-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

litellm tracing instrumentationopentelemetry litellm monitoringllm api call tracingopeninference litellmarize phoenix litellm tracesllm observability instrumentationopenai format api tracing
observabilityllm-tracingopentelemetry

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

openinference-instrumentation-google-genai

Automatically instruments Google GenAI SDK…

permissive · top 15,000 on PyPI

openinference-instrumentation-llama-index

Auto-instruments LlamaIndex applications to…

permissive · top 15,000 on PyPI

arize

Arize is a Python client library for…

permissive · top 5,000 on PyPI

openinference-instrumentation-anthropic

Automatically captures and exports traces from…

permissive · top 15,000 on PyPI

openinference-instrumentation-haystack

Auto-instruments Haystack LLM pipelines and…

permissive · top 15,000 on PyPI

openinference-instrumentation-openai

Auto-instruments OpenAI Python SDK calls to…

permissive · top 5,000 on PyPI

openinference-semantic-conventions

Defines semantic conventions and standardized…

permissive · top 5,000 on PyPI

arize-otel

Wraps OpenTelemetry with Arize-aware defaults…

permissive · top 15,000 on PyPI

arize-phoenix

Phoenix is an open-source AI observability…

unclear · top 5,000 on PyPI

openinference-instrumentation-agno

Auto-instruments Agno Agent applications to…

permissive · top 15,000 on PyPI