Skip to main content

OpenTelemetry LiteLLM instrumentation

Project description

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

Project details


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.1.0.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.1.0.tar.gz.

File metadata

  • Download URL: opentelemetry_instrumentation_litellm-0.1.0.tar.gz
  • Upload date:
  • Size: 200.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for opentelemetry_instrumentation_litellm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2e2b9c2b8995711d8a5bc7f4636bf6da2a88680d15e006685bba22b4e9cfe174
MD5 716fa834cbf5035f9388cd84cc136031
BLAKE2b-256 1366599a2cecda1a18d14bc4132f15c9c4fdbc3eed499cf13d0684eeb5ee3ac5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opentelemetry_instrumentation_litellm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for opentelemetry_instrumentation_litellm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98a222451732f85b97656e06adf717564af959b55af88a66c8506fca769d1bfa
MD5 302d39b1f9443a4da7f88ef927cae6df
BLAKE2b-256 beda3fbd3b5cd02dc32d74f766c726f66109070dbf173977a24a7575b4c4111a

See more details on using hashes here.

Supported by

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