Skip to content

feat: auto model routing for SkillFlows#51

Open
RiteshTiwari1 wants to merge 1 commit into
open-gitagent:mainfrom
RiteshTiwari1:feat/auto-model-routing
Open

feat: auto model routing for SkillFlows#51
RiteshTiwari1 wants to merge 1 commit into
open-gitagent:mainfrom
RiteshTiwari1:feat/auto-model-routing

Conversation

@RiteshTiwari1
Copy link
Copy Markdown

Addresses #48

Summary

Adds automatic model routing for SkillFlows. Each step is classified by
complexity at runtime and routed to the right model — lightweight tasks
(summarize / extract / classify / transform) run on a cheaper model, while
reasoning-intensive tasks (planning / decision-making / tool orchestration)
stay on the configured reasoning model. Reduces token usage and cost without
sacrificing quality on complex steps.

How it works

Model resolution per step, in priority order:

  1. Explicit per-step model: in workflows/*.yaml
  2. Per-skill model: in SKILL.md
  3. Automatic classification via model.routing tiers
  4. Fallback to the preferred model

Unknown / ambiguous tasks default to reasoning, so cost optimization never
silently degrades quality. Routing is opt-in — active only when a
model.routing block is present, so existing agents are unaffected.

Configuration (agent.yaml)

model:
  preferred: "openai:gpt-5-reasoning"
  routing:
    lightweight: "openai:gpt-4o-mini"
    reasoning:   "openai:gpt-5-reasoning"

Scope note

Routing is applied at the SkillFlow step level — where GitAgent runs
discrete tasks in sequence. Per-turn routing inside a single agent loop would
need deeper pi-agent-core changes; happy to follow up if that's preferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant