feat(llm): add LiteLLM as AI gateway provider#1593
Conversation
SummaryClean, well-scoped addition of a LiteLLM provider that closely mirrors the existing Issues🟡
|
|
🟡 call_kwargs = {**self._extra_kwargs, **kwargs} # model lands in call_kwargs
...
response = litellm.embedding(
model=kwargs.pop("model", self._model), # also passed explicitly
**call_kwargs, # duplicate keyword argument → TypeError
)
There's also no test covering |
|
Thanks for the contribution, @RheagalFire! Can you please address the comments from claude bot and fix the failing lint tests and we'll get this in the next release! |
|
🟡
Also: the test file has no test for |
…view items (amd#1626) Closes amd#1625 ## Why this matters After amd#1593 added the LiteLLM provider, `LiteLLMProvider.embed()` crashed with `TypeError: embedding() got multiple values for keyword argument 'model'` the moment a caller overrode the model — `model` was passed both explicitly and inside the spread `**call_kwargs`, and that path had zero test coverage. Now `embed()` works with and without a model override, and the rest of the amd#1593 review is closed out: the provider is documented, the `create_client` docstring lists it, and the redundant `drop_params` handling is collapsed to a single per-call default callers can override. ## Test plan - [x] `pytest tests/unit/test_litellm_provider.py` → 12 passed (incl. 2 new `embed()` tests; the override test reproduced the `TypeError` before the fix) - [x] `util/lint.py --black --isort --flake8` → all PASS - [ ] CI green after maintainer approves the workflow run --------- Co-authored-by: Tomasz Iniewicz <heaters-nays0p@icloud.com>
Summary
Adds LiteLLM as a fourth LLM provider alongside Lemonade, OpenAI, and Claude, giving GAIA users access to 100+ cloud providers (Bedrock, Vertex AI, Groq, DeepSeek, Azure OpenAI, etc.) through a single
create_client("litellm")call.Why
GAIA's
LLMClientabstraction covers local inference (Lemonade) and two cloud providers (OpenAI, Claude). Adding providers individually doesn't scale; LiteLLM is one dependency that covers 100+ providers withdrop_params=Truefor cross-provider kwarg compatibility.Changes
src/gaia/llm/providers/litellm.py-- newLiteLLMProvider(LLMClient)withgenerate(),chat(),embed(), streaming, anddrop_params=Truedefaultsrc/gaia/llm/factory.py-- registered"litellm"in_PROVIDERSsrc/gaia/llm/providers/__init__.py-- exportLiteLLMProvidersetup.py-- added[litellm]optional extra (litellm>=1.35.0,<2.0)tests/unit/test_litellm_provider.py-- 10 unit testsTest plan
python -m pytest tests/unit/test_litellm_provider.py -v-- 10/10 passpython -m pytest tests/unit/test_llm_client_factory.py tests/unit/test_openai_provider.py -v-- existing LLM tests still pass (76 passed)python util/lint.py --all --fix-- cleancreate_client("litellm")-> LiteLLM proxy -> Azure Foundry (Claude Sonnet 4.6):Checklist
Closes #N/Fixes #N/Refs #N).python util/lint.py --all,pytest tests/unit/).