--- id: openinference-instrumentation-litellm version: "0.1.37" license: Apache-2.0 license_treatment: permissive maintenance: active --- # openinference-instrumentation-litellm — OpenInference liteLLM Instrumentation License: permissive · Maintenance: active · Downloads: 468.7K/mo ## 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 above — 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 pip install openinference-instrumentation-litellm uv add openinference-instrumentation-litellm 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_current - Install friction: low - Maintenance: active - Downloads: 468.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags litellm tracing instrumentation, opentelemetry litellm monitoring, llm api call tracing, openinference litellm, arize phoenix litellm traces, llm observability instrumentation, openai format api tracing, observability, llm-tracing, opentelemetry [View on SkillFed](https://skillfed.io/packages/openinference-instrumentation-litellm) · [View on PyPI](https://pypi.org/project/openinference-instrumentation-litellm/)