Repository navigation
Add experimental logfire.instrument_litellm() - #1237
Merged
Merged
Conversation
Deploying logfire-docs with
|
| Latest commit: |
43a5204
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1cbec5cd.logfire-docs.pages.dev |
| Branch Preview URL: | https://alex-litellm.logfire-docs.pages.dev |
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds support for instrumenting the LiteLLM client through Logfire.
- Introduces a new
instrument_litellmAPI method and integration - Updates the span processor to transform LiteLLM spans and guess model systems
- Adds end-to-end tests and VCR cassettes for the new integration
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_logfire_api.py | Adds tests for the new instrument_litellm API |
| tests/otel_integrations/test_litellm.py | New integration test covering LiteLLM span enrichment |
| tests/otel_integrations/cassettes/...yaml | VCR cassette for LiteLLM API interactions |
| pyproject.toml | Adds openinference-instrumentation-litellm, litellm to dev deps |
| logfire/_internal/main.py | Exposes instrument_litellm on the main client |
| logfire/_internal/integrations/litellm.py | Implements the LiteLLM instrumentor wrapper |
| logfire/_internal/exporters/processor_wrapper.py | Transforms LiteLLM spans and implements guess_system |
| logfire/init.py | Exports instrument_litellm at package level |
| logfire-api/logfire_api/init.py | Exposes instrument_litellm in the API wrapper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.