mirror of
https://github.com/usestrix/strix.git
synced 2026-08-16 01:16:40 +02:00
LiteLLM's per-provider branches (deepseek, anthropic, groq, etc.) don't consult ``litellm.api_key`` (the module global Strix sets). They only check the per-call ``api_key`` kwarg and the ``<PROVIDER>_API_KEY`` env var. The SDK's LitellmModel passes ``api_key=None`` by default, so requests went out with an empty bearer and DeepSeek (and friends) returned 401. Mirror the user's LLM_API_KEY into the provider-specific env var (``DEEPSEEK_API_KEY`` for ``deepseek/...``, ``ANTHROPIC_API_KEY`` for ``anthropic/...``, etc.) using LiteLLM's documented convention. ``os.environ.setdefault`` is used so an explicit user env is never clobbered. The OpenAI branch was already working via ``set_default_openai_key`` + the existing ``litellm.api_key`` global fallback. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>