-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathgateway.yaml
More file actions
149 lines (143 loc) · 6.28 KB
/
Copy pathgateway.yaml
File metadata and controls
149 lines (143 loc) · 6.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# gateway.yaml
#
# Three ideas:
# models: decide WHAT exists, once. Each entry is a model (or an ordered
# fallback chain of models) with the name you want to use.
# clients: decide WHICH model serves which traffic per client.
# providers: only needed for endpoints the built-in presets don't know.
#
# The name you give a model is the id you use everywhere:
# `claude --model <name>` and Codex's `model = "<name>"`.
#
# Secrets never live in this file: provider keys come from env vars
# (auto-loaded from .env.local / .env), and any value here may reference an
# env var with ${VAR} syntax.
server:
bind: "127.0.0.1:4000" # default; non-localhost requires a token
token: local-dev-token # accepted as Bearer or x-api-key
# tokens: [token-a, token-b] # multiple tokens
# token: "${GATEWAY_TOKEN}" # or from the environment
# Env overrides (no config edit needed): GATEWAY_BIND, GATEWAY_TOKEN
# Providers
#
# Built-in presets imply base URL + key env var — use them directly in model
# strings with zero declaration here:
#
# openrouter (OPENROUTER_API_KEY) openai (OPENAI_API_KEY)
# anthropic (ANTHROPIC_API_KEY) moonshot (MOONSHOT_API_KEY)
# fireworks (FIREWORKS_API_KEY) together (TOGETHER_API_KEY)
# groq (GROQ_API_KEY) deepinfra (DEEPINFRA_API_KEY)
# deepseek (DEEPSEEK_API_KEY) mistral (MISTRAL_API_KEY)
# xai (XAI_API_KEY) cerebras (CEREBRAS_API_KEY)
# ollama (localhost:11434, no key)
# azure (AZURE_AI_API_KEY, needs `resource:` below)
#
# Declare a provider only for custom endpoints or to override a preset.
providers:
azure:
resource: "${AZURE_AI_RESOURCE}"
vllm-local:
base_url: "http://localhost:8000/v1"
api_key: dummy
modal-kimi:
type: openai
base_url: "https://superagentai--huihui-kimi-k2-7-code-inference-server.modal.run/v1"
api_key: unused # Modal auth is via headers, not bearer
headers: # extra headers sent on every request
Modal-Key: "${MODAL_KEY}"
Modal-Secret: "${MODAL_SECRET}"
# my-anthropic-proxy:
# type: anthropic # anthropic | openai (default: openai)
# base_url: "https://proxy.example.com"
# api_key_env: PROXY_API_KEY
# Models
#
# Three forms:
# name: provider/model-id single model
# name: [provider/a, provider/b] fallback chain (see below)
# name: { model: ..., <overrides> } long form, see qwen-local
# (model: also accepts a list —
# a chain with display name/overrides)
#
# Fallback: a list IS the fallback definition. The first entry is primary;
# on connection failure, 429, or 5xx the next entry is tried, in order.
# Fallback only happens before the response starts streaming — a model that
# has begun answering (or calling a tool) is never silently swapped.
# The `kimi` and `glm` models below define opposite fallback chains.
#
# Known model families (kimi, gpt, claude, ...) get capabilities from a
# built-in quirk table — e.g. Kimi automatically drops temperature/top_p
# (fixed by the API), keeps reasoning across tool turns, accepts images.
models:
abliterated:
model: modal-kimi/huihui-ai/Huihui-Kimi-K2.7-Code-abliterated-GGUF
display_name: "Huihui Kimi K2.7 Code Abliterated (Modal)"
# kimi quirks apply automatically: native thinking, temperature/top_p
# dropped, 300s timeout
sol:
model: [azure/gpt-5.6-sol, openrouter/moonshotai/kimi-k2.7-code]
display_name: "Azure GPT-5.6 Sol (fallback to OpenRouter Kimi K2.7 Code)"
fw-kimi-k3:
model: [azure/FW-Kimi-K3, azure/gpt-5.6-sol]
display_name: "Azure FW Kimi K3 (fallback to Azure GPT-5.6 Sol)"
drop_message_params: [reasoning] # Azure accepts reasoning_content only
kimi-k3:
model: [openrouter/moonshotai/kimi-k3, openrouter/moonshotai/kimi-k2.7-code]
display_name: "OpenRouter Kimi K3 Code"
kimi-27:
model: openrouter/moonshotai/kimi-k2.7-code
display_name: "OpenRouter Kimi K2.7 Code"
kimi:
model: [azure/kimi-k2.6, openrouter/z-ai/glm-5.2]
display_name: "Azure Kimi K2.6 (fallback to OpenRouter GLM 5.2)"
glm:
model: [openrouter/z-ai/glm-5.2, azure/kimi-k2.6]
display_name: "OpenRouter GLM 5.2 (fallback to Azure Kimi K2.6)"
glm-53-flash:
model: [openrouter/z-ai/glm-5.3-flash, azure/gpt-5.6-sol]
display_name: "OpenRouter GLM 5.3 Flash (fallback to Azure GPT-5.6 Sol)"
images: true
qwen-local:
model: vllm-local/qwen3-coder
# model: [vllm-local/qwen3-coder, openrouter/qwen/qwen3-coder] # with fallback
display_name: "Qwen3 Coder (local)"
# images: false # vision on/off
# tools: openai # openai | native | none
# thinking: none # native | none (reasoning round-trip)
# cache_control: none # native | none
# drop_params: [temperature] # strip params the API rejects
# drop_message_params: [reasoning] # strip fields from chat messages
# timeout_ms: 120000
# expose: [claude_code, codex] # which clients may select it (default: all)
# Clients
#
# Roles route traffic to models by name (or inline provider/model-id string):
# main: the conversation model; a list is a fallback chain
# subagent: Task-tool subagent requests (default: unused)
# background: cheap lane: titles, summaries (default: unused)
# unknown: where unrecognized model ids go — a role, a model, or
# "reject" to return 404 (default: main)
#
# Roles may reference other roles (e.g. `subagent: main`).
clients:
claude_code:
main: sol
subagent: kimi-k3
background: kimi-k3
codex:
main: kimi
# Retry tuning (defaults shown)
#
# WHICH models fall back to which is defined above in models: (a list is a
# fallback chain). This section only tunes WHEN a failure counts as
# retryable and how many attempts are made in total (the first entry is
# retried once before moving down the chain).
# fallback:
# max_attempts: 3
# retryable_statuses: [408, 429, 500, 502, 503, 504]
# Telemetry (defaults shown)
#
# telemetry:
# log_prompts: false # true logs full request bodies
# log_tool_calls: true
# redact_headers: [authorization, x-api-key]