Add task-aware quality routing - #103
Merged
Merged
Conversation
Reviewer's GuideIntroduce task-aware quality routing with grounded Markdown reading detection, validated per-model task evidence, and explicit task hints propagated through sync/async APIs, CLI, MCP tools, proxy, roles, panel, and cache keying, while ensuring quota/health constraints and existing ordering behavior remain intact when no evidence applies. Sequence diagram for task-aware quality routing and cache keyingsequenceDiagram
actor Client
participant CLI
participant Proxy
participant Pool
participant task_quality
participant Cache
Client->>CLI: freellmpool ask/chat --routing quality --task hint
CLI->>Pool: ask/chat(messages, routing, task)
Client->>Proxy: OpenAI/Anthropic request + X-Freellmpool-Task
Proxy->>task_quality: task_resolution(messages, task)
Proxy->>Pool: chat/stream_chat(messages, routing, task)
Pool->>task_quality: resolve_task(messages, task)
task_quality-->>Pool: resolved_task
Pool->>Cache: make_key(messages, model, providers, routing, task)
Cache-->>Pool: cache_key (hit or miss)
Pool->>Pool: rank_targets(messages, routing, task)
Pool->>task_quality: task_evidence_table(resolved_task)
task_quality-->>Pool: evidence_table
loop each candidate model
Pool->>task_quality: model_task_score(model, evidence_table)
task_quality-->>Pool: task_score or None
end
Pool->>Pool: _order(targets, difficulty, routing, task)
Pool-->>CLI: Reply (provider_id, model)
Pool-->>Proxy: Reply/stream (provider_id, model)
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
Fixes #57
Summary by Sourcery
Add task-aware quality routing with grounded-reading classification and task evidence, and propagate explicit task hints through routing APIs, CLI, MCP tools, proxy, roles, cache, and panels.
New Features:
Enhancements:
Build:
Tests: