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
1 change: 1 addition & 0 deletions docs/llm.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ A gateway preset is a built-in, ready-made custom provider for a well-known Open

| Preset | Base URL | Default model | Key | Prompt tier |
|--------|----------|---------------|-----|-------------|
| `api-route` | `https://global.api-route.com/v1` | `gpt-6.1-sol` | `API_ROUTE_API_KEY` | `frontier` |
| `cheaperinference` | `https://api.cheaperinference.com/v1` | `gpt-5.4-mini` | `CHEAPER_INFERENCE_API_KEY` | `frontier` |
| `requesty` | `https://router.requesty.ai/v1` (EU: `https://router.eu.requesty.ai/v1`) | `openai/gpt-4o-mini` | `REQUESTY_API_KEY` | `frontier` |

Expand Down
9 changes: 9 additions & 0 deletions internal/llm/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ import (
// Preset names are deliberately not reserved: a user custom provider of
// the same name (providers.json or inline `llm.custom`) always wins.
var gatewayPresets = map[string]CustomProvider{
// API Route (https://www.api-route.com/docs/overview) uses the
// OpenAI Chat Completions API with bare model ids.
"api-route": {
BaseURL: "https://global.api-route.com/v1",
Model: "gpt-6.1-sol",
APIKeyEnv: "API_ROUTE_API_KEY",
SchemaMode: "json_schema",
PromptProfile: "frontier",
},
// Cheaper Inference (https://cheaperinference.com/docs) is an
// OpenAI-compatible gateway; model ids are bare (no vendor prefix).
"cheaperinference": {
Expand Down
6 changes: 6 additions & 0 deletions internal/llm/presets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ func TestConfig_ActiveCustom_PresetResolution(t *testing.T) {
t.Errorf("cheaperinference preset: %+v ok=%v profile=%v", cp, ok, ProfileFor(ci))
}

route := Config{Provider: "api-route"}
cp, ok = route.ActiveCustom()
if !ok || cp.BaseURL != "https://global.api-route.com/v1" || cp.Model != "gpt-6.1-sol" || cp.APIKeyEnv != "API_ROUTE_API_KEY" || cp.SchemaMode != "json_schema" || ProfileFor(route) != ProfileFrontier {
t.Errorf("api-route preset: %+v ok=%v profile=%v", cp, ok, ProfileFor(route))
}

// A user custom provider of the same name always wins, wholesale —
// no preset field leaks into it.
c.Custom = map[string]CustomProvider{"testgw": {BaseURL: "https://mine/v1", Model: "my-model"}}
Expand Down
Loading