Skip to content

Commit 064602a

Browse files
Alexey Panfilovclaude
andcommitted
feat: switch classifier to qwen3:0.6b with few-shot prompt
qwen3:0.6b follows classification instructions reliably unlike gemma3:1b. Few-shot examples in system prompt ensure consistent 1/2/3 output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 624ec33 commit 064602a

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

config/config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ models:
6969
max_tokens: 8192
7070
base_url: https://dashscope-intl.aliyuncs.com/compatible-mode/v1
7171

72-
# Ollama — classifier model (gemma3:1b). No tools needed for classification.
72+
# Ollama — classifier model (qwen3:0.6b). Good instruction following for classification.
7373
ollama:
74-
model: gemma3:1b
74+
model: qwen3:0.6b
7575
base_url: http://host.docker.internal:11434
7676
max_tokens: 64
7777

internal/llm/router.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ import (
1212
"time"
1313
)
1414

15-
const classifierPrompt = `Rate the complexity of this message. Reply with ONLY a single digit:
16-
1 — simple question, chitchat, translation, short factual lookup
17-
2 — moderate task: summarization, code generation, multi-step instructions, analysis
18-
3 — hard problem: math proof, complex debugging, deep multi-step reasoning, research`
15+
const classifierPrompt = `You are a classifier. Output ONLY a single digit 1, 2, or 3.
16+
17+
1 = simple (greeting, chitchat, factual lookup, translation)
18+
2 = moderate (summarization, code, analysis, multi-step)
19+
3 = hard (math proof, deep reasoning, complex debugging)
20+
21+
Examples:
22+
User: hello → 1
23+
User: what is 2+2 → 1
24+
User: write a REST API in Go → 2
25+
User: prove Fermat last theorem → 3`
1926

2027
// RouterConfig holds the keys into the providers map for special roles.
2128
type RouterConfig struct {

0 commit comments

Comments
 (0)