Skip to main content

OpenTelemetry LiteLLM Instrumentation

This library allows tracing LLM prompts and completions sent with LiteLLM. Because LiteLLM normalizes every provider's reply into an OpenAI-style ModelResponse — including custom providers registered via litellm.CustomLLM — a single set of wrappers produces consistent gen_ai.* spans and metrics across all back-ends.

Installation

pip install opentelemetry-instrumentation-litellm

Example usage

from opentelemetry.instrumentation.litellm import LiteLLMInstrumentor

LiteLLMInstrumentor().instrument()

Privacy

By default, this instrumentation logs prompts, completions, and embeddings to span attributes. This gives you a clear visibility into how your LLM application is working, and can make it easy to debug and evaluate the quality of the outputs.

However, you may want to disable this logging for privacy reasons, as they may contain highly sensitive data from your users. You may also simply want to reduce the size of your traces.

To disable logging, set the TRACELOOP_TRACE_CONTENT environment variable to false.

TRACELOOP_TRACE_CONTENT=false

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opentelemetry_instrumentation_litellm-0.62.3.tar.gz (200.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file opentelemetry_instrumentation_litellm-0.62.3.tar.gz.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_litellm-0.62.3.tar.gz
Algorithm Hash digest
SHA256 b483633167fb50a201bfb5cd7196d7ec2d1965d6f566c02810af9d456dff3ad7
MD5 d918847a3ced45239bf4dc3d59ca0403
BLAKE2b-256 e3739a5ee3d6dea1aba60785b23c9d0023e00e43b0b36e22a93a985986cf743c

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentelemetry_instrumentation_litellm-0.62.3.tar.gz:

Publisher: release.yml on traceloop/openllmetry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opentelemetry_instrumentation_litellm-0.62.3-py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_litellm-0.62.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6a756a2b790da59df65b75b13b56e677b94f9ca9c8724708c65ef98583f8f3e2
MD5 2110b77b1c992deb1cf73e4a51ac0b93
BLAKE2b-256 9a4cfa25f21686abf0885a4c751c1e706f1aa87c76c7705c78c2f27b6dc52203

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentelemetry_instrumentation_litellm-0.62.3-py3-none-any.whl:

Publisher: release.yml on traceloop/openllmetry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page