Route before you generate: intent classification as a cost control

Most requests to an AI product do not need a large model. A small classifier in front of the LLM decides which ones do, and it is the cheapest cost control you can add.

By Deepak Kushwaha5 min read

The default architecture for an AI feature sends every request to the most capable model available. It is the fastest way to a working product and the fastest way to a bill that grows in step with usage.

Look at the traffic of almost any assistant and a pattern appears. A large share of requests are greetings, status checks, navigation questions and repeats of things asked an hour ago. They are being answered by a model built for multi-step reasoning.

Classify first, with something small

Intent routing puts a decision in front of the model. Each request is embedded and passed to a small classifier that assigns it an intent. The important design choice is that this step does not use a large language model. An embedding model and a lightweight classifier answer in milliseconds, cost almost nothing per call and behave the same way every time.

Once the intent is known, the request goes where it belongs:

  • Known questions with stable answers are served from a cache or a rule.
  • Narrow, repetitive tasks such as extraction and classification go to a small language model.
  • Requests that need reasoning over context go to a large model.
  • Anything outside the product’s scope is declined before it costs anything.

Small models, selected per workload

Routing is what makes small language models practical. A general assistant cannot run on a small model, but a well-defined task often can. The selection is made per workload, by measuring candidates against an evaluation set for that task, and a cheaper model is adopted only when it scores as well as the one it replaces.

At Metis Labs this is how the stack is run: intent routing ahead of LLM calls, open-weight small models served on our own GPUs for the workloads that suit them, and a LiteLLM gateway in front of everything so that budgets, fallbacks and attribution are enforced in one place.

What it takes to do it properly

  • Labelled examples from real traffic. A few hundred per intent is enough to start.
  • A fallback path: when the classifier is unsure, send the request to the large model.
  • Evaluation on both sides, covering router accuracy and the answer quality of every route.
  • Attribution, so spend is visible by feature and tenant.

Start with measurement

Before building anything, sample a week of requests and label them by what they needed. The share that did not need a large model is the size of the opportunity. If it is small, routing is not your problem and context size or caching probably is. If it is large, a router is a few days of work that pays back every month afterwards.

How I work on LLMOps & AI cost governance

Reply within 24 hours

Facing this in your own system?

The first call is free and takes 30 minutes. You leave with a scope outline and a price range, whether or not we work together.

Or build a project brief in one minute