Teaching a small AI model to use tools reliably
Dispatch is an AI assistant for an IT help desk. When an employee writes in, it has to pick the right action, such as resetting a password or logging a problem, and fill in the details correctly. It runs on a small, free, open AI model. Out of the box that model gets 36.3% of requests right. This project measures that, teaches the model, and measures again. All of it ran on one laptop.
How the project works
- 1Measure
Give the model 300 requests it has never seen and count how many it handles correctly.
- 2Teach
Train it with worked examples first, then try two further methods on top of that.
- 3Measure again
Same 300 requests, same automatic scoring, so the comparison is fair.
- 4Put it to work
Let it handle whole tasks from start to finish using real tools.
How often the model gets it right
Out of 300 requests the model had never seen. "Right" means the correct action with every detail correct, or a plain reply when no action was needed. A program does the scoring, so there is no judgement call.
A closer look
The same test, broken into the separate things the model has to get right.
| What was measured | Before | Examples | Comparisons | Practice |
|---|---|---|---|---|
Got it completely right the headline number | 36.3% | 98% | 98.7% | 99.3% |
Picked the right tool when a tool was needed | 43.8% | 100% | 100% | 100% |
Right tool and every detail right the correct person, system, date and so on | 24.3% | 97.1% | 98.1% | 99% |
Wrote the request in a usable format software could read what the model wrote | 76.7% | 100% | 100% | 100% |
Knew when not to use a tool asked a question or just replied instead | 64.4% | 100% | 100% | 100% |
Typical response time thousandths of a second, on a laptop | 399 ms | 446 ms | 449 ms | 448 ms |
Finished a whole task 50 tasks, several steps each, using real tools | 12% | 88% | 92% | 92% |
Columns: Before = out of the box; Examples = after learning from examples; Comparisons = after learning from comparisons; Practice = after practice with scoring.
Does it hold up on messier requests?
Real people make typos, use slang, and ask for things in new ways. A second set of 200 rougher requests checks how much accuracy slips. One tool was also changed after training, to see whether the model adapts.
Which kinds of request are hard
How often each kind of request was handled correctly. Some tasks take several steps; each step is scored separately.
| Kind of request | How many | Before | Examples | Comparisons | Practice |
|---|---|---|---|---|---|
| Check a laptop or phone | 15 | 100% | 100% | 100% | 100% |
| Check a software licence | 15 | 73.3% | 100% | 100% | 100% |
| Decline an off-topic request | 14 | 71.4% | 100% | 100% | 100% |
| Ask for a missing detail | 28 | 0% | 100% | 100% | 100% |
| Log a new problem | 21 | 14.3% | 100% | 100% | 100% |
| Escalate an open problem | 14 | 7.1% | 100% | 100% | 100% |
| Multi-step callback booking: step 1, find the person | 19 | 0% | 100% | 100% | 100% |
| Multi-step callback booking: step 2, do the task | 19 | 0% | 78.9% | 94.7% | 100% |
| Multi-step callback booking: step 3, report back | 19 | 100% | 100% | 100% | 100% |
| Multi-step device check: step 1, find the person | 14 | 0% | 100% | 100% | 100% |
| Multi-step device check: step 2, do the task | 14 | 0% | 100% | 100% | 100% |
| Multi-step device check: step 3, report back | 14 | 100% | 100% | 100% | 100% |
| Multi-step licence check: step 1, find the person | 6 | 33.3% | 100% | 100% | 100% |
| Multi-step licence check: step 2, do the task | 6 | 0% | 100% | 100% | 100% |
| Multi-step licence check: step 3, report back | 6 | 100% | 100% | 100% | 100% |
| Multi-step password reset: step 1, find the person | 9 | 22.2% | 100% | 100% | 100% |
| Multi-step password reset: step 2, do the task | 9 | 0% | 100% | 100% | 100% |
| Multi-step password reset: step 3, report back | 9 | 100% | 100% | 100% | 100% |
| Look up an employee | 10 | 100% | 100% | 100% | 100% |
| Reset a password | 17 | 5.9% | 100% | 100% | 100% |
| Book a callback | 13 | 7.7% | 84.6% | 76.9% | 84.6% |
| Find a how-to guide | 9 | 55.6% | 100% | 100% | 100% |
What went wrong, when it went wrong
Every wrong reply, sorted by the kind of mistake.
What each round of teaching took
Only a small slice of the model is changed in each round. The rest stays exactly as downloaded, which is why this fits on a laptop.
| Round | Minutes | Memory used | Share of model changed |
|---|---|---|---|
| Examples | 65 | 11.64 GB | 1.75% |
| Comparisons | 34.8 | 11.54 GB | 1.75% |
| Practice | 210.1 | 19.62 GB | 1.75% |
For the comparisons round, a larger AI model running on the same laptop acted as the judge, picking the better of two replies 54 times. Its choices were double-checked against a fixed checklist on 40 pairs and matched 55% of the time.
Watching the model learn
Recorded live during training. For the first two rounds the line shows how far off the model's answers were. For the practice round it shows the average score its attempts earned.
How much teaching does it need?
The same first round of teaching, repeated with fewer examples each time. Everything else was kept the same, and every version took the same tests.
| Examples | Test | Messy | Minutes |
|---|---|---|---|
| None | 36.3% | 32% | - |
| 250 | 79.7% | 63.5% | 6.2 |
| 500 | 88.3% | 66% | 12.4 |
| 1,000 | 94% | 79% | 25.3 |
| 2,500 | 98% | 81.5% | 65 |
With 250 examples the model got 79.7% of test requests right after 6.2 minutes of training. With 2,500 it got 98%, after 65 minutes. On messy requests it went from 63.5% to 81.5%.
What went wrong along the way, and what was done about it
Not everything worked first time. These are the problems the measurements caught.
The first try at learning from comparisons dropped accuracy from 98% to 58.3%. The model had stopped finishing its requests properly, so 123 of 300 replies could not be read. The automatic scoring caught it straight away. The second try keeps rewarding complete, correct answers while it learns, and scores 98.7%.
On simple one-step tasks it would repeat an action it had just carried out, such as resetting a password twice, before replying. A safety check now blocks an exact repeat. Whole tasks completed went from 80% to 88% for the examples-trained model and from 78% to 92% for the practice-trained one. The root cause is a gap in the teaching examples, which had no simple tasks ending in a reply.
When a larger AI model was asked to pick the better of two replies, its choices matched a fixed checklist only 55% of the time, and it picked whichever reply was shown first 25.9% of the time, where an unbiased judge would be near 50%. Its opinions were used for only 54 of 634 comparisons. The rest were decided by code.
A half-size copy scores 99.3%, the same as full size (99.3%). A quarter-size copy is faster but drops to 89.3%. Half size is the sensible choice here.
Running it on a laptop
The finished model can be shrunk to take less space and answer faster. The question is how much accuracy that costs.
| Copy of the model | File size | Gets it right | Speed |
|---|---|---|---|
| Full size | 1000 MB | 99.3% | 132.4/s |
| Half size | 568 MB | 99.3% | 154.1/s |
| Quarter size | 321 MB | 89.3% | 177.2/s |
What happens when several people ask at once:
| People asking at once | Replies per second | Typical wait |
|---|---|---|
| 1 | 3.61 | 0.3 s |
| 4 | 6.15 | 0.7 s |
| 16 | 8.51 | 1.7 s |
| 32 | 8.78 | 3.6 s |
Making training fit on a laptop
Training needs far more memory than answering. The same short training job was run four ways to see what each trick saves and what it costs in speed.
| Approach | Memory used | Seconds per step |
|---|---|---|
| The setting used | 10.55 GB | 6.142 |
| Fewer examples at a time | 7.24 GB | 5.792 |
| Recompute instead of remember | 10.55 GB | 6.136 |
| Less precise numbers | 9.92 GB | 6.079 |
The eight things the assistant can do
Each one is a “tool”: a specific action the assistant can ask the help desk system to carry out.
- Look up an employeeFind an employee record by work email. Returns employee_id, name, department and device_id.
- Check a laptop or phoneGet health and warranty status for a company device.
- Reset a passwordReset an employee's password for one system and send a temporary password.
- Log a new problemOpen a new IT support ticket.
- Escalate an open problemEscalate an existing ticket to the tier-2 team.
- Find a how-to guideSearch the IT knowledge base for how-to articles.
- Check a software licenceCheck whether an employee holds a licence for a software product.
- Book a callbackBook a phone callback from a technician.
What to keep in mind
- The requests are made up. The company, employees and requests are all invented: 2,500 for teaching, 300 held back for testing, and 200 messier ones. No real person's data was used.
- The test is fair. The model is tested on employees and details it never saw while learning.
- Scoring is automatic. A program checks every reply, so results are repeatable and nobody's opinion is involved.
- Real conversations are messier. Made-up requests are tidier than real ones. The messy set is the closest stand-in.
- This is laptop scale. A production system would use larger models on dedicated servers. The method is the same.
For technical readers
The plain names on this page, and what they are called in the field.
- The model
- Qwen/Qwen2.5-0.5B-Instruct, an open-weight language model with about half a billion parameters.
- After learning from examples
- Supervised fine-tuning (SFT) with LoRA adapters, using Hugging Face TRL's SFTTrainer.
- After learning from comparisons
- Direct Preference Optimization (DPO). Pairs come from mined errors and from a local AI judge (RLAIF).
- After practice with scoring
- Group Relative Policy Optimization (GRPO), a reinforcement-learning method. The reward is deterministic validator code.
- Automatic scoring
- Deterministic validators: output parsing, JSON Schema validation, tool and argument matching.
- Messier requests
- A drift set: unseen phrasings, noise, and a schema change, to estimate degradation after deployment.
- Whole tasks with real tools
- An agent loop over a Model Context Protocol (MCP) server, with an allow-list and schema checks before execution.
- Shrinking the model
- Quantization to 8-bit and 4-bit weights, served with MLX behind an OpenAI-compatible API.
- Run tracking
- Every training and evaluation run is logged to MLflow. PyTorch, Transformers, PEFT and Accelerate underneath.
Results generated 2026-11-19 10:43:00 from code version daf7499.