Repository navigation
feat: add Infer to the built-in provider catalog #5117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tarunspandit
wants to merge
3
commits into
docker:main
Choose a base branch
from
tarunspandit:add-infer-provider
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+284
−2
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| --- | ||
| title: "Infer" | ||
| description: "Use Infer models with Docker Agent." | ||
| keywords: docker agent, ai agents, model providers, llm, infer | ||
| weight: 145 | ||
| canonical: https://docs.docker.com/ai/docker-agent/providers/infer/ | ||
| --- | ||
|
|
||
| ## Overview | ||
|
|
||
| [Infer](https://infer.flow7.org) serves models from Anthropic, OpenAI, Google, | ||
| xAI and others through an OpenAI-compatible API. Each model is offered on up to | ||
| four routes, and the suffix of the model ID picks the route: `:low-cost`, | ||
| `:balanced`, `:stable` or `:official`. Docker Agent includes Infer as a built-in | ||
| provider in its embedded provider catalog. | ||
|
|
||
| ## Setup | ||
|
|
||
| 1. Create an account and an API key on the | ||
| [API keys page](https://infer.flow7.org/app#/keys). | ||
| 2. Add wallet credit before the first call. Infer is prepaid, and a request the | ||
| wallet can't cover returns an `insufficient_credits` error. | ||
| 3. Set the environment variable: | ||
|
|
||
| ```bash | ||
| export INFER_API_KEY=your-api-key | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Inline Syntax | ||
|
|
||
| Infer model IDs start with `infer/` themselves, as Infer's `/v1/models` and | ||
| models.dev list them, so the inline reference repeats the prefix: | ||
|
|
||
| ```yaml | ||
| agents: | ||
| root: | ||
| model: infer/infer/claude-opus-5-5:low-cost | ||
| description: Assistant using Infer | ||
| instruction: You are a helpful assistant. | ||
| ``` | ||
|
|
||
| Docker Agent splits the inline reference at the first slash, so | ||
| `infer/claude-opus-5-5:low-cost` is sent to Infer unchanged and is also the ID | ||
| looked up in models.dev. | ||
|
|
||
| ### Named Model | ||
|
|
||
| The `model` value is the model ID exactly as listed: | ||
|
|
||
| ```yaml | ||
| models: | ||
| infer_model: | ||
| provider: infer | ||
| model: infer/claude-opus-5-5:low-cost | ||
| max_tokens: 8192 | ||
|
|
||
| agents: | ||
| root: | ||
| model: infer_model | ||
| description: Assistant using Infer | ||
| instruction: You are a helpful assistant. | ||
| ``` | ||
|
|
||
| When Infer is selected automatically from available credentials, the default | ||
| model is `infer/claude-opus-5-5:low-cost`. | ||
|
|
||
| ## Available Models | ||
|
|
||
| The [models page](https://infer.flow7.org/models) lists every model with its | ||
| routes and prices. With a key, `/v1/models` returns the model IDs you can call: | ||
|
|
||
| ```bash | ||
| curl https://infer.flow7.org/v1/models \ | ||
| -H "Authorization: Bearer $INFER_API_KEY" | ||
| ``` | ||
|
|
||
| Use an ID from the response unchanged as the `model` value, for example | ||
| `infer/claude-sonnet-5-5:low-cost`, `infer/gpt-6.2-sol:low-cost` or | ||
| `infer/grok-4.7:low-cost`. The response also lists image and video generation | ||
| models, which can't be used as chat models. | ||
|
|
||
| ## Pricing and Model Metadata | ||
|
|
||
| Infer is in the [models.dev](https://models.dev/) catalog. For the Infer models | ||
| that models.dev carries, `docker agent models --provider infer` and the model | ||
| picker list them, and Docker Agent reads their prices, context limits and input | ||
| types from models.dev, except video (see [Attachments](#attachments)). If | ||
| models.dev is unavailable, Docker Agent falls back to its embedded catalog | ||
| snapshot. | ||
|
|
||
| A model ID that models.dev doesn't list still works. Docker Agent then has no | ||
| price or context limit for it, and attachment detection falls back to | ||
| text-only; see | ||
| [Attachment Capability Overrides](../../configuration/models/index.md#attachment-capability-overrides). | ||
|
|
||
| ## Attachments | ||
|
|
||
| Docker Agent sends Infer requests through Chat Completions, and its Chat | ||
| Completions conversion has no content part for video. Some Infer models list | ||
| video input in models.dev, but the model picker doesn't show video for Infer | ||
| models. A video attachment is dropped with a warning before the request is | ||
| sent, so the model never sees it. Setting `capabilities.video: true` on the | ||
| model doesn't change this. | ||
|
|
||
| ## Reasoning and Tool Calls | ||
|
|
||
| Infer keeps a model's reasoning across tool calls only when the | ||
| `reasoning_details` record from its reply is sent back. Docker Agent sends | ||
| earlier reasoning back as `reasoning_content` text instead, so that reasoning | ||
| isn't carried over: | ||
|
|
||
| - Docker Agent sends no thinking settings for Claude models through this | ||
| provider, so `thinking_budget` has no effect on them. | ||
| - Without the record, a streamed tool call round trip still completed with | ||
| `infer/claude-opus-5-5:low-cost`, `infer/gemini-3.1-pro-preview:official` | ||
| and `infer/gemini-3.8-flash:low-cost`: the tool result went back in a second | ||
| request and the model used it. Other models weren't checked. | ||
|
|
||
| ## How It Works | ||
|
|
||
| Infer is an entry in Docker Agent's built-in provider catalog | ||
| (`pkg/model/provider/catalog/providers.json`) that uses the existing OpenAI | ||
| implementation: | ||
|
|
||
| - **API type:** OpenAI-compatible Chat Completions (`openai_chatcompletions`) | ||
| - **Base URL:** `https://infer.flow7.org/v1` | ||
| - **Token variable:** `INFER_API_KEY` | ||
|
|
||
| See the [Infer API docs](https://infer.flow7.org/docs) for request options. | ||
|
|
||
| ## Example: Code Assistant | ||
|
|
||
| ```yaml | ||
| agents: | ||
| coder: | ||
| model: infer/infer/claude-sonnet-5-5:low-cost | ||
| description: Code assistant using Infer | ||
| instruction: | | ||
| You are an expert programmer. | ||
| Write clean code and follow language best practices. | ||
| toolsets: | ||
| - type: filesystem | ||
| - type: shell | ||
| - type: think | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # yaml-language-server: $schema=../agent-schema.json | ||
|
|
||
| models: | ||
| infer_model: | ||
| provider: infer | ||
| model: infer/claude-opus-5-5:low-cost | ||
|
|
||
| agents: | ||
| root: | ||
| model: infer_model | ||
| description: Assistant using Infer | ||
| instruction: | | ||
| You are a helpful assistant. | ||
| toolsets: | ||
| - type: filesystem | ||
| - type: shell | ||
| - type: think |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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:officialin the model picker withvideoinput from the embedded snapshot (pkg/runtime/modelcatalog/catalog.go:381–396,455). But the Chat Completions converter drops inlinevideo/*attachments (pkg/model/provider/oaistream/attachments.go:40–73), so the model can answer without ever seeing the clip. Please either send Infer's documentedvideo_urlcontent part and cover it in a request test, or stop advertising video for this integration and document the limitation.