Skip to main content

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 from source: pip install ./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

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 or DPO
troy chat Interactive REPL (or -p for one-shot) with your adapter
troy serve OpenAI-compatible API server for your model
troy export Fuse the adapter; export MLX or GGUF
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

troy_cli-0.1.2.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

troy_cli-0.1.2-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file troy_cli-0.1.2.tar.gz.

File metadata

  • Download URL: troy_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for troy_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fc2ffd23bc21450ce844a1b269c1a3a0e82fb294fca3f89094cb68da5ca06a62
MD5 09302951935b3ed2ed145ca9c589285a
BLAKE2b-256 80c56e50d7b7e64de01afc01586b2c4f572bbd9da61a1afcbb91f9b047723094

See more details on using hashes here.

Provenance

The following attestation bundles were made for troy_cli-0.1.2.tar.gz:

Publisher: release.yml on avirajkhare00/troy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file troy_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: troy_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for troy_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81f7b412a598e1a9d5d9ed8563daf253e9adde9d80def5516fd416e963889ad7
MD5 19fad2c19c0a49ad251395681d07f307
BLAKE2b-256 30b3a9188a59bd1748d3dece6fd8f3be9d7d8efcc04d9d2f389d441b10dd1327

See more details on using hashes here.

Provenance

The following attestation bundles were made for troy_cli-0.1.2-py3-none-any.whl:

Publisher: release.yml on avirajkhare00/troy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.2 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page