Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agent-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions docs/configuration/models/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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). |
Expand Down Expand Up @@ -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:

Expand Down
2 changes: 2 additions & 0 deletions docs/data/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/providers/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
122 changes: 122 additions & 0 deletions docs/providers/straitly/index.md
Original file line number Diff line number Diff line change
@@ -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.<name>.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
```
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
17 changes: 17 additions & 0 deletions examples/straitly.yaml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions pkg/config/auto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down
1 change: 1 addition & 0 deletions pkg/config/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions pkg/model/provider/catalog/providers.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions pkg/model/provider/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions pkg/model/provider/openai/system_message_merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
8 changes: 8 additions & 0 deletions pkg/model/provider/openai_alias_providers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down