Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

LiteLLM

cetra can trace LiteLLM calls from Python through the OpenInference LiteLLM instrumentation.

Running the LiteLLM Proxy instead? See LiteLLM Proxy.

Terminal window
pip install "cetra-sdk[litellm]" litellm
import litellm
import cetra
cetra.init(instrument=["litellm"])
litellm.completion(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "What is the weather in Paris?"}],
)
cetra.flush()

cetra reads the spans of the OpenInference LiteLLM instrumentation with the OpenInference convention. See Semantic conventions.

  • No captured spans of this instrumentation are in the repository. The only check is an SDK test that imports the instrumentor when the extra is installed. This page does not say which fields a LiteLLM call fills.
  • If a field is missing, look at the span’s Attributes tab and compare it with Span attributes.