CoolFace
Modelpublic

BCN001/llm-complexity-router

sourceHugging Facecc-by-nc-4.0updated 5mo agoView on Hugging Face
1likes31downloads
Model Card

LLM Complexity Router

A fine-tuned DeBERTa-v3-small classifier that routes queries between gpt-4o-mini (cheap) and gpt-4o (expensive) — saving ~41% cost while improving response quality vs always using the expensive model.

Performance (WildBench — 200 real user queries)

StrategyQuality (1-10)Cost/1K% CheapQuality ΔCost Saved
always_expensive8.11$6.000%baselinebaseline
length_based8.02$3.3547%-0.09+44.2%
deberta_router8.24$3.5543.5%+0.13+40.9%
routellm_mf7.96$3.6042.5%-0.15+39.9%
Only router that beats the expensive baseline on quality and saves cost.

Category Breakdown (vs always_expensive)

CategoryRouterBaselineΔ
Advice seeking9.509.00+0.50
Brainstorming8.408.20+0.20
Coding & Debugging7.737.89-0.16
Creative Writing8.007.74+0.26
Data Analysis9.209.00+0.20
Editing8.408.40+0.00
Information seeking8.117.83+0.28
Math8.337.83+0.50
Planning8.598.77-0.18
Reasoning8.828.61+0.21
Role playing7.006.71+0.29

Usage

python
from transformers import pipeline

classifier = pipeline(
    "text-classification",
    model="your-username/complexity-router"
)

result = classifier("What is the capital of France?")
# → [{'label': 'SIMPLE', 'score': 0.98}]  → route to gpt-4o-mini

result = classifier("Prove the Riemann hypothesis step by step")
# → [{'label': 'COMPLEX', 'score': 0.95}]  → route to gpt-4o

Training

  • Base model: microsoft/deberta-v3-small
  • Training data: proprietary (not released)
  • Labels: SIMPLE / COMPLEX
  • Benchmarked against: RouteLLM mf router, length-based baseline

Limitations

  • Weaker on Coding & Debugging (-0.16) and Planning (-0.18)
  • Optimized for gpt-4o vs gpt-4o-mini routing specifically
  • Training data distribution may not match all use cases