You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to propose the design for our next major feature: Classification-First Routing.
Our pre-pivot experiments showed that a naive "start cheap, escalate on failure" routing strategy actually loses money (e.g., GPT-4o-mini failing on a hard task and then escalating to GPT-4o is 31% more expensive than just using GPT-4o from the beginning).
To solve this, we are designing a Heuristic Task Classifier that determines the difficulty of a task before sending it to a provider, routing it directly to the right model tier.
The Core Proposal: Heuristic Task Classifier
To keep Modlane local, privacy-friendly, and blisteringly fast, we will use deterministic heuristics (no ML model/API latency) to classify requests in < 1ms.
We will classify incoming requests into three tiers:
FAST (e.g., GPT-4o-mini / Gemini Flash): For simple read-only operations and small context sizes.
BALANCED (e.g., Claude 3.5 Sonnet / GPT-4o): For standard coding, writing files, and medium context.
POWERFUL (e.g., O1-Pro / reasoning models): For hard debugging, active test failures, repeated edits, or massive context.
Repeated Edits: Editing the same file multiple times in a row (indicating the model is stuck in a loop).
Action: Instantly escalate the task to POWERFUL to break the failure loop.
Decision Flow
graph TD
A[Incoming Request] --> B{Any errors, loops, or huge context?}
B -- Yes --> C[Route directly to POWERFUL]
B -- No --> D{Small context AND read-only tools?}
D -- Yes --> E[Route directly to FAST]
D -- No --> F[Default to BALANCED]
Loading
Key Benefits
Zero Latency: Classification runs in memory using simple checks.
80%+ Cost Savings: Diverting read/search operations (which make up the majority of agent runs) to cheaper models.
Robust Loop Breaking: Escales to reasoning models the moment the agent struggles.
Questions for the Community
Do you think 15,000 chars (FAST) and 40,000 chars (POWERFUL) are good default limits, or should they be adjustable in modlane.yaml?
Should we also scan prompt text for keywords like refactor, migrate, or architect to force-route to a higher tier?
Are there any specific coding agent tool names we should add to our EDIT_TOOLS list?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Discussion Title
Discussion Body
Hello David,
I want to propose the design for our next major feature: Classification-First Routing.
Our pre-pivot experiments showed that a naive "start cheap, escalate on failure" routing strategy actually loses money (e.g., GPT-4o-mini failing on a hard task and then escalating to GPT-4o is 31% more expensive than just using GPT-4o from the beginning).
To solve this, we are designing a Heuristic Task Classifier that determines the difficulty of a task before sending it to a provider, routing it directly to the right model tier.
The Core Proposal: Heuristic Task Classifier
To keep Modlane local, privacy-friendly, and blisteringly fast, we will use deterministic heuristics (no ML model/API latency) to classify requests in
< 1ms.We will classify incoming requests into three tiers:
FAST(e.g., GPT-4o-mini / Gemini Flash): For simple read-only operations and small context sizes.BALANCED(e.g., Claude 3.5 Sonnet / GPT-4o): For standard coding, writing files, and medium context.POWERFUL(e.g., O1-Pro / reasoning models): For hard debugging, active test failures, repeated edits, or massive context.The Three Classification Heuristics
1. Context Size (Character Count)
15,000characters.40,000characters (where smaller models start losing retrieval accuracy).2. Intent / Tool Use (Read vs. Edit)
read_file,grep_search,list_dir), it gets routed to FAST.write_to_file,replace_file_content), it goes to BALANCED.3. Execution History (Loops & Failures)
exit status,command failed, or test assertion failures intool_resultmessages. Decision Flow
graph TD A[Incoming Request] --> B{Any errors, loops, or huge context?} B -- Yes --> C[Route directly to POWERFUL] B -- No --> D{Small context AND read-only tools?} D -- Yes --> E[Route directly to FAST] D -- No --> F[Default to BALANCED]Key Benefits
Questions for the Community
15,000chars (FAST) and40,000chars (POWERFUL) are good default limits, or should they be adjustable inmodlane.yaml?refactor,migrate, orarchitectto force-route to a higher tier?EDIT_TOOLSlist?Looking forward to your thoughts and feedback!
Beta Was this translation helpful? Give feedback.
All reactions