Commit 572d176
feat(adminapi): role-specific presets + dedicated OR slot per role
Replaces the single catch-all "workhorse" OR slot with one slot per
routing role (simple-or / default-or / complex-or / compaction-or) so
each can be reassigned independently from the admin UI without side
effects on the other roles.
Also adds a "Suggest for <role>" button to the routing table. Clicking
it applies a role-specific preset to the model catalog: transparent
include/exclude filters + a sort strategy — no opaque quality score,
no curated shortlist, just filters the user can read and relax.
Presets
simple tools, multilingual Russian-capable families, ≤ $1/M prompt,
no :free / -coder / -vl variants. Sort: prompt price asc.
default same but ≤ $2/M prompt.
complex adds reasoning requirement, ≤ $5/M prompt. Claude via
bridge remains the recommended option when configured.
multimodal vision + tools, multilingual, ≤ $2/M prompt. Note: native
audio transcription still uses direct Gemini outside OR.
compaction ctx ≥ 32k, multilingual, sorted by COMPLETION price —
summaries are output-heavy, so ranking by prompt price
misrepresents the actual cost driver.
classifier multilingual, ≤ $0.1/M prompt. Local Ollama stays primary.
The "fallback" role intentionally has no preset: it should point to a
DIRECT-provider slot (Gemini in our config) so an OpenRouter outage
doesn't take the whole bot down. Browsing OR candidates here would
be misleading.
Filter definitions live in internal/adminapi/recommend.go with a
conservative multilingual allowlist (Qwen3, Qwen Plus/Max/Turbo, GLM
4.5+, Kimi, Gemini 2.5/3.x, Mistral Large/Medium, Grok 3/4, DeepSeek).
English-primary small variants (nvidia, cohere-r-small) and specialised
-coder/-vl fine-tunes are excluded from general roles so the top of the
list doesn't fill up with things that don't speak Russian well.
UI
The models section is now one htmx-swappable div (banner + filters +
table). When a preset is active, a banner at the top names the role,
shows the preset's human-readable description, and offers a Clear
button to return to the raw catalog.
Config
config.yaml (dev + deploy) splits "workhorse" into four OR slots so the
model id per slot can diverge over time:
simple-or qwen/qwen3.5-flash-02-23 — $0.065, 1M ctx, V T R
default-or qwen/qwen3.5-flash-02-23 — same initial model
complex-or qwen/qwen3-235b-a22b-thinking... — fallback when bridge off
compaction-or qwen/qwen3.5-9b — 262k ctx, cheap output
routing.{simple,default,complex,compaction} point at the new slots;
fallback stays on direct Gemini flash-lite.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b2c8b3e commit 572d176
9 files changed
Lines changed: 372 additions & 87 deletions
File tree
- config
- internal/adminapi
- templates
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
71 | | - | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| |||
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
183 | | - | |
| 186 | + | |
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
187 | 190 | | |
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
196 | 225 | | |
197 | 226 | | |
198 | 227 | | |
| |||
202 | 231 | | |
203 | 232 | | |
204 | 233 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | 234 | | |
213 | 235 | | |
214 | 236 | | |
| |||
257 | 279 | | |
258 | 280 | | |
259 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
260 | 291 | | |
261 | 292 | | |
262 | 293 | | |
| |||
277 | 308 | | |
278 | 309 | | |
279 | 310 | | |
| 311 | + | |
280 | 312 | | |
281 | 313 | | |
282 | 314 | | |
283 | | - | |
284 | | - | |
285 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
286 | 319 | | |
287 | 320 | | |
288 | 321 | | |
| |||
0 commit comments