Repository navigation
feat(cli): add deepinfra to the provider picker and model catalog - #9316
Georgi Atsev (ats3v) wants to merge 2 commits into
Conversation
Strix Security ReviewWarning This pull request has 74 commits after the last Strix review ( ✅ No open security findings. PR summary: Adds DeepInfra to the classic `crewai create` picker and the JSON crew wizard with four curated models, and extends the wizard's live model catalog to fetch DeepInfra's public model list, plus the `DEEPINFRA_API_KEY` hint for deploy validation. Review summaryThis PR registers DeepInfra in both CLI provider pickers and adds a keyless live fetch of DeepInfra's public model catalog, with non-chat entries filtered by tag and fallback to the curated list. The new fetch uses a hardcoded, TLS-verified HTTPS URL, sends no credentials, is bounded by the module's timeout, and its results are cached; picked model ids are only ever written as text into JSON-escaped config and an Ruled out (2)
Review 1 on this PR · Reviewed by Strix |
iris-clawd
left a comment
There was a problem hiding this comment.
I could not confirm the minimum released runtime version.
The notes inline on model_catalog.py and test_model_catalog.py are what I'd want addressed before this merges.
Someone else should sign off on this too: the change expands the user-visible CLI provider contract and establishes a new default model for --provider deepinfra, which is persisted into generated project configuration.
a92f209 to
becdc64
Compare
Offer DeepInfra in crewai create, fetch live models from DeepInfra's public catalog ranked for CrewAI without an API key, keep only chat-tagged entries, and recognise DEEPINFRA_API_KEY in deploy validation.
An empty or fully filtered DeepInfra catalog was treated like a reachable Ollama with nothing installed, so the wizard dropped the curated models and asked for a model id. The hosted models stay usable, so the fetch now raises and the picker falls back to the curated list.
becdc64 to
41b4502
Compare
|
João Moura (@joaomdmoura) could you re-run the review gate here? Its notes are addressed: an empty catalog now falls back to the curated models, with tests for it. CI is green. The gate also asked for a second sign-off. Thanks! |
Related issue
Relates to #7455 (closed by #7459, which listed the CLI provider picker as a follow-up).
Summary
Offer DeepInfra in
crewai create, in both the classic picker and the JSON crew wizard. crewAI already runsdeepinfra/<org>/<model>natively (#7459) and the CLI already knowsDEEPINFRA_API_KEY(#9232), so this adds the provider and its models to the lists people pick from.constants.py):deepinfrajoinsPROVIDERS, with four models inMODELS. ItsENV_VARSentry moves out of the "not offered by the classic picker" group, unchanged.create_json_crew.py): DeepInfra joins_PROVIDERSwith the same four models as its curated list, so--provider deepinfraresolves todeepinfra/deepseek-ai/DeepSeek-V4.1-Flash.model_catalog.py): the wizard's picker reads DeepInfra's model list, as it does for OpenAI, Anthropic, Gemini, Groq, Cerebras and Ollama.GET https://api.deepinfra.com/v1/openai/models?filter=with_meta&sort_by=crewaiis public, so it works without a key, and returns the catalog in the order DeepInfra ranks it for crewAI. Entries not taggedchat(embeddings, image, speech, video) are dropped and the order is kept. Any failure, or a catalog with no chat model, falls back to the curated list, as for every other vendor.deploy/validate.py):DEEPINFRA_API_KEYjoins_KNOWN_API_KEY_HINTS, so validation warns when a project references the key but.envdoes not set it, and names DeepInfra in its missing-key warning.No extra is needed: DeepInfra is one of crewAI's native OpenAI-compatible providers, so a project created with it depends on
crewai[tools]alone.The curated list is the first four chat models of that catalog on 2026-11-10:
deepseek-ai/DeepSeek-V4.1-Flash,zai-org/GLM-5.3-Flash,deepseek-ai/DeepSeek-V4-Pro-0813andzai-org/GLM-5.3. The first is small and generally available, as the default has to be.Verification
Tests added or updated for the changed behavior
Relevant tests and quality checks pass locally
uv run pytest lib/cli/tests -q- 2246 passed, afteruv sync --all-groups --all-extras. No test reaches DeepInfra's catalog: each one that lists DeepInfra models replaces the fetch.New tests: the catalog order is kept and non-chat entries are dropped by tag, with the id heuristic for untagged entries, curated labels win, and an empty or fully filtered catalog falls back to the curated list (
test_model_catalog.py); both pickers offer DeepInfra and--provider deepinfratakes the first listed model (test_constants.py); a model picked in the wizard readsdeepinfra/<org>/<model>(test_create_crew.py).Updated tests: the providers that need no extra, and the
--providererror message that lists the wizard's providers. The existing invariants now cover DeepInfra too: the same models in both pickers, a curated list for every provider, and the extras crewAI needs for each listed model.uv run ruff check,uv run ruff format --checkanduv run mypyon the four changed source files - cleanlive against api.deepinfra.com:
LLM(model="deepinfra/...")CREWAI_DMN=true crewai create crew json_demo --provider deepinfrawrites"llm": "deepinfra/deepseek-ai/DeepSeek-V4.1-Flash", depends oncrewai[tools]and printsSet DEEPINFRA_API_KEY in .env before `crewai run`crewai create crew classic_demo --classiclists13. deepinfraand its four models, savesMODEL=deepinfra/deepseek-ai/DeepSeek-V4.1-Flashand namesDEEPINFRA_API_KEYwhen the key prompt is skippedbranch rebased on current
mainAdditional context
The live list follows #6462: the interactive picker shows the vendor's current models, while
--provider deepinfraand the classic picker stay on the hardcoded list.DeepInfra's catalog needs no key, so the wizard fetches it whenever DeepInfra is picked, as it does for a local Ollama. The request carries no credentials, uses the catalog module's 6 s timeout and is cached for five minutes.
Docs are unchanged. The "most popular LLM providers" list in
docs/edge/en/concepts/cli.mdxnames five of the picker's providers as examples, so DeepInfra is not added there.We (DeepInfra) maintain the API, the
sort_by=crewaiordering and this integration. This is the last follow-up from #7455; the embeddings provider is in #7993.The code was written with AI assistance (Claude Code), so per CONTRIBUTING the
llm-generatedlabel applies - I can't set labels on this repo, please add it.Note
Low Risk
CLI-only provider listing and optional HTTP catalog fetch; no auth or core runtime changes beyond new picker entries and env hints.
Overview
Adds DeepInfra as a first-class option in both
crewai createflows: the classic provider list and the JSON crew wizard now includedeepinfrawith a shared curated model set (deepinfra/org/modelids),DEEPINFRA_API_KEYenv prompting, and no extra beyondcrewai[tools].The wizard’s live model picker now pulls DeepInfra’s public catalog (
sort_by=crewai), keeps server ordering, drops non-chatentries via metadata tags, and falls back to the curated list when the fetch fails or has no chat models.Deploy validation recognizes
DEEPINFRA_API_KEYin missing-key warnings. Tests cover picker parity, catalog filtering/order, and wizard model id formatting.Reviewed by Cursor Bugbot for commit a92f209. Bugbot is set up for automated code reviews on this repo. Configure here.