Feat/add litellm provider#23
Open
RheagalFire wants to merge 2 commits into
Open
Conversation
Author
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
_call_anthropicand_call_openai, useslitellm.completion()directly withdrop_params=TruePrior art
Changes
core/agents.py- added_call_litellm()method, wired into_call_llm()dispatch, added"litellm"toSUPPORTED_PROVIDERSconfig.yaml- documented litellm as a provider optionrequirements.txt- addedlitellm>=1.60.0,<2.0.0tests/test_litellm_provider.py- 10 unit teststests/e2e_litellm.py- live E2E smoke testTests
1. Unit tests (10/10 passing):
$ PYTHONPATH=. python -m pytest tests/test_litellm_provider.py -v
test_litellm_in_supported_providers PASSED
test_dispatcher_accepts_litellm_provider PASSED
test_call_litellm_dispatches_to_litellm_completion PASSED
test_call_litellm_includes_drop_params_true PASSED
test_call_litellm_passes_api_key_when_set PASSED
test_call_litellm_omits_api_key_when_not_set PASSED
test_call_litellm_passes_base_url_when_set PASSED
test_call_litellm_formats_messages_correctly PASSED
test_call_litellm_falls_back_to_openai_on_import_error PASSED
test_call_llm_routes_to_litellm PASSED
10 passed in 0.04s
2. Live E2E test (Azure Foundry -> Anthropic Claude):
$ PYTHONPATH=. python tests/e2e_litellm.py
Provider: litellm
Model: anthropic/claude-sonnet-4-6
Base URL: https://***-resource.services.ai.azure.com/anthropic
Response: "4"
E2E PASSED - litellm provider works end-to-end
This proves the full chain:
AgentDispatcher._call_litellm()->litellm.completion()-> Azure Foundry -> Anthropic Claude -> response parsed back as string.Example usage
See https://docs.litellm.ai/docs/providers for 100+ supported model strings.
Risk / Compatibility