Agentic AI routing

LLM Router

A lightweight task classifier that labels a prompt as simple, coding, reasoning, security, or summarization so an agentic system can choose a suitable model.

Published model, MIT licensed9 October 2026

The engineering problem

An agentic system rarely needs its most capable and expensive model for every request. Routing each prompt to a suitable model needs a fast, inexpensive way to judge what kind of task it is, and that decision should not break when the available models change.

Design

The classifier predicts a task category only. It has no knowledge of any model provider, price, or endpoint, so the registry it routes to can change without retraining. The categories are coding, reasoning, security, simple, and summarization.

Prompt → sentence embedding → logistic regression → category and confidence → model selection (in the calling system).

The published artifact combines sentence-transformers/all-MiniLM-L6-v2 embeddings with a scikit-learn LogisticRegression classifier. A companion llm-router Python package wraps it, and the model card documents a confidence threshold of 0.45, below which a prediction should be treated as not confident enough rather than trusted.

Scope and contribution

The model, its training dataset, and the package are published on the owner-confirmed Hugging Face profile. The artifact repository includes the trained classifier, a metadata file with the evaluation, label mapping, and a training configuration recording split sizes, seed, and hyperparameters, which supports reproducibility. This note summarizes the public model card; the model-selection logic and any production use are not part of the published artifact.

Evaluation status

The model card reports accuracy and macro F1 of 0.996 on validation and 0.988 on test, using a dataset of about 1,700 examples with 340 per category. These are the author's reported figures. This website has not reproduced them. Because the data is small, balanced, and drawn from the same source as the training split, results on real, messy prompts may differ. The confidence threshold also needs recalibrating against a team's own held-out prompts. A stronger evaluation would document how the prompts were collected and test on out-of-distribution, ambiguous, and multi-intent requests.

Limits and next steps

The classifier answers one question: what kind of task is this prompt. It does not call a model, track availability or cost, or guarantee that the chosen model is best. Next steps include evaluation on real traffic, handling prompts that fit several categories, and measuring the cost and quality effect of routing in a complete workflow. The portfolio does not run this model.

Inspect the artifact

Read the model card, with usage, labels, and evaluation details. The training dataset is published separately.

Source reviewed on 13 October 2026.

Have a similar question?Discuss a similar project

LET’S BUILD SOMETHING USEFUL

Start with a problem.
Let’s find the right approach.

Bring your idea, your existing prototype, or a workflow that could work better.

Discuss a Project