Repository navigation
feat: add Infer to the built-in provider catalog - #5117
tarunspandit wants to merge 3 commits into
Conversation
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>
aheritier
left a comment
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
[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.
|
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>
|
Thanks for the review. Both points are addressed. Video: the picker no longer advertises video for Infer models. The provider catalog gains Tool-call round trips: I ran the CLI built from this branch (0becfb5) in |
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: aninferentry using the existing OpenAI implementation (api_type: openai, base URLhttps://infer.flow7.org/v1,INFER_API_KEY, default modelinfer/claude-opus-5-5:low-cost). It sits afteruncensoredlabs, so it ranks low for automatic selection. It does not opt intomerge_consecutive_messages; I haven't run the message-merging probe against Infer, so the entry keeps the default, and the merge gating test recordsfalse.openAIAliasProviders(hermetic request test, plus the opt-in live test behindDOCKER_AGENT_RUN_INFER_LIVE_TEST), rows in the auto-selection tables, and ashouldMergeConsecutiveMessagesrow. Unlike Morse and Straitly, Infer is already in the models.dev snapshot asinfer, so no models.dev exemptions are added:TestProviderIDsMatchEmbeddedCatalog,TestDefaultModelsExistInModelsDevandTestParseExamplesresolve the provider ID, the default model and the example against the snapshot.examples/infer.yamlrecipe.unsupported_input_modalities, listsvideofor Infer, andapplyCatalogMetadata, 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,:stableor: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/modelsand models.dev list them. The inline reference is thereforeinfer/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
inferis in models.dev,docker agent models --provider inferand the model picker list the Infer rows that models.dev carries (10 today, two of them Gemini). No live/v1/modelsdiscovery is added:inferis not inliveFetchProviders, and Infer's/v1/modelsneeds a key.Reasoning and tool calls
Infer's docs say a thinking model's
reasoning_detailsrecord has to be sent back to keep its reasoning across tool calls. Docker Agent's Chat Completions client replays reasoning asreasoning_contenttext, so that record isn't sent back. Docker Agent also sends no thinking settings for Claude models through an OpenAI-compatible alias (thinking_budgetonly 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
mainat 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 veton 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.shandscripts/docs-check-community-links.sh: OK.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-lintv2.14.0 on the two touched Go packages: 0 issues.markdownlint-cli20.22.1 on the provider page: 0 errors.scripts/docs-check-canonical.shandscripts/docs-check-community-links.sh: OK.--execmode with the filesystem toolset limited tolist_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 withinfer/claude-opus-5-5:low-cost,infer/gemini-3.1-pro-preview:official(which streamed reasoning before its call) andinfer/gemini-3.8-flash:low-cost.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