diff --git a/agent-schema.json b/agent-schema.json index e75e1531ef..bc8dfd4380 100644 --- a/agent-schema.json +++ b/agent-schema.json @@ -224,7 +224,7 @@ "properties": { "provider": { "type": "string", - "description": "The underlying provider type. Defaults to \"openai\" when not set. Supported values: openai, anthropic, google, amazon-bedrock, dmr, and any built-in alias (requesty, openrouter, opper, runcrate, api-route, lunaroute, orcarouter, atlascloud, popnow, cloudgpu, obscurify, hopbase, azure, xai, ollama, mistral, baseten, daoxe, ovhcloud, groq, fireworks-ai, deepseek, cerebras, togetherai, huggingface, moonshotai, vercel, cloudflare-workers-ai, cloudflare-ai-gateway, nvidia, github-copilot, chatgpt, opencode, opencode-go, etc.).", + "description": "The underlying provider type. Defaults to \"openai\" when not set. Supported values: openai, anthropic, google, amazon-bedrock, dmr, and any built-in alias (requesty, openrouter, opper, runcrate, api-route, lunaroute, orcarouter, atlascloud, popnow, cloudgpu, obscurify, hopbase, straitly, azure, xai, ollama, mistral, baseten, daoxe, ovhcloud, groq, fireworks-ai, deepseek, cerebras, togetherai, huggingface, moonshotai, vercel, cloudflare-workers-ai, cloudflare-ai-gateway, nvidia, github-copilot, chatgpt, opencode, opencode-go, etc.).", "examples": [ "openai", "anthropic", diff --git a/docs/configuration/models/index.md b/docs/configuration/models/index.md index 7790747893..f0d7744a01 100644 --- a/docs/configuration/models/index.md +++ b/docs/configuration/models/index.md @@ -16,7 +16,7 @@ models: first_available: [list] # Optional: candidate model refs, tried in order by available credentials. # Mutually exclusive with other model settings. provider: string # Required unless using first_available. One of: openai, anthropic, google, amazon-bedrock, - # dmr, mistral, xai, nebius, nvidia, minimax, baseten, daoxe, ovhcloud, groq, fireworks-ai, deepseek, cerebras, togetherai, huggingface, moonshotai, vercel, cloudflare-workers-ai, cloudflare-ai-gateway, requesty, openrouter, opper, runcrate, api-route, lunaroute, orcarouter, atlascloud, popnow, cloudgpu, obscurify, hopbase, + # dmr, mistral, xai, nebius, nvidia, minimax, baseten, daoxe, ovhcloud, groq, fireworks-ai, deepseek, cerebras, togetherai, huggingface, moonshotai, vercel, cloudflare-workers-ai, cloudflare-ai-gateway, requesty, openrouter, opper, runcrate, api-route, lunaroute, orcarouter, atlascloud, popnow, cloudgpu, obscurify, hopbase, straitly, # azure, ollama, github-copilot, or a named provider defined # under the top-level `providers:` section. model: string # Required: model identifier @@ -103,7 +103,7 @@ agents: | Property | Type | Required | Description | | --------------------- | ---------- | -------- | ------------------------------------------------------------------------------------- | | `first_available` | array | ✗ | Candidate model references tried in order; selects the first whose credentials are configured. Mutually exclusive with other model settings. | -| `provider` | string | ✓/✗ | Required for regular model definitions; omitted for `first_available` selectors. Provider: `openai`, `anthropic`, `google`, `amazon-bedrock`, `dmr`, `mistral`, `xai`, `nebius`, `nvidia`, `minimax`, `baseten`, `daoxe`, `ovhcloud`, `groq`, `fireworks-ai`, `deepseek`, `cerebras`, `togetherai`, `huggingface`, `moonshotai`, `vercel`, `cloudflare-workers-ai`, `cloudflare-ai-gateway`, `requesty`, `openrouter`, `opper`, `runcrate`, `api-route`, `lunaroute`, `orcarouter`, `atlascloud`, `popnow`, `cloudgpu`, `obscurify`, `hopbase`, `azure`, `ollama`, `github-copilot`, `chatgpt`, `opencode`, `opencode-go`, or any [named provider](../../providers/custom/index.md). | +| `provider` | string | ✓/✗ | Required for regular model definitions; omitted for `first_available` selectors. Provider: `openai`, `anthropic`, `google`, `amazon-bedrock`, `dmr`, `mistral`, `xai`, `nebius`, `nvidia`, `minimax`, `baseten`, `daoxe`, `ovhcloud`, `groq`, `fireworks-ai`, `deepseek`, `cerebras`, `togetherai`, `huggingface`, `moonshotai`, `vercel`, `cloudflare-workers-ai`, `cloudflare-ai-gateway`, `requesty`, `openrouter`, `opper`, `runcrate`, `api-route`, `lunaroute`, `orcarouter`, `atlascloud`, `popnow`, `cloudgpu`, `obscurify`, `hopbase`, `straitly`, `azure`, `ollama`, `github-copilot`, `chatgpt`, `opencode`, `opencode-go`, or any [named provider](../../providers/custom/index.md). | | `model` | string | ✓/✗ | Required for regular model definitions; omitted for `first_available` selectors. Model name (e.g., `gpt-4o`, `claude-sonnet-4-5`, `gemini-3.5-flash`) | | `description` | string | ✗ | Informational, human-readable summary of the model's purpose or strengths (e.g., "fast and cheap, good for summaries"). Not sent to the model. Can be combined with `first_available` (a selector's description is kept when it resolves). | | `stream_idle_timeout` | duration/int | ✗ | Maximum silence between stream chunks; overrides `runtime.stream_idle_timeout`. See [Stream idle timeout](#stream-idle-timeout). | @@ -703,7 +703,7 @@ for a complete local-server configuration. ## Custom HTTP Headers For OpenAI-compatible providers (`openai`, `github-copilot`, `mistral`, `xai`, -`nebius`, `nvidia`, `minimax`, `baseten`, `daoxe`, `ovhcloud`, `groq`, `fireworks-ai`, `deepseek`, `cerebras`, `togetherai`, `huggingface`, `moonshotai`, `vercel`, `cloudflare-workers-ai`, `cloudflare-ai-gateway`, `requesty`, `openrouter`, `opper`, `runcrate`, `lunaroute`, `orcarouter`, `atlascloud`, `popnow`, `cloudgpu`, `obscurify`, `hopbase`, `ollama`, and any custom provider using the OpenAI API), +`nebius`, `nvidia`, `minimax`, `baseten`, `daoxe`, `ovhcloud`, `groq`, `fireworks-ai`, `deepseek`, `cerebras`, `togetherai`, `huggingface`, `moonshotai`, `vercel`, `cloudflare-workers-ai`, `cloudflare-ai-gateway`, `requesty`, `openrouter`, `opper`, `runcrate`, `lunaroute`, `orcarouter`, `atlascloud`, `popnow`, `cloudgpu`, `obscurify`, `hopbase`, `straitly`, `ollama`, and any custom provider using the OpenAI API), `provider_opts.http_headers` adds arbitrary HTTP headers to every outgoing request: diff --git a/docs/data/nav.yml b/docs/data/nav.yml index b47b5b1fb0..aeee6eacd5 100644 --- a/docs/data/nav.yml +++ b/docs/data/nav.yml @@ -249,6 +249,8 @@ url: /providers/popnow/ - title: Runcrate url: /providers/runcrate/ + - title: Straitly + url: /providers/straitly/ - title: Together AI url: /providers/together/ - title: Vercel AI Gateway diff --git a/docs/providers/overview/index.md b/docs/providers/overview/index.md index 78b71cf49a..d954267800 100644 --- a/docs/providers/overview/index.md +++ b/docs/providers/overview/index.md @@ -77,6 +77,7 @@ Use this table to find a built-in provider's config key and authentication metho | CloudGPU | [`cloudgpu`](../cloudgpu/index.md) | `CLOUDGPU_API_KEY` | | Obscurify.ai | [`obscurify`](../obscurify/index.md) | `OBSCURIFY_API_KEY` | | HopBase | [`hopbase`](../hopbase/index.md) | `HOPBASE_API_KEY` | +| Straitly | [`straitly`](../straitly/index.md) | `STRAITLY_API_KEY` | | Azure OpenAI | `azure` | `AZURE_API_KEY` + `base_url` (override the key with `token_key`) | | [Ollama](../local/index.md) | `ollama` | None (local; optional `base_url`) | | GitHub Copilot | `github-copilot` | `GITHUB_TOKEN` or `GH_TOKEN` (PAT with `copilot` scope) | diff --git a/docs/providers/straitly/index.md b/docs/providers/straitly/index.md new file mode 100644 index 0000000000..6d38f22b34 --- /dev/null +++ b/docs/providers/straitly/index.md @@ -0,0 +1,122 @@ +--- +title: "Straitly" +description: "Use Straitly models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, straitly +weight: 247 +canonical: https://docs.docker.com/ai/docker-agent/providers/straitly/ +--- + +## Overview + +[Straitly](https://straitly.ai) is an AI gateway. One API key and one base URL +reach more than 150 models, including Claude, GPT, Gemini, Grok and DeepSeek, +through an OpenAI-compatible API. Docker Agent includes Straitly as a built-in +provider in its embedded provider catalog. + +## Setup + +1. Sign up at [straitly.ai](https://straitly.ai/signup), add prepaid credits and + create an API key on the [API keys page](https://straitly.ai/app/keys). +2. Set the environment variable: + + ```bash + export STRAITLY_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +Prefix a Straitly model ID with `straitly/`: + +```yaml +agents: + root: + model: straitly/deepseek/deepseek-v4-1-flash + description: Assistant using Straitly + instruction: You are a helpful assistant. +``` + +Straitly model IDs usually contain a slash themselves. Docker Agent splits the +inline reference at the first slash, so everything after `straitly/` is passed +to Straitly unchanged. + +### Named Model + +```yaml +models: + straitly_model: + provider: straitly + model: deepseek/deepseek-v4-1-flash + max_tokens: 8192 + +agents: + root: + model: straitly_model + description: Assistant using Straitly + instruction: You are a helpful assistant. +``` + +When Straitly is selected automatically from available credentials, the default +model is `deepseek/deepseek-v4-1-flash`. Model IDs are passed through as +supplied. + +## Available Models + +List the model IDs before choosing another model: + +```bash +curl https://api.straitly.ai/v1/models \ + -H "Authorization: Bearer $STRAITLY_API_KEY" +``` + +Use an ID from the response unchanged as the `model` value. Each entry also +lists its `context_length`, `supported_parameters` and +`architecture.input_modalities`. The same list is on the +[models page](https://straitly.ai/models). + +Straitly is absent from Docker Agent's embedded models.dev catalog. Docker Agent +does not import pricing, context limits or attachment capabilities from +Straitly's model list. Attachment detection falls back to text-only, so image +and PDF attachments are dropped, with a warning logged once per model. If the +model you chose lists `image` in `architecture.input_modalities`, set +`models..capabilities`; see +[Attachment Capability Overrides](../../configuration/models/index.md#attachment-capability-overrides): + +```yaml +models: + straitly_vision: + provider: straitly + model: deepseek/deepseek-v4-1-flash + capabilities: + image: true +``` + +## How It Works + +Straitly 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://api.straitly.ai/v1` +- **Token variable:** `STRAITLY_API_KEY` + +Claude models are callable through this alias like any other model. Use the ID +exactly as `/v1/models` returns it. + +## Example: Code Assistant + +```yaml +agents: + coder: + model: straitly/deepseek/deepseek-v4-1-flash + description: Code assistant using Straitly + instruction: | + You are an expert programmer. + Write clean code and follow language best practices. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/examples/README.md b/examples/README.md index 48a23d04ff..b97661d332 100644 --- a/examples/README.md +++ b/examples/README.md @@ -227,6 +227,7 @@ remote MCP endpoints. | [`cloudgpu.yaml`](cloudgpu.yaml) | CloudGPU OpenAI-compatible provider (`cloudgpu`). | | [`obscurify.yaml`](obscurify.yaml) | Obscurify.ai multi-model provider (`obscurify`). | | [`hopbase.yaml`](hopbase.yaml) | HopBase multi-model gateway (`hopbase`). | +| [`straitly.yaml`](straitly.yaml) | Straitly multi-model gateway (`straitly`). | | [`cloudflare-workers-ai.yaml`](cloudflare-workers-ai.yaml) | Cloudflare Workers AI edge-hosted open models. | | [`cloudflare-ai-gateway.yaml`](cloudflare-ai-gateway.yaml) | Cloudflare AI Gateway multi-provider router. | | [`grok.yaml`](grok.yaml) | xAI Grok model. | diff --git a/examples/straitly.yaml b/examples/straitly.yaml new file mode 100644 index 0000000000..4cc61e44c5 --- /dev/null +++ b/examples/straitly.yaml @@ -0,0 +1,17 @@ +# yaml-language-server: $schema=../agent-schema.json + +models: + straitly_model: + provider: straitly + model: deepseek/deepseek-v4-1-flash + +agents: + root: + model: straitly_model + description: Assistant using Straitly + instruction: | + You are a helpful assistant. + toolsets: + - type: filesystem + - type: shell + - type: think diff --git a/pkg/config/auto_test.go b/pkg/config/auto_test.go index 7ef584d2cd..f77e3b15c5 100644 --- a/pkg/config/auto_test.go +++ b/pkg/config/auto_test.go @@ -142,6 +142,13 @@ func TestAvailableProviders_NoGateway(t *testing.T) { }, expectedProvider: "hopbase", }, + { + name: "straitly api key present", + envVars: map[string]string{ + "STRAITLY_API_KEY": "test-key", + }, + expectedProvider: "straitly", + }, { name: "baseten api key present", envVars: map[string]string{ @@ -442,6 +449,15 @@ func TestAutoModelConfig(t *testing.T) { expectedModel: "glm-5.3", expectedMaxTokens: 32000, }, + { + name: "straitly provider", + envVars: map[string]string{ + "STRAITLY_API_KEY": "test-key", + }, + expectedProvider: "straitly", + expectedModel: "deepseek/deepseek-v4-1-flash", + expectedMaxTokens: 32000, + }, { name: "orcarouter provider", envVars: map[string]string{ diff --git a/pkg/config/examples_test.go b/pkg/config/examples_test.go index 9d8b59caa7..1a27a1f604 100644 --- a/pkg/config/examples_test.go +++ b/pkg/config/examples_test.go @@ -36,6 +36,7 @@ var modelsDevAbsentProviders = map[string]bool{ "popnow": true, // PopNow model IDs come from its own /v1/models endpoint, not models.dev. "cloudgpu": true, // CloudGPU model IDs come from its own /v1/models endpoint, not models.dev. "hopbase": true, // HopBase model IDs come from its own /v1/models endpoint, not models.dev. + "straitly": true, // Straitly model IDs come from its own /v1/models endpoint, not models.dev. "dmr": true, // Docker Model Runner (local, not in catalog) "cloudflare-workers-ai": true, // example uses an @cf/... model id not present in the models.dev snapshot (only variant ids like -fp8 are listed) "cloudflare-ai-gateway": true, // multi-provider router; example model ids use the gateway's provider/model form, not guaranteed to match a models.dev id diff --git a/pkg/model/provider/catalog/providers.json b/pkg/model/provider/catalog/providers.json index 0c08e38125..8e7b081ff9 100644 --- a/pkg/model/provider/catalog/providers.json +++ b/pkg/model/provider/catalog/providers.json @@ -174,6 +174,15 @@ "HOPBASE_API_KEY" ] }, + { + "name": "straitly", + "api_type": "openai", + "base_url": "https://api.straitly.ai/v1", + "default_model": "deepseek/deepseek-v4-1-flash", + "token_env_vars": [ + "STRAITLY_API_KEY" + ] + }, { "name": "baseten", "merge_consecutive_messages": true, diff --git a/pkg/model/provider/catalog_test.go b/pkg/model/provider/catalog_test.go index d3aa06c195..b0d7a084ee 100644 --- a/pkg/model/provider/catalog_test.go +++ b/pkg/model/provider/catalog_test.go @@ -79,6 +79,7 @@ func TestProviderIDsMatchEmbeddedCatalog(t *testing.T) { "cloudgpu": "model IDs come from CloudGPU's /v1/models endpoint, not models.dev", "chatgpt": "subscription backend, distinct from OpenAI", "hopbase": "model IDs come from HopBase's /v1/models endpoint, not models.dev", + "straitly": "model IDs come from Straitly's /v1/models endpoint, not models.dev", "lunaroute": "model IDs come from Lunaroute’s /v1/models endpoint, not models.dev", "dmr": "local Docker Model Runner", "ollama": "local Ollama server", diff --git a/pkg/model/provider/openai/system_message_merge_test.go b/pkg/model/provider/openai/system_message_merge_test.go index 1b7331809b..e52c9e6be7 100644 --- a/pkg/model/provider/openai/system_message_merge_test.go +++ b/pkg/model/provider/openai/system_message_merge_test.go @@ -245,6 +245,7 @@ func TestShouldMergeConsecutiveMessages_Gating(t *testing.T) { {"cloudgpu, no base_url", &latest.ModelConfig{Provider: "cloudgpu", Model: "deepseek-v4.1-flash"}, true}, {"obscurify, no base_url", &latest.ModelConfig{Provider: "obscurify", Model: "deepseek/deepseek-v4-flash"}, true}, {"hopbase, no base_url", &latest.ModelConfig{Provider: "hopbase", Model: "glm-5.3"}, true}, + {"straitly, no base_url", &latest.ModelConfig{Provider: "straitly", Model: "deepseek/deepseek-v4-1-flash"}, false}, {"ovhcloud", &latest.ModelConfig{Provider: "ovhcloud", Model: "Qwen3.5-397B-A17B"}, true}, {"open-model host alias cerebras", &latest.ModelConfig{Provider: "cerebras", Model: "qwen-3-coder-480b"}, true}, {"open-model host fireworks", &latest.ModelConfig{Provider: "fireworks", Model: "accounts/fireworks/models/kimi-k3"}, true}, diff --git a/pkg/model/provider/openai_alias_providers_test.go b/pkg/model/provider/openai_alias_providers_test.go index 176d7f5652..595624b9f3 100644 --- a/pkg/model/provider/openai_alias_providers_test.go +++ b/pkg/model/provider/openai_alias_providers_test.go @@ -132,6 +132,14 @@ var openAIAliasProviders = []openAIAliasProvider{ mergesSystemMessages: true, liveOptInEnvVar: "DOCKER_AGENT_RUN_HOPBASE_LIVE_TEST", }, + { + provider: "straitly", + envVar: "STRAITLY_API_KEY", + testKey: "test-straitly-key", + model: "deepseek/deepseek-v4-1-flash", + greeting: "Hello from Straitly", + liveOptInEnvVar: "DOCKER_AGENT_RUN_STRAITLY_LIVE_TEST", + }, { provider: "deepseek", envVar: "DEEPSEEK_API_KEY",