Skip to content

feat: add Infer to the built-in provider catalog - #5117

Open
tarunspandit wants to merge 3 commits into
docker:mainfrom
tarunspandit:add-infer-provider
Open

tarunspandit wants to merge 3 commits into
docker:mainfrom
tarunspandit:add-infer-provider

Conversation

@tarunspandit

@tarunspandit tarunspandit commented Dec 3, 2026 •

Copy link
Copy Markdown

Summary

Adds Infer to the embedded provider catalog, following the contributor guide and the shape of #5075 (Morse) and #5008 (Straitly):

  • pkg/model/provider/catalog/providers.json: an infer entry using the existing OpenAI implementation (api_type: openai, base URL https://infer.flow7.org/v1, INFER_API_KEY, default model infer/claude-opus-5-5:low-cost). It sits after uncensoredlabs, so it ranks low for automatic selection. It does not opt into merge_consecutive_messages; I haven't run the message-merging probe against Infer, so the entry keeps the default, and the merge gating test records false.
  • Tests: a row in openAIAliasProviders (hermetic request test, plus the opt-in live test behind DOCKER_AGENT_RUN_INFER_LIVE_TEST), rows in the auto-selection tables, and a shouldMergeConsecutiveMessages row. Unlike Morse and Straitly, Infer is already in the models.dev snapshot as infer, so no models.dev exemptions are added: TestProviderIDsMatchEmbeddedCatalog, TestDefaultModelsExistInModelsDev and TestParseExamples resolve the provider ID, the default model and the example against the snapshot.
  • Docs: a provider page, a nav entry, a row in the provider credentials table, and an examples/infer.yaml recipe.
  • Video (review follow-up): models.dev lists video input for some Infer Gemini models, but Docker Agent's Chat Completions conversion has no video part. A new catalog field, unsupported_input_modalities, lists video for Infer, and applyCatalogMetadata, which every picker path goes through, leaves it out of model choices. Attachment handling is unchanged; the provider page's Attachments section documents the limitation.

Infer serves models from Anthropic, OpenAI, Google, xAI and others through an OpenAI-compatible API. Each model has up to four routes, picked by the suffix of the model ID: :low-cost, :balanced, :stable or :official. In Infer's public catalog on 2026-12-03, the Low cost routes of the models named in this PR (Claude Opus 5.5 and Sonnet 5.5, GPT-6.2 Sol, Grok 4.7) were priced below each lab's list price.

Infer's model IDs start with infer/ (infer/claude-opus-5-5:low-cost), as /v1/models and models.dev list them. The inline reference is therefore infer/infer/claude-opus-5-5:low-cost, while a named model uses the ID unchanged; the provider page shows both. The models.dev lookup uses the same ID, so prices, context limits and input types come from models.dev, except video (see above).

Because infer is in models.dev, docker agent models --provider infer and the model picker list the Infer rows that models.dev carries (10 today, two of them Gemini). No live /v1/models discovery is added: infer is not in liveFetchProviders, and Infer's /v1/models needs a key.

Reasoning and tool calls

Infer's docs say a thinking model's reasoning_details record has to be sent back to keep its reasoning across tool calls. Docker Agent's Chat Completions client replays reasoning as reasoning_content text, so that record isn't sent back. Docker Agent also sends no thinking settings for Claude models through an OpenAI-compatible alias (thinking_budget only logs that it has no effect), so requests for the default model and the examples, all Claude, ask for no thinking. Without that record, a streamed tool call round trip still completed on the default route and on two Gemini routes (see Testing); the provider page records this and keeps the note that reasoning isn't carried over.

Testing

Based on main at 41ff78b, Go 1.27.4, darwin/arm64, in a scrubbed environment (only .env.test, no provider keys):

  • gofmt -l pkg cmd: clean. go build ./...: ok. go vet on the three touched Go packages: ok.
  • go test -count=1 ./pkg/model/provider/... ./pkg/config/... ./pkg/runtime/modelcatalog/... ./pkg/modelsdev/... ./cmd/... ./pkg/hooks/... ./pkg/teamloader/...: pass (43 packages). Without the last two patterns, the same command also passes on the clean base.
  • go run ./lint .: no offenses. go mod tidy --diff: clean.
  • scripts/docs-check-canonical.sh and scripts/docs-check-community-links.sh: OK.
  • Not run for that commit: golangci-lint, markdownlint-cli2, the Hugo build, the opt-in live test, the message-merging probe, and any request to Infer.

Review follow-up (0becfb5, 606ebf2), same base, no provider keys in the environment:

  • go test -count=1 ./pkg/model/provider/... ./pkg/config/... ./pkg/runtime/... ./cmd/root/... ./pkg/modelinfo/... ./pkg/server/...: pass. The new modelcatalog test fails without the fix.
  • go run ./lint .: no offenses. golangci-lint v2.14.0 on the two touched Go packages: 0 issues.
  • markdownlint-cli2 0.22.1 on the provider page: 0 errors. scripts/docs-check-canonical.sh and scripts/docs-check-community-links.sh: OK.
  • Live: the CLI built from 0becfb5 ran in --exec mode with the filesystem toolset limited to list_directory, on a directory holding one randomly named file. The answer can only name that file if the tool result went back in a second streamed request, and it did with infer/claude-opus-5-5:low-cost, infer/gemini-3.1-pro-preview:official (which streamed reasoning before its call) and infer/gemini-3.8-flash:low-cost.
  • Not run: the Hugo build, the opt-in alias live test and the message-merging probe.

Disclosure

Disclosure: opened by the Infer team. Written with AI assistance (Claude Code). The commits are signed with an SSH key registered on this account and carry a DCO sign-off.

🤖 Generated with Claude Code

Infer is an OpenAI-compatible API with up to four routes per model,
picked by the model ID suffix (:low-cost, :balanced, :stable, :official).
The catalog entry uses the existing OpenAI implementation with base URL
https://infer.flow7.org/v1, INFER_API_KEY and the default model
infer/claude-opus-5-5:low-cost. Infer is already in the models.dev
snapshot, so the provider ID, the default model and the example resolve
against it without exemptions. merge_consecutive_messages stays unset
because the message-merging probe was not run.

Tests cover the alias request (with an opt-in live test behind
DOCKER_AGENT_RUN_INFER_LIVE_TEST), automatic selection and the merge
gating. Docs add a provider page, a nav entry, the credentials row and
an examples/infer.yaml recipe.

Signed-off-by: Infer by Flow7 <tarun@flow7.org>
@tarunspandit
tarunspandit requested a review from a team as a code owner December 3, 2026 22:27
@aheritier aheritier added area/config For configuration parsing, YAML, environment variables area/docs Documentation changes area/providers For features/issues/fixes related to LLM providers (Bedrock, LiteLLM, Qwen, custom, etc.) area/testing Test infrastructure, CI/CD, test runners, evaluation kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Dec 3, 2026

@aheritier aheritier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One blocker: the model picker advertises video input for an Infer model, but Docker Agent drops the attachment before sending the request.

Open questions: Can you confirm a streamed tool-call round trip on the default Claude route and on an advertised Gemini route? The alias tests send no tools, and the client does not replay Infer's reasoning_details on the follow-up request.

]
},
{
"name": "infer",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[blocking] Registering Infer exposes infer/gemini-3.1-pro-preview:official in the model picker with video input from the embedded snapshot (pkg/runtime/modelcatalog/catalog.go:381–396,455). But the Chat Completions converter drops inline video/* attachments (pkg/model/provider/oaistream/attachments.go:40–73), so the model can answer without ever seeing the clip. Please either send Infer's documented video_url content part and cover it in a request test, or stop advertising video for this integration and document the limitation.

@aheritier
aheritier marked this pull request as draft December 4, 2026 12:44
@aheritier

Copy link
Copy Markdown
Collaborator

Please mark this PR ready for review once you’ve addressed the requested changes. Thanks!

Infer's models.dev entries list video input for some Gemini models, but
Docker Agent sends Infer requests through Chat Completions, whose
attachment conversion has no video part, so the model picker advertised
an input the model never receives.

Add unsupported_input_modalities to the provider catalog. Model choices
leave those models.dev input modalities out, and the Infer entry lists
video. Attachment handling is unchanged: a video attachment is still
dropped with a warning during conversion, and the Infer page now says
so.

Signed-off-by: Infer by Flow7 <tarun@flow7.org>
A streamed tool call round trip completed through the Infer provider
with infer/claude-opus-5-5:low-cost, infer/gemini-3.1-pro-preview:official
and infer/gemini-3.8-flash:low-cost: the CLI, built from this branch,
sent the tool result back in a second request and the model used it,
even though Docker Agent doesn't send Infer's reasoning_details record
back. Replace the note that Gemini tool calls weren't checked; the note
that reasoning isn't carried over stays.

Signed-off-by: Infer by Flow7 <tarun@flow7.org>
@tarunspandit

Copy link
Copy Markdown
Author

Thanks for the review. Both points are addressed.

Video: the picker no longer advertises video for Infer models. The provider catalog gains unsupported_input_modalities, the Infer entry lists video, and applyCatalogMetadata, which every picker path goes through, leaves those models.dev modalities out. Attachment handling is unchanged: a clip is still dropped with a warning at conversion. The Infer page now says so, including that capabilities.video: true doesn't change it. A test checks an Infer model against a Google control, for catalog and configured choices.

Tool-call round trips: I ran the CLI built from this branch (0becfb5) in --exec mode, with the filesystem toolset limited to list_directory on a directory holding one randomly named file. The answer could name the file only if the tool result went back in a second streamed request. It did on infer/claude-opus-5-5:low-cost (the default), infer/gemini-3.1-pro-preview:official and infer/gemini-3.8-flash:low-cost. Gemini 3.1 Pro streamed reasoning before its call, and the follow-up was still accepted without reasoning_details. Reasoning still isn't carried across the call, because that record isn't sent back; the provider page keeps that note and now records these checks (606ebf2).

@tarunspandit
tarunspandit marked this pull request as ready for review December 5, 2026 03:52

This branch has not been deployed

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

Labels

area/config For configuration parsing, YAML, environment variables area/docs Documentation changes area/providers For features/issues/fixes related to LLM providers (Bedrock, LiteLLM, Qwen, custom, etc.) area/testing Test infrastructure, CI/CD, test runners, evaluation kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants