feat(llm): add LiteLLM provider — enum, client, tests, QA follow-ups

- Add LITELLM = "litellm" to LLMProviderType enum (already in HEAD from prev commit)
- Add comment in LLMClient.__init__ explaining standard Bearer auth for LiteLLM
- Add regression test test_provider_type_enum_values — guard against value drift
- Add test_litellm_client_uses_default_bearer_auth — verify no extra headers
- Clean up duplicate @RELATION lines in models.py
- All 20 backend + 4 frontend tests pass
This commit is contained in:
2026-05-15 22:11:55 +03:00
parent 27168664b8
commit e754efc7bd
4 changed files with 47 additions and 2 deletions

View File

@@ -711,6 +711,9 @@ class LLMClient:
if self.provider_type == LLMProviderType.KILO:
default_headers["Authentication"] = f"Bearer {self.api_key}"
default_headers["X-API-Key"] = self.api_key
# LiteLLM proxy uses standard OpenAI-compatible Bearer auth — no special headers needed.
# It routes to upstream providers transparently, and the default Authorization header
# is sufficient. No additional headers like HTTP-Referer or X-API-Key are required.
http_client = httpx.AsyncClient(headers=default_headers, timeout=120.0)
self.client = AsyncOpenAI(