Skip to content

Powdered Metal · v0.7.1

Train and serve models on Apple Silicon.

PMetal fine-tunes, runs and serves large language models on the Mac’s GPU and Neural Engine. Written in Rust, with no Python or CUDA in the loop, behind a command line, a terminal UI, a desktop app, an MCP server and Python and Rust SDKs.

Get started
Apple M4 Max, as pmetal info reports it
Language
Rust
Runs on
macOS 14+, M1 to M5
Compute
GPU and Neural Engine
License
MIT or Apache-2.0

One spec, every surface

Define a field once. Every interface agrees on it.

Each command’s fields, defaults, ranges and checks are declared once, in pmetal-core. The command line, the terminal UI, the desktop app, the MCP server and the Python bindings are generated from that declaration, so they cannot drift apart.

crates/pmetal-core/src/jobs/train.rs
#[job(
    label = "Learning Rate",
    group = "Optimization",
    argv = "--learning-rate",
    min = 1e-8,
    max = 1.0,
    default_float = 0.0002
)]
pub learning_rate: f64,
  1. Command line
    pmetal train
    $ pmetal train --learning-rate 2e-4
  2. Terminal UI
    Training tab
    Learning Rate0.0002
  3. Desktop app
    Train page
    Learning Rate0.0002
  4. MCP server
    train tool
    "learning_rate": { "type": "number", "default": 0.0002 }
  5. Python
    pmetal.TrainSpec
    pmetal.TrainSpec(learning_rate=2e-4)

Capabilities

From a Hub checkpoint to a production endpoint, on one Mac.

Fine-tune with the whole LoRA family or every weight, align with preference and reasoning objectives, then serve the result behind both major API families, with the weights in the format they shipped in.

Fine-tuning

The full LoRA family, on every architecture.

LoRA, QLoRA, DoRA, rsLoRA and LoRA+, with PiSSA, OLoRA and LoftQ initialisation. One adapter per routed expert on MoE models, and QLoRA on NVFP4 checkpoints with the base left packed. Adapters are written in the PEFT layout and agree with PEFT to 4e-6 in logits, both ways.

LoRAQLoRADoRArsLoRALoRA+PiSSAOLoRALoftQFull fine-tune

Serving

One server, both API families.

OpenAI and Anthropic compatible, with tool calls, JSON-schema output enforced by constrained decoding, vision input, continuous batching and Prometheus metrics.

  • POST/v1/chat/completions
  • POST/v1/completions
  • POST/v1/responses
  • POST/v1/embeddings
  • POST/v1/messages
  • GET/v1/models
  • GET/metrics

Neural Engine

The whole model on the ANE.

Inference with several layers per ANE program over a KV cache in IOSurfaces, int8 weights by default, DFlash drafting beside it. Training has an ANE path too.

Speculative decoding

Faster, and exactly the same output.

Every drafted token is verified. MTP heads, Gemma 4 assistants and DFlash block-diffusion drafts, and train-mtp and train-draft train your own drafters on a Mac.

TurboQuant KV cache

Long context in a fraction of the memory.

Rotated, Lloyd-Max quantized keys and values, decoded straight from the packed cache.

4-bit3.8× smaller than bf16
Qwen3-0.6B, within 0.3% perplexity of bf16
3-bit4.9× smaller than bf16
Qwen3-0.6B, within 2.3%
2-bit7.1× smaller than bf16

Packed weights

Checkpoints run in the format they shipped in.

NVFP4, FP8 and MXFP4 checkpoints, and MLX-quantized ones, stay packed in memory. Mixture-of-experts layers can keep their experts on SSD.

NVFP4FP8MXFP4MXFP8MLX affineExperts on SSD

Quantization

GGUF to a bits-per-weight budget.

26 GGUF methods, K-quants, IQ4_NL and IQ4_XS, ternary, MXFP4 and NVFP4 among them, with importance matrices from pmetal imatrix and KL-calibrated per-tensor types under a --target-bpw. MLX-format output too.

Q4_K_MQ5_K_MQ6_KQ8_0IQ4_XSIQ4_NLTQ1_0MXFP4NVFP4

Training methods

Preference, reasoning, distillation and pretraining.

Preference
DPO, Robust DPO, IPO, hinge, SimPO, ORPO, KTO
Reasoning
GRPO, DAPO, Dr. GRPO, GSPO, RLKD
Distillation
Online, offline and progressive; cross-vocabulary
Also
Embedding models, pretraining, block diffusion
Optimizers
AdamW (fused), SGD, Lion, Adafactor, Muon, schedule-free AdamW, 8-bit AdamW

Multi-Mac

Train across Macs over Thunderbolt.

Discovery over mDNS, a ring biased toward the fastest fabric, and links authenticated and encrypted with a shared cluster secret. Gradient compression and a pipeline harness are built in.

Verified

Checked against the reference, not against itself.

Architectures are held to the outputs of the reference implementations, and training attaches adapters to the same module graph inference runs, so the model you tune is the model you serve.

Read how each was measured in the changelog
CheckResult
  1. LoRA adapters4e-6max logit difference
  2. Qwen3.8-27B greedy repliesidenticaltoken for token
  3. Qwen3.5 vision features8.1e-6max difference
  4. Image and video preprocessingidenticalbyte for byte
  5. Fused Metal AdamWidenticalbit for bit, 3.2× faster
  6. Training, run to runidenticalbit for bit
  7. TurboQuant 4-bit KV cache≤ 0.3%perplexity change
  8. Speculative decodingexactevery draft verified

Use it your way

The same job from a shell, a notebook or a service.

Every command is a typed spec in Python and a struct in Rust, and the server speaks the APIs your clients already use.

# Fine-tune with LoRA (sequence packing and gradient checkpointing are on by default)
pmetal train --model Qwen/Qwen3-0.6B --dataset train.jsonl --output ./output \
  --lora-r 16 --batch-size 4 --learning-rate 2e-4

# Run it with the adapter, then serve it
pmetal infer --model Qwen/Qwen3-0.6B --lora ./output/adapter_model.safetensors \
  --prompt "Explain quantum entanglement" --chat
pmetal serve --model Qwen/Qwen3-0.6B --port 8080

Models

The open models you actually deploy.

The architecture is read from config.json, and every family works with the command line, the apps, the server and the SDKs. A model type that isn’t supported is refused by name, never run as a lookalike.

All supported models
  • Qwen 3.5 / 3.6 / 3.8VisionVideoMoE
    Hybrid Gated DeltaNet, dense and MoE
  • Qwen 3MoE
    Dense, and MoE such as Qwen3-30B-A3B
  • Qwen 3.8 Flash NextMoE
    Text tower
  • Qwen 2 / 2.5
    Dense
  • Llama
    2, 3, 3.1, 3.2, 3.3
  • Llama 4MoE
    Scout, Maverick
  • Llama 3.2 VisionVision
    11B, 90B
  • Gemma 4MoE
    Dense and MoE
  • Gemma
    1, 2, 3
  • DiffusionGemmaMoE
    Block diffusion, dense and MoE
  • DeepSeekMoE
    V2, V3, R1
  • GPT-OSSMoE
    20B, 120B, MXFP4 run packed
  • Nemotron-H, Nemotron 3HybridMoE
    Hybrid Mamba-2 and attention
  • GraniteHybridMoE
    3.x, 4.0, 4.0-H
  • Mistral
    7B and the dense decoders
  • Phi
    Phi-3, Phi-3.5, Phi-4
  • Cohere
    Command R
  • EncodersEmbeddings
    BERT, RoBERTa, XLM-R, DistilBERT, ModernBERT

Quantized checkpoints load packed: MLX-quantized (affine, MXFP4, NVFP4, MXFP8), NVIDIA ModelOpt NVFP4 and FP8, and GPT-OSS MXFP4.

Hardware

It asks the Mac what it has.

PMetal reads the chip’s generation, tier, core counts, memory bandwidth and working-set limit at startup and tunes itself to them. An Ultra is treated as two Max dies joined by UltraFusion; on M5, the GPU’s neural accelerators (NAX) are used through MLX.

Chip familyGPUNAXNeural Engine
M1 / Pro / Max / UltraApple7Noyes
M2 / Pro / Max / UltraApple8Noyes
M3 / Pro / Max / UltraApple9Noyes
M4 / Pro / MaxApple9Noyes
M5 and laterApple10yesyes
pmetal info
$ pmetal info
PMetal Device Information
=========================
Device:         Apple M4 MaxGPU Family:     Apple9GPU Cores:      40ANE Cores:      16Unified Memory: yesSystem Memory:  128 GBRecommended WS: 108 GBBandwidth:      473 GB/s (MeasuredGpuCopy)NAX (Neural):   noMetal:          availablePMetal Version: 0.7.1Hub Cache:      ~/.cache/huggingface/hubFeatures:       ane, distributed, vocoder, serve, mcp, dashboard

Install

One command on any Apple Silicon Mac.

macOS 14 or later on an M1 or newer. The prebuilt binary and the Homebrew formula include the server and the MCP server.

  • Models download from the Hugging Face Hub on first use
  • pmetal info shows what it found on your Mac
  • pmetal <command> --help lists every option

Builds the CLI, terminal UI, server and MCP server from source against the pinned MLX.

brew install epistates/tap/pmetal

Your Mac is the training cluster.

Fine-tune, align, quantize and serve without sending a token to someone else’s hardware.

Read the guideStar on GitHub