Repository navigation
Add LiteLLM provider integration - #9
Merged
Merged
Conversation
Patches litellm.completion and litellm.acompletion (sync/async, including streaming) to create OTel spans with correct per-provider attribution via LiteLLM's custom_llm_provider. A single patch_litellm() covers all 100+ providers that LiteLLM supports. Uses a contextvars.ContextVar to prevent double-counted spans when both patch_litellm() and patch_openai()/patch_anthropic() are active — the LiteLLM patch wins and inner provider patches skip span creation. Includes 9 unit tests, example agent, and doc updates. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
4 tasks done
anilmurty
added a commit
that referenced
this pull request
Jun 19, 2026
…#10,#13) Smoke-test playbook (tests/manual-new-release-tests.md): - #3 (and #8/#9/#11/#12/#14/#16 — same root cause): code blocks are now command-only; the inline "# comments" and "# [ ]" checklists that the markdown copy button was pulling into copied commands moved to prose / "- [ ]" lists around each block. Added a note explaining the convention. - #10: corrected the Section 4 trim expectation — with [capture] prompts=false (default), trim checks the capture prereq first and prints the capture hint, NOT the tokenjam[bloat] install hint (only reachable once capture is on). - #13: export file is "claude-code-<date>.jsonc", not ".json". Doc-only; no code changes. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Summary
patch_litellm()integration that wrapslitellm.completionandlitellm.acompletion(sync + async, including streaming) to create OTel spans with correct per-provider attributioncontextvars.ContextVarto prevent double-counted spans when bothpatch_litellm()andpatch_openai()/patch_anthropic()are active — LiteLLM patch wins, inner provider patches skip span creationlitellmoptional dependency inpyproject.tomlexamples/single_provider/litellm_agent.py), and doc updates to README.md, examples/README.md, and CLAUDE.mdTest plan
custom_llm_providerand model prefix fallback), sync/async streaming, error handling, uninstall, context var suppressionruff checkclean🤖 Generated with Claude Code