Skip to main content

2 posts tagged with "routing"

View all tags
intermediatePart 9

Route each question to the right Qdrant collection, with one embedder

· 10 min read
Rafael Fernandes
NLP Engineer & Tech Writer at WiLine
Share:
Qdrant+
0/9
🎯 Skill path0/9 earned
AI evals & observability

The RAG capstone put the whole docs corpus in one vector collection and searched it for every question. That works until your corpus spans several domains that share vocabulary. Ask "how do I open a firewall port?" against one mixed collection and the top results can include compute or storage chunks that happen to mention ports — noise the generator then has to reason around.

The fix is older than RAG: don't search everything, search the right shelf. Split the corpus into one collection per domain, decide which domain a question belongs to, and search only that one. The twist that makes it cheap: you can do the deciding with the same embedder you already use for retrieval — no second model.

intermediatePart 2

LiteLLM complexity routing: the right model for each request, and what it costs in latency

· 12 min read
Rafael Fernandes
NLP Engineer & Tech Writer at WiLine
Share:
LiteLLM+Qwen+
0/5
🎯 Skill path0/5 earned
Self-hosting an LLM gateway

Part 1 ended on an uncomfortable number. The same three-word answer cost 3 tokens from a small model and 200 from a reasoning model — which spent all 200 thinking and returned nothing at all.

Every request your apps send picks a model, and mostly that choice is made once, hardcoded, and never revisited. This post puts the gateway in charge of it instead: classify the request, route it to a model sized for the work. Then it measures what that decision costs, because it is not free and most write-ups skip that part.