Local LLM Routing: When Ollama Answers and When Cursor Takes Over

The rapid integration of Large Language Models into modern software development has created an operational dilemma for engineers. Frontier cloud models (such as Claude 3.5 Sonnet and GPT-4o) offer extraordinary reasoning and refactoring capabilities, but they incur ongoing token costs, introduce network latency, and present privacy considerations for proprietary codebases.

Conversely, local open-weight models (running via Ollama or vLLM) provide complete data privacy, zero API costs, and offline availability, but struggle with complex architectural planning and deep repository reasoning. To get the best of both worlds, I built a tiered AI routing architecture that automatically delegates tasks to the optimal model based on prompt complexity.

Rather than treating all coding queries identically, our smart routing architecture partitions AI tasks into three distinct operational tiers defined in `models.json`.

← Rafael González Albes