Skip to content

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-2507 on 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.

See every supported model

Steps

How to do it in Tensorant

  1. Create a project

    Choose a base model and the Classification use case. The project's evaluations then offer Classification scoring first.

  2. Import labeled rows

    Upload a CSV with a question column for the text and an answer column for the label, or JSON Lines with the same fields. See how rows are recognized.

  3. 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.

  4. 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.

  5. 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.

Guides

Related guides

Browse all guides

Use cases

Other use cases

See every use case

Start with one dataset.

Create an account and import your data, or book a demo and we will show you the product.