Work

Independent ML project, 2026

A small model, taught to use tools.

Fine-tuned a 0.5B open model into a reliable IT help-desk agent on one laptop, taking it from 36% to 99% on held-out requests with supervised, preference and reinforcement training.

Role
End-to-end ML engineering: data generation, evaluation harness, fine-tuning, serving, an MCP agent and the results dashboard.
Stack
Python, PyTorch, Transformers, PEFT / LoRA, TRL, MLX, MLflow, MCP, Next.js
Status
Recorded results dashboard
dispatch-two-woad.vercel.app

Sign-in and camera features work best in the full app.

Context

Small open models are cheap and private, but out of the box they are poor at calling tools: they pick the wrong one, break the JSON or act when they should ask a question. Dispatch measures that on an IT service desk with eight tools, fine-tunes Qwen2.5-0.5B-Instruct three ways, measures again and puts the result to work as an agent. Everything was trained, evaluated and served on a MacBook.

What I did

  • Built the evaluation harness and baseline first: 300 held-out requests about people the model never saw, plus 200 drift requests with typos, new phrasing and a changed tool schema.
  • Fine-tuned with LoRA through TRL in three rounds: supervised examples, DPO on mined mistakes and pairs labelled by a local AI judge, and GRPO with deterministic validators as the reward.
  • Served the model behind an OpenAI-compatible endpoint with MLX, compared 16, 8 and 4-bit weights, and benchmarked latency and throughput under concurrent load.
  • Built an MCP agent with an allow-list, schema checks, retries and a step limit, and a Next.js dashboard with side-by-side replies and step-by-step agent traces.

Engineering decisions

A language model is non-deterministic; the tools it calls are not. I put one set of deterministic validators at the centre and used it to measure, to train and to guard the agent.

From a help-desk message to a checked tool call.
  1. MeasureScore 300 held-out and 200 drift requests before any training, and log every run to MLflow.
  2. TeachLoRA fine-tuning with TRL: supervised examples, then DPO on mined mistakes, then GRPO with the validators as the reward.
  3. Serve and actMLX behind an OpenAI-compatible endpoint; the agent checks every proposed call before an MCP tool runs.
Tradeoff
Synthetic, template-generated data made the project possible on one laptop, but it flatters the test score. The drift set, with unseen phrasing and a changed tool schema, is the more honest number at 82%.
Result
Test accuracy from 36.3% to 99.3%, agent task success from 12% to 92%, and an 8-bit model that keeps full accuracy at a little over half the size.

Measure before training.

The harness and baseline existed before any training run, so every later change is a measured difference. Every number on the dashboard is written from the JSON reports, never typed by hand.

One validator, three jobs.

The same deterministic checks score the test set, act as the reinforcement learning reward and drive the green and red checks in the dashboard. That is how a non-deterministic model meets deterministic software.

The agent never trusts the model.

A proposed call must parse, be on an allow-list and satisfy the tool’s schema before the MCP server runs it. The server offers a destructive tool the agent is never allowed to use, and a test proves it is refused.

Scope

A learning project on one laptop GPU with template-generated data, one small model, one domain and eight tools. The drift score (82%) is the more honest measure. MLX stands in where a GPU team would use vLLM; multi-GPU training such as DeepSpeed or FSDP was not run. The public dashboard shows recorded replies from real runs.

Reviewed the repository, model card, evaluation reports and MLflow runs, and explored the public dashboard’s results, compare-replies view and agent traces.

Next projectStoreys