source docs/capability_matrix.md · view on GitHub ↗

Capability matrix — modalities × actions

Date: 2026-05-31 · Commit: 218af10 Question: For every (modality, action) pair, can posttrainllm do it today?

1. Modalities

ModalityStatusNotes
Text — byte-level (vocab=256)First-class. Default for from-scratch models.
Text — BPE / HF tokenizerPinned via --tokenizer at train time; HF tokenizers loaded from model dir. SmolLM2 / Qwen3 vocabs verified.
CodeJust text under the BPE tokenizer. Curated code datasets in registry: the-stack-smol, python_code_instructions_18k_alpaca, codeforces-cots, commitpack, SWE-bench.
Structured (JSON, tool calls)FSM-constrained generation (ConstrainedGen) enforces a target JSON schema during decode. Agent runtime + JSON-mode shipped.
Multilingual text (Indic)⚠️Tokenizer side OK (smollm2 / Qwen3 vocabs). MILU + IndicGenBench eval CLIs wired. No real Indic model trained yet. Sarvam-Edge / Airavata are the planned bases.
Screen — accessibility tree (text)posttrainllm screen tree returns the focused window’s AX tree as JSON. Text-only — LM-friendly out of the box.
Screen — raw pixels (image)⚠️posttrainllm screen capture works in code; bare CLI hits the CGS-init quirk. Needs signed bundle / GUI-terminal context. NO vision encoder yet — just PNG bytes.
Vision (image → embeddings)Vision encoder (ViT → posttrainllm decoder) is deferred research-grade work. Not shipped.
Audio (speech → text)Not in scope today. Roadmap notes Apple Speech.framework + AVSpeechSynthesizer as the eventual local choices.
Audio (text → speech)Same — AVSpeechSynthesizer placeholder, not wired.
Multi-modal — text + imageArchitecturally not shipped. Cider’s mlx_vlm compatibility patches are referenced in the research doc but not consumed; no vision-language model is part of posttrainllm’s training or inference today.
Multi-modal — text + audioNot built.
Multi-modal — text + structured (tools)Tool-calling specialists ARE multi-modal in the sense “input is user text + tool catalog, output is JSON call.” Fully supported via agent runtime + mini-router.

Summary: posttrainllm is a text-LM + structured-output + screen-text hybrid, with code as a first-class text variant. No vision / audio encoders are shipped. Multi-modal in the vision/audio sense is roadmapped (Wave 2.6 ViT, Wave 4 audio) but not implemented.

2. Actions

Every action below is a working CLI subcommand on M5 Pro (audit confirmed in docs/feature_audit_2026_05_31.md).

Training

ActionCLIModalityNotes
Pretrain from scratchposttrainllm traintext (byte or BPE)Standard transformer LM training.
Pretrain (training-throughput bench)posttrainllm bench-traintext42 ms/step Huge on M5 Pro
Continued pretrain (text corpus)posttrainllm finetunetextByte-level OK; updates base weights
Supervised fine-tuneposttrainllm sfttext (BPE required)DoRA default. JSONL {instruction, response}.
DPO / SimPOposttrainllm dpotext (BPE required)JSONL {prompt, chosen, rejected}. SimPO default.
Speculative-decoding headsposttrainllm train-headstextMedusa + EAGLE-2 variants
Tool-call extractor (mini-router)posttrainllm train-extractortext → tool classTiny encoder + softmax over tool catalog
Knowledge distillationposttrainllm distilltextTeacher → student via KL
Evolution strategiesposttrainllm estextGradient-free; experimental
Tuned-lens probesposttrainllm tuned-lenstextPer-layer logit probes (research)

Adapter / PEFT (all under posttrainllm sft)

VariantFlagStatus
LoRA(default)
DoRA--dora✅ (in-session; disk format WIP)
VeRA--vera
RsLoRA--rs-lora
LoRA-FA--lora-fa
PISSA-init--pissa-init
LoftQ--loftq
AdaLoRA--adalora-target-rank N
LayerDrop--layer-drop F
LoRA+--lora-plus

Quantization + compression

ActionCLIStatusNotes
GPTQ (Hessian-calibrated int N)posttrainllm gptq2/3/4/8-bit · 0.10 rel error on smoke
HQQ (no calibration)posttrainllm hqq2/3/4/8-bit · 0.09 rel error on smoke
QAT (in-training)posttrainllm train --qatQuantization-aware fine-tune
SmoothQuant (activation scale)(internal, shipped per progress doc)Documented in quantization_expansion.md
Pruning — unstructuredposttrainllm prune-unstructured50% sparsity → -38.9% gz
Pruning — structured (heads/layers)posttrainllm prune-structuredFrobenius head ranking; physical layer drop
LASER rank reduction (SVD)posttrainllm laserPer-tensor low-rank approximation

Inference + serving

ActionCLIStatus
Sample / generateposttrainllm sample✅ — KV cached, speculative-decode flags
HTTP server (OpenAI surface)posttrainllm serve✅ — /v1/{models,chat/completions,completions}
HTTP server (Ollama surface)posttrainllm serve (same port)✅ — /api/{tags,version,show,chat,generate}
Agent runtime (multi-turn + tools)posttrainllm agent✅ — JSON-mode tool dispatch + persistent KV
Cloud escalation (direct call)posttrainllm escalate✅ — Anthropic + OpenAI
Cloud escalation (agent-driven)posttrainllm agent --cloud-escalate✅ — synthetic escalate tool added to schema
Mini-router inferenceposttrainllm extract✅ — top-K tool prediction with softmax confidence

Evaluation

ActionCLIStatus
Loss on a corpusposttrainllm eval
Standardized benchmarksposttrainllm score-bench✅ — HellaSwag / MMLU-Pro / GSM8K via lm-eval adapter
Indic benchmarks (MILU, IndicGenBench)posttrainllm eval-indic⚠️ — CLI wired; real-data baseline pending dataset fetch
Inference benchmark (TTFT/ITL/throughput)posttrainllm bench
Training-throughput benchmarkposttrainllm bench-train
Base ↔ LoRA comparisonposttrainllm compare✅ — side-by-side eval

Data acquisition + manipulation

ActionCLIStatus
HF Datasets registry (curated)posttrainllm list-datasets✅ — 22 entries
Download HF datasetposttrainllm download-dataset
Inspect HF model dirposttrainllm hf-load / hf-inspect
GitHub issue→PR / commits / reviewsposttrainllm fetch-github
Synthetic instructions via Magpieposttrainllm magpie✅ — needs chat-tuned base
Tool-call training data (BFCL/τ-bench)posttrainllm extractor-data✅ — JSONL {query, tool} pairs

Inspection + debugging

ActionCLIStatus
Inspect .tinygpt fileposttrainllm inspect
Round-trip validateposttrainllm validate
Debug helpersposttrainllm debug-{dtypes,load,logits,loss,names}

Cloud / storage

ActionCLIStatus
Push checkpoint to R2posttrainllm push✅ — env-gated, dry-run supported
Pull checkpoint from R2posttrainllm pull
R2 bucket managementposttrainllm cloud {list,delete,setup}

Screen reading

ActionCLIStatus
Capture active window (image)posttrainllm screen capture⚠️ — CGS-init quirk from bare CLI
Read AX tree (text)posttrainllm screen tree
Capture bothposttrainllm screen both⚠️ — image half subject to same quirk

3. Modality × action coverage matrix

Reading: rows are modalities, columns are actions. ✅ = supported, ⚠️ = partial, ⬜ = not built, — = N/A.

Modality / ActionPretrainFinetuneSFTDPODistillQuantizePruneSampleServeAgentEval
Text (byte-level)
Text (BPE)
Code (BPE)
Structured (JSON, tools)✅*✅*✅*✅*✅*⚠️†
Multilingual / Indic✅*✅*✅*✅*✅*⚠️†
Screen AX tree✅*✅*✅*✅*
Screen raw pixels⚠️†
Vision (image → embed)
Audio (speech in/out)
Multi-modal text+image
Multi-modal text+audio
Multi-modal text+tools✅*✅*✅*✅*✅*⚠️†

* = the base model still gets trained as text; we don’t have a separate “structured” or “Indic” pretrainer — they’re text under a tokenizer + appropriate training data.

= the eval CLI exists but no real-data baseline has been run yet.

4. What’s exposed vs what would need building

Things posttrainllm can do today that you might not realize

Things posttrainllm cannot do today (and the missing piece)

5. The honest one-line summary

posttrainllm is a text + code + structured-output transformer toy with quantization / PEFT / spec-decoding / agent-runtime / screen- text-via-AX, train-able from scratch on Apple Silicon and browser WebGPU. It is NOT yet multi-modal in the vision/audio sense; that’s roadmapped, not built.

For the avoidance of doubt: