Classification and routing
Fine-tune an LLM for text classification and routing
Train an open model to answer with one label from your list. Tag intents, route tickets and flag what needs a person, scored per label.
The problem
Why not ask a general model for the label?
A general model can answer with a label that is not on your list, or put the label inside a sentence. It can also apply your rules unevenly from one request to the next, so two similar tickets go to different teams.
Your code needs one label from your list on every request, so it can check the answer and act on it. A model fine-tuned on your labeled examples is trained to answer that way, and you can measure how often it does before you publish it.
How it works
What a fine-tuned classifier learns
- The model trains on rows you have already labeled, with the text as the question and the label as the answer, as the Classification use case describes.
- Classification scoring takes your allowed labels and counts an answer outside them as wrong. It reports each label's accuracy and a confusion matrix, so you see which labels the model mixes up. See Classification.
- For a probability on each label, train a decision model instead. It scores every label and never answers outside them. See Scoring and ranking.
In practice
A run on Tensorant
- On November 7, 2026, we fine-tuned
Qwen/Qwen3-4B-Instruct-2507on Tensorant compute, with 360 training rows of SetFit/emotion, a public dataset of short texts, each labeled with an emotion. - The run was LoRA SFT for 2 epochs. Training took 8 minutes 10 seconds on one L4 GPU.
- On the same 80 test rows, the base model scored 47.5% exact match and the adapter scored 83.75%. Of those 80 answers, 29 improved and none got worse.
Models
Models to start with
Start with a small instruct model. Every family Tensorant trains is in Supported models.
Qwen/Qwen3-4B-Instruct-2507
The model of the run above.
HuggingFaceTB/SmolLM2-1.7B-Instruct
A small instruct model built on Llama's architecture. It answers directly, without reasoning first.
unsloth/Llama-3.2-1B-Instruct
An ungated copy of Llama 3.2 1B Instruct, the smallest of these four.
mistralai/Mistral-7B-Instruct-v0.3
A larger model to try if a small one falls short on your test set.
Steps
How to do it in Tensorant
Create a project
Choose a base model and the Classification use case. The project's evaluations then offer Classification scoring first.
Import labeled rows
Upload a CSV with a
questioncolumn for the text and ananswercolumn for the label, or JSON Lines with the same fields. See how rows are recognized.Freeze a version
Approve the examples in Review and create a version. It splits them into training, validation and test examples, and holds the test examples out for scoring.
Run an experiment
An experiment scores the base model, trains an adapter and scores the adapter on the same test examples. Score it as Classification, and check the allowed labels it fills in from your test set.
Publish it and call it
Give the adapter a name in API models and call it with the OpenAI SDK. See the API quickstart.
Plans
What you need
- Text fine-tuning, evaluations and publishing are on every organization, with the same limits for all. Each training run pays a training-token fee from credits. See Limits on every organization.
- GPUs come from Tensorant compute, charged per second from prepaid credits, which an owner adds under Settings, Plan and billing (the first payment turns Tensorant compute on), or from a GPU account you connect with the Own compute subscription. See connections.
Fine-tuning
Fine-tune Qwen on RunPod with Tensorant
Build a support-ticket classifier with Qwen, review labeled examples, compare a LoRA adapter against the base model, and publish an API.
Evaluation
How to evaluate a fine-tuned LLM against its base model
Build useful LLM evals in Tensorant, score a support-ticket classifier, compare base and tuned models, and investigate regressions before deployment.
Fine-tuning
Train a calibrated decision model with kev
Fine-tune kev, a 400M ModernBERT scorer, on typed decisions, check calibration quality, and gate the run with measured scores and cost.
Private and sensitive data
Medical, legal and financial records: what Tensorant stores, where it runs, and what can stay in your cloud.
JSON extraction
Pull the fields your code needs out of invoices, forms and emails, as JSON that fits your schema.
Replace a costly LLM API
Train an open model on the answers your API model gives, and switch when it scores as well.
Small language models
Fine-tune a 1B to 4B model for one narrow job, and download the adapter.
Scoring and ranking
Score each candidate answer with a calibrated probability, with a decision model such as kev.
Reinforcement learning
Train with GRPO against a reward that checks each answer: a label, a number, JSON or your own code.
Migrate from OpenAI fine-tuning
OpenAI ends fine-tuning in January 2027. Move your data, train an open model and compare the two.
Start with one dataset.
Create an account and import your data, or book a demo and we will show you the product.