← Back to Discover

Troy

Troy is a command-line tool that runs LoRA fine-tuning on Apple Silicon from a single YAML configuration file.

Fine-tuningCommand-line toolsLocal models

What it does

Troy fine-tunes language models on Apple Silicon using MLX. A training run is described in one troy.yaml file. The troy doctor command checks the chip, unified memory, Metal and MLX, and reports which model sizes the Mac can train. The troy init command writes a troy.yaml from an SFT, DPO or ORPO template, plus sample data to replace with your own. The troy data synth command has a local teacher model write a dataset from your documents or a task description. The troy train command runs LoRA or QLoRA fine-tuning on Metal. The troy chat command streams a conversation with the trained adapter in the same terminal. The troy export command fuses the adapter for deployment. Troy requires an M1 or later.

Capabilities

  • Troy picks the batch size from the Mac's unified memory.
  • Troy detects the data format from the first record. Detected formats include Alpaca, ShareGPT, chat, completions, text and preference pairs.
  • The DPO trainer zeroes the LoRA scales to recover the reference model from the policy model itself. Troy says this uses the same math without a second copy of the weights.
  • The troy export -f gguf command fuses the adapter for llama.cpp, Ollama or LM Studio. The troy export -f ios command fuses and validates the model for MLX Swift, covering architecture, tokenizer and memory fit.
  • The troy mesh serve command coordinates data generation. iPhones running TroyWorker and Macs running troy mesh join generate training data, and Troy validates the results centrally.

When to use it

  • You want to fine-tune a model on a Mac you already own, without CUDA or a cloud service.
  • You have no dataset and want a local teacher model to write one from your documents or a task description.
  • You want to run a fine-tuned model in your iPhone app using a dozen lines of Swift, or ship it to llama.cpp, Ollama or LM Studio.