Files
Georgi AtsevandJoão Moura d38ceafb68 feat(llms): add deepinfra as an openai-compatible provider (#7459)
* feat(llms): add deepinfra as an openai-compatible provider

Register deepinfra in the OpenAI-compatible provider registry so
LLM(model="deepinfra/<org>/<model>") routes natively with DEEPINFRA_API_KEY
and no LiteLLM install. Model ids keep their org/model form,
DEEPINFRA_BASE_URL overrides the endpoint, and the docs accordion is added
in en, ar, ko and pt-BR, stating that the provider uses the native OpenAI
client and needs no LiteLLM install.

The model id check requires exactly one slash with both parts non-empty, and
it also runs on the explicit provider="deepinfra" path, where a malformed id
raises a ValueError that shows the expected form.

deepinfra/ model strings previously routed through LiteLLM; is_litellm=True
keeps that path.

* fix(llms): reject malformed deepinfra/ ids before the LiteLLM fallback

A deepinfra/<model> reference that is not org/model fell through to
LiteLLM, so the same bad id failed later and differently depending on
what was installed. The prefixed form now raises the same ValueError as
provider="deepinfra", with the example and the echoed value written the
way the caller wrote the id; both branches share one helper.

---------

Co-authored-by: João Moura <[email protected]>
2026-10-09 05:12:19 -03:00
..