Troy
Fine-tune LLMs on your MacBook with one YAML file.
Troy is a command-line tool for fine-tuning and preference-tuning language models locally on Apple Silicon. No CUDA, no cloud, no training pipeline — write a config, run one command, and train on the machine you already own.
Built on MLX and mlx-lm, Apple's ML framework for Apple Silicon. Unified memory means a 36 GB MacBook fine-tunes models that need a workstation GPU anywhere else.
Requirements
- Apple Silicon Mac (M1 or later)
- macOS 14+
- Python 3.10–3.12
Install
brew install avirajkhare00/troy/troy
# or: pipx install troy-cli
Quickstart
troy doctor # check your Mac: chip, memory, MLX, what you can train
troy init # create troy.yaml + sample data
troy train # fine-tune (LoRA/QLoRA via MLX)
troy chat # talk to the result
troy serve # OpenAI-compatible API at localhost:8080/v1
troy export -f gguf # ship it to llama.cpp / Ollama / LM Studio
The config is the interface
base: mlx-community/Qwen3-0.6B-4bit
task: sft # or: dpo, orpo
data:
train: ./data/train.jsonl # alpaca, sharegpt, chat, completions, text — auto-detected
val_split: 0.1
training:
epochs: 3
lr: 1e-5
batch_size: auto # sized from your Mac's unified memory
lora:
r: 8
alpha: 16
output: ./output
Commands
| Command | Purpose |
|---|---|
troy init |
Create a config from a template (chat, dpo) |
troy doctor |
Hardware + dependency check, with model-size guidance |
troy train |
LoRA fine-tuning: SFT, DPO, or ORPO |
troy chat |
Interactive REPL (or -p for one-shot) with your adapter |
troy eval |
Base-vs-tuned val loss, perplexity, side-by-side samples |
troy serve |
OpenAI-compatible API server for your model |
troy export |
Fuse the adapter; export MLX or GGUF |
troy push |
Upload adapter or fused model to the Hugging Face Hub |
troy data inspect |
Dataset stats and format detection |
What Troy can train on your Mac
| Unified memory | Max model (4-bit QLoRA) |
|---|---|
| 8 GB | ~1.5B |
| 16 GB | ~4B |
| 24 GB | ~8B |
| 36 GB | ~14B |
| 64 GB | ~32B |
| 128 GB | ~70B |
DPO without a second model
DPO normally keeps a frozen reference copy of the model in memory. Troy zeroes the LoRA scales to recover the reference model from the policy model itself — no second copy, which matters on unified memory.
Data formats
Auto-detected from the first record: Alpaca (instruction/output),
ShareGPT (conversations), chat (messages), prompt/completion,
plain text, and preference pairs (prompt/chosen/rejected) for DPO.
Files: .jsonl, .json, .csv.
License
Apache-2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file troy_cli-0.2.0.tar.gz.
File metadata
- Download URL: troy_cli-0.2.0.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2834198748f7e9ddd75f553e2ef761a4e9a80a8f755ab625fd36dac42bee75a
|
|
| MD5 |
4623fdacf5bcaad071cc11db46ff2739
|
|
| BLAKE2b-256 |
858d494d12d528cc042e54d682fa54539e6535456c26ca28fdaf37fac4bc0de1
|
Provenance
The following attestation bundles were made for troy_cli-0.2.0.tar.gz:
Publisher:
release.yml on avirajkhare00/troy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
troy_cli-0.2.0.tar.gz -
Subject digest:
a2834198748f7e9ddd75f553e2ef761a4e9a80a8f755ab625fd36dac42bee75a - Sigstore transparency entry: 2796593762
- Sigstore integration time:
-
Permalink:
avirajkhare00/troy@1d033fd56f890fcc557f5fa494d278d58842f006 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/avirajkhare00
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1d033fd56f890fcc557f5fa494d278d58842f006 -
Trigger Event:
push
-
Statement type:
File details
Details for the file troy_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: troy_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0014f0bd2b781b3597e2130d784768ab5bd612aa96040c6ac5981f2a6cf636a6
|
|
| MD5 |
a69fa03ab25fa2583e71a3a39c2e1e6b
|
|
| BLAKE2b-256 |
0ad770da8768ea8b2b14454264a62f67d83b32a85609ed6b3dc81c4b97326422
|
Provenance
The following attestation bundles were made for troy_cli-0.2.0-py3-none-any.whl:
Publisher:
release.yml on avirajkhare00/troy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
troy_cli-0.2.0-py3-none-any.whl -
Subject digest:
0014f0bd2b781b3597e2130d784768ab5bd612aa96040c6ac5981f2a6cf636a6 - Sigstore transparency entry: 2796593808
- Sigstore integration time:
-
Permalink:
avirajkhare00/troy@1d033fd56f890fcc557f5fa494d278d58842f006 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/avirajkhare00
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1d033fd56f890fcc557f5fa494d278d58842f006 -
Trigger Event:
push
-
Statement type: