Ahmed (@_Ahmed_Nav) profile picture

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
Photo by Ahmed (@_Ahmed_Nav)
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
Most routers compete on catalog breadth. But a router shouldn't just be a cost-optimization layer; it should be a safety layer that happens to save money. Building the logic was fun. Realizing what to route around was the actual product insight. (3/3)
1
5
🚀 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
Python code snippet showing an asynchronous hybrid LLM routing function based on prompt complexity
1
8
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