refactor(routing): rename local/claude to fast/thinking model pair
The routing decision is about reasoning capacity, not cost or provider. Fast model (koala/qwen35-9b-fast) handles high-pass-rate calls; thinking model (iguana/gemma4-26b) handles low-pass-rate calls. Removes the implicit Anthropic dependency from the routing pod — both models go through LiteLLM. Renames: HYPERGUILD_LOCAL_MODEL → HYPERGUILD_FAST_MODEL, HYPERGUILD_CLAUDE_MODEL → HYPERGUILD_THINKING_MODEL, Router.LocalModel → FastModel, Router.ClaudeModel → ThinkingModel, log decision "claude_fallback" → "thinking_fallback". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,8 +24,8 @@ type Router struct {
|
||||
Fetcher *Fetcher
|
||||
Logger *Logger
|
||||
Policy Policy
|
||||
LocalModel string
|
||||
ClaudeModel string
|
||||
FastModel string
|
||||
ThinkingModel string
|
||||
Complete CompleteFunc
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ func (r *Router) Run(ctx context.Context, in RunInput) (string, int64, error) {
|
||||
hash := CanonicalHash(in.System, in.User)
|
||||
decision := r.Policy.Decide(pr, hash)
|
||||
|
||||
model := r.ClaudeModel
|
||||
model := r.ThinkingModel
|
||||
if decision == DecideLocal {
|
||||
model = r.LocalModel
|
||||
model = r.FastModel
|
||||
}
|
||||
|
||||
out, ms, err := r.Complete(ctx, model, in.System, in.User)
|
||||
@@ -59,13 +59,13 @@ func (r *Router) Run(ctx context.Context, in RunInput) (string, int64, error) {
|
||||
}
|
||||
|
||||
if err != nil && decision == DecideLocal {
|
||||
slog.Warn("router: local failed, falling open to claude", "skill", in.Skill, "err", err)
|
||||
out, ms, err = r.Complete(ctx, r.ClaudeModel, in.System, in.User)
|
||||
slog.Warn("router: fast failed, falling open to thinking model", "skill", in.Skill, "err", err)
|
||||
out, ms, err = r.Complete(ctx, r.ThinkingModel, in.System, in.User)
|
||||
if lerr := r.Logger.LogDecision(ctx, LogEntry{
|
||||
SessionID: in.SessionID,
|
||||
Skill: in.Skill,
|
||||
Decision: "claude_fallback",
|
||||
Message: fmt.Sprintf("model=%s, after-local-error", r.ClaudeModel),
|
||||
Decision: "thinking_fallback",
|
||||
Message: fmt.Sprintf("model=%s, after-fast-error", r.ThinkingModel),
|
||||
ProjectRoot: in.ProjectRoot,
|
||||
DurationMs: ms,
|
||||
Failed: err != nil,
|
||||
|
||||
Reference in New Issue
Block a user