A Simple Example-Trained Intent Router Using OpenAI gpt-oss Models
Recently, I made a simple example-trained Intent Router through vibe coding with ChatGPT.
In my current setup, although we have other models in store, the router mainly works well with OpenAI’s gpt-oss:20b and gpt-oss:120b models. The 20B model provides a faster option, while the 120B model is preferred for more demanding coding and reasoning tasks.
The router sits in front of these models and attempts to decide which one, or which other specialised endpoint, is best suited to each request.
Here is a short showcase of the current version:
The routing process
The main workflow takes place inside the Route Console.
First, the user enters a request. This can include ordinary text, code, or supported file types.
When Understand Intent is pressed, the request is not immediately sent to gpt-oss:20b, gpt-oss:120b, or another model.
Instead, the router:
-
Converts the request into an embedding.
-
Compares it with previously taught examples.
-
Finds the closest intent examples using cosine similarity.
-
Uses those examples to produce a structured description of the request.
-
Determines the input, output, and capabilities required.
-
Compares those requirements with the models in its registry.
-
Recommends the most suitable compatible model.
The routing result includes:
-
Request type
-
Requested action
-
Information being used
-
Expected result
-
Required capabilities
-
Intent confidence
-
Closest learned example
-
Recommended model
For example, a PHP debugging request might be interpreted as:
-
Request type: code analysis
-
Action: debugging
-
Input: text and code
-
Output: corrected code
-
Required capabilities: coding and debugging
For this kind of request, the router may prefer gpt-oss:120b because it is registered as the stronger reasoning and coding option.
For a simpler or more time-sensitive request, gpt-oss:20b may receive a higher ranking because it can provide a faster response while still supporting the required capabilities.
The exact choice depends on the detected intent and the metadata stored for each model.
Understanding before execution
The Route Console separates the process into two actions.
Understand Intent analyses the request and displays the proposed route.
Run Selected Model sends the original request to the chosen endpoint.
I separated these stages so that the routing decision can be inspected before execution.
This makes it possible to see:
-
What the router thinks the request means
-
Which abilities it believes are required
-
Which model it recommends
-
Which examples influenced the decision
-
Whether its confidence is high enough to continue
When confidence is too low, or two possible meanings are too close, the router can pause instead of automatically selecting a model.
This is useful because even a powerful model such as gpt-oss:120b cannot fix a request that has already been routed using the wrong assumptions.
Teach Intent
The Teach Intent tab is where the router learns what different user requests mean.
Each training record begins with an example request, such as:
-
“Debug this PHP code.”
-
“Generate an image of a lighthouse.”
-
“Describe the attached photograph.”
-
“Transcribe this audio recording.”
The example is then connected to structured intent information:
-
Task family
-
Action
-
Input modalities
-
Output modalities
-
Required capabilities
-
Route shape
-
Reasoning complexity
The router therefore learns from complete examples rather than only checking for individual keywords.
When a new request is submitted, its embedding is compared with the stored examples. The nearest examples vote on the likely meaning of the request.
If the router misunderstands something, I can add or adjust examples in Teach Intent and rebuild the index.
The aim is to improve the router through understandable training records rather than hiding every decision inside a large prompt.
Models
The Models tab contains the endpoints available to the router.
In my current registry, gpt-oss:20b and gpt-oss:120b act as the main general-purpose models.
Each registered model includes metadata such as:
-
Display name
-
Model endpoint
-
Local or remote provider
-
Supported inputs
-
Supported outputs
-
Capabilities
-
Context length
-
Quality score
-
Speed score
-
Priority
-
Availability
-
Endpoint health
-
Measured response time
For example, I can register gpt-oss:120b with a higher quality and reasoning score, while gpt-oss:20b can have a stronger speed score.
The router compares this model information with the structured intent produced from the request.
A model must first support the required input and output types. Its capabilities are then compared with the abilities required by the task.
The remaining models are ranked using factors including:
-
Capability compatibility
-
Input and output compatibility
-
Quality
-
Speed
-
Registry priority
-
Locality
-
Endpoint health
This allows gpt-oss:120b to remain the preferred model for complex general tasks without forcing every small request through the largest available model.
It also allows specialised models to outrank both gpt-oss models when a request requires something different, such as image generation, vision, transcription, or speech.
Manual model overrides
Automatic routing can remain enabled, but the user can also select a model manually.
When an override is used, the interface still shows:
-
The detected intent
-
The automatically recommended model
-
The manually selected model
-
The final model response
This has been useful for comparing the router’s recommendation with direct tests of gpt-oss:20b and gpt-oss:120b.
It also makes failures easier to investigate. I can determine whether the problem came from the intent prediction, the model ranking, the endpoint, or the selected model’s answer.
How the router is built
The current router is a small hybrid experiment rather than a fully trained neural classifier.
It combines:
-
Example-based intent teaching
-
Embeddings
-
Cosine similarity
-
Weighted voting
-
Structured intent frames
-
Confidence thresholds
-
Capability matching
-
Deterministic model ranking
-
OpenAI gpt-oss model endpoints
The project itself was built largely through experimentation and collaboration with ChatGPT.
It has helped me better understand the layer between receiving a user request and deciding whether it should be handled by gpt-oss:20b, gpt-oss:120b, or a more specialised model.
It is not production-ready, but it has become a useful practical experiment in intent recognition and multi-model routing.
I would be interested in any thoughts on improving the training examples, confidence calculation, model ranking, evaluation system, or the balance between gpt-oss:20b and gpt-oss:120b.
