Skip to content

Commit f680957

Browse files
Alexey Panfilovclaude
andcommitted
fix(adminapi): complex preset filters to actual reasoner variants
The capability flag "reasoning: true" is set by OpenRouter on any model whose API accepts a reasoning parameter — which includes small 8B/14B Qwens that don't actually perform at reasoner level. Listing them under the complex Suggest button was misleading. Require the model id to match a genuine-reasoner naming convention: -thinking / :thinking suffix, /qwq, /deepseek-r<n>, -r1-, -reasoner. Kept the ≤ $5/M prompt cap and multilingual/tools/non-free filters. After the fix, complex Suggest returns 9 candidates sorted by prompt price, starting at qwen/qwen3-30b-a3b-thinking-2507 ($0.08), through qwen/qwen3-235b-a22b-thinking-2507 ($0.13), deepseek/deepseek-r1-0528 ($0.5), moonshotai/kimi-k2-thinking ($0.6), up to qwen/qwen3-max- thinking ($0.78). No more qwen3-8b. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 572d176 commit f680957

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

internal/adminapi/recommend.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ var specialisedCoderRegex = regexp.MustCompile(`-coder(-|$|:)`)
4343
// multimodal preset; they're needlessly expensive for plain text.
4444
var specialisedVisionRegex = regexp.MustCompile(`-vl-`)
4545

46+
// thinkingRegex matches model ids that are actually frontier reasoners — the
47+
// `reasoning: true` capability flag alone is not enough (8B models also set
48+
// it just because the API accepts a reasoning parameter). Match the naming
49+
// conventions of genuine reasoning variants.
50+
var thinkingRegex = regexp.MustCompile(
51+
`(-thinking|:thinking|/qwq|/deepseek-r[0-9]|-r1(-|$)|-reasoner)`,
52+
)
53+
4654
// sortStrategy chooses the ordering key for a preset.
4755
type sortStrategy int
4856

@@ -94,13 +102,14 @@ var rolePresets = map[string]rolePreset{
94102
},
95103

96104
"complex": {
97-
Description: "tools + reasoning + multilingual, ≤ $5/M prompt (Claude via bridge is the preferred choice if configured)",
105+
Description: "frontier reasoners only (models with -thinking / -r1 / qwq in name). Tools + multilingual, ≤ $5/M prompt. Claude via bridge is the preferred choice when configured.",
98106
Filter: func(c llm.Capabilities, id string) bool {
99107
return multilingualRegex.MatchString(id) &&
100108
!excludedVendorsRegex.MatchString(id) &&
101109
!specialisedCoderRegex.MatchString(id) &&
102110
!specialisedVisionRegex.MatchString(id) &&
103111
!isFreeVariant(id) &&
112+
thinkingRegex.MatchString(id) &&
104113
c.Tools && c.Reasoning &&
105114
c.PromptPrice > 0 && c.PromptPrice <= 5.0
106115
},

0 commit comments

Comments
 (0)