
Building Hybrid Router — an LLM gateway that routes prompts to the cheapest capable model and strips PII before it's sent | CS, Chennai | SDE Intern
TamilNadu, India
Joined July 2026
- Tweets77
- Following59
- Followers9
- Likes9
PII redaction before the prompt ever leaves your server. 🛡️
Everyone building an LLM router competes on model catalog size and price arbitrage. I almost did too—until I realized the real problem is data privacy👇
(1/3)
1
1
31
Instead of just routing to the cheapest model, my gateway intercepts the query and scrubs PII (emails, phone numbers, SSNs) using Microsoft Presidio and spaCy NER.
The routing decision only happens after the payload is sanitized.
(2/3)
1
1
21
🚀 Just shipped a hybrid LLM router that classifies prompts and dynamically routes them to the cheapest capable model.
Stop using a sledgehammer to crack a nut. Sending "hi" to GPT-4o shouldn't cost the same infrastructure overhead as a complex reasoning task.
(1/2) 👇
2
1
21
The architecture:
• Lightweight text classifier (sub-100ms routing)
• 42% cost reduction across a 500-query prod simulation
• Async fallback handling if the target model fails
The real engineering wasn't the LLM API call, it's everything around it. Code below! (2/2)
1
1
15
Check out the full open-source repo here:
github.com/Ahmed-Nav/hybrid-…
1
8
