Skip to content

[FEATURE] Support DeepInfra as a native OpenAI-compatible LLM provider #7455

Description

@ats3v

Feature Area

Integration with external tools

Is your feature request related to a an existing bug? Please link it here.

N/A

Describe the solution you'd like

Add DeepInfra as native openai compatible provider, same way as openrouter, deepseek, cerebras and dashscope are in OPENAI_COMPATIBLE_PROVIDERS. Right now LLM(model="deepinfra/...") goes to LiteLLM and without crewai[litellm] installed it fails with ImportError. It should just work with DEEPINFRA_API_KEY set:

llm = LLM(model="deepinfra/deepseek-ai/DeepSeek-V4-Flash-0731")

Base URL is https://api.deepinfra.com/v1/openai, the key is DEEPINFRA_API_KEY (same name LiteLLM already uses), DEEPINFRA_BASE_URL for override. Our model ids are org/model, so the full reference have three segments - the routing must keep the part after deepinfra/ as is.

Nothing is needed on the transport side. We tested tool calling, streaming, structured outputs and usage reporting with custom_openai=True against our API and all works. The change is one registry entry, few lines in llm.py, tests and the docs accordion in en/ar/ko/pt-BR - same shape as #5042 and the Eden AI PR #7049.

We (DeepInfra) maintain the API and will maintain the integration. PR is ready, I will open it linked to this issue.

Describe alternatives you've considered

custom_openai=True with base_url - works today, but users must know the URL and can't use deepinfra/ prefix in agents.yaml. LiteLLM - extra dependency, and crewAI is moving away from it.

Additional context

Follow-ups after this one, as separate PRs: DeepInfra embeddings provider (like the openrouter one in #7127) and DeepInfra in the CLI provider picker.

Willingness to Contribute

Yes, I'd be happy to submit a pull request

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestNew feature or requestvendor-pitchThird-party vendor or SDK pitch, not a CrewAI bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions