A fast, lightweight 3-class classifier that decides how many thinking tokens a query needs — before you spend them.
Built on DistilBERT (66M params), fine-tuned to classify any user message into one of three thinking budget tiers:
Label
Budget
Meaning
no_thinking
0 tokens
Direct lookup or trivial — answer immediately
brief_thinking
~512 tokens
Structured reasoning needed, but not exhaustive
deep_thinking
8192+ tokens
Full chain-of-thought required
Why This Exists
Modern reasoning models — Qwen3, DeepSeek-R1, Claude 3.7 Sonnet (extended thinking), Gemini 2.0 Flash Thinking — all support a configurable thinking budget. But most users either always use maximum thinking (slow, expensive) or never use it (misses hard problems).
ThinkingBudgetRouter makes this decision in ~10ms on CPU, before any tokens are spent reasoning.
Quick Start
python
1from transformers import pipeline
23router = pipeline("text-classification", model="tripathyShaswata/ThinkingBudgetRouter")45# Single prediction6result = router("What is the capital of France?")7print(result)8# [{'label': 'no_thinking', 'score': 0.97}]910# Batch11queries =[12"What is 15 + 27?",# no_thinking13"What does HTTP stand for?",# no_thinking14"Write a Python function to merge two sorted arrays.",# brief_thinking15"Explain how Dijkstra's algorithm works step by step.",# brief_thinking16"Design a distributed rate limiter for 1 billion users.",# deep_thinking17"Prove there are infinitely many prime numbers.",# deep_thinking18"Debug this race condition in async code: ...",# deep_thinking19]20results = router(queries)21for q, r inzip(queries, results):22print(f" {r['label']:>16} ({r['score']:.2f}) — {q}")