multica-ai / multica-ai/multica

[Feature]: Task-type-based model routing for token cost optimization

Open
#2,425 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
50k
Forks
6.5k
Avg merge
1d 23m
Merged PRs (30d)
517

Description

### Deployment type

Self-hosted

### What do you want and why?

I want Multica to support automatic model selection per task type so we can minimize token cost while preserving quality on complex work.

Current behavior:
- Each agent effectively uses a single model setting (or runtime default fallback).
- Comment/chat/autopilot/code-heavy tasks all use the same model unless we manually split agents.

Problem:
- We overpay on lightweight tasks like triage, short replies, and status updates.
- If we switch to a cheaper global model, complex implementation tasks may degrade in quality.
- Managing multiple routing agents manually is operationally heavy and error-prone.

### Proposed solution (optional)

Add an optional model routing policy on agent config, for example:

{
"model_policy": {
"default_model": "gpt-4o-mini",
"chat_model": "gpt-4o-mini",
"comment_model": "gpt-4o-mini",
"issue_model": "gpt-4.1",
"autopilot_model": "o3"
}
}

Routing signals can reuse existing task context fields:
- chat_session_id
- trigger_comment_id
- autopilot_run_id

Execution rule:
1. If model_policy has a match for current task type, use it.
2. Else use agent.model.
3. Else use runtime/provider default.

Optional enhancement:
- Allow routing by prompt length / estimated complexity / repo diff size.
- Emit selected model into task usage logs for observability and cost tuning.

Acceptance criteria:
- One agent can run different task types with different models automatically.
- Backward compatible: existing agents without model_policy behave unchanged.
- Task usage/telemetry clearly records the actual selected model.
- No extra manual reassignment needed for common routing cases.

### Screenshots / mockups (optional)

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.