LiteLLM
Logfire supports instrumenting calls to the LiteLLM Python SDK with the logfire.instrument_litellm() method.
Install logfire with the litellm extra:
pip install 'logfire[litellm]'
uv add 'logfire[litellm]'
import litellm
import logfire
logfire.configure()
logfire.instrument_litellm()
response = litellm.completion(
model='gpt-5-mini',
messages=[{'role': 'user', 'content': 'Hi'}],
)
print(response.choices[0].message.content)
#> Hello! How can I assist you today?
This creates a span which shows the conversation in the Logfire UI:

logfire.instrument_litellm() uses the LiteLLMInstrumentor().instrument() method of the openinference-instrumentation-litellm package.