mash

The mangled shell. A small local model (Qwen2.5-Coder, finetuned with mlx-lm LoRA on Apple Silicon) that turns garbled commands into correct ones — so common ??? fixes are instant and offline, with the cloud as fallback.

??? @@@@@@@@@@@ ~@{{]]]]]{@] @{{]]]]]{{@ <@ @{]]]]]]{@ ]@{{@ ]{]]]]]{@. {@{]]]{] @]]]]{@? .@@@@@@{]]@ ~@]]{@< <]]@? @]]? @@{]]@ ]{]{@@@@@@@ ]@{{]]]{] @{]]]{{@ ?@@{]]]]]]@ @{{{@ @@{]]]]]]]{@ ~@~ ?@@{]]]]]]{{@? @@@@@@@@@@@@@ ?<?

How it routes

~ ⚡︎ dokcer ps -a⁉️
✦ 1. docker ps -a          (local · 40ms)
↵ runs it · r forces the cloud

fash auto-detects a fused mlx model at ~/.fash/models/mash and routes ??? and !!! fixes through it first — a confident single-candidate reply auto-runs under !!!. If mash echoes the input back — "already correct, or I can't fix it" — fash falls through to the cloud automatically.

The dataset is the whole game

As of August 2026 no public model or dataset exists for the mangled→correct task — the small-model space is all NL→bash translation, and the rule-based incumbent is thefuck. Mash is trained on a synthetic pipeline (~42k rows) built from:

  • tldr-pages (CC-BY-4.0) — ~30k canonical invocations across ~3000 commands.
  • NL2Bash (MIT) — ~9k expert one-liners with descriptions.
  • your own fash history — accepted ???/!!! pairs, redacted and deduped, mixed into the train split only.

Pair types: realistic typo pairs (transposed/QWERTY-adjacent chars, -/-- confusion, stray sudo, pasted $ prefixes, smart quotes from web docs…), terse request pairs, and ~12% identity pairs so the model learns not to over-correct — its echo becomes a clean "nothing to fix" signal.

Build your own

Enter the Mash project from the repository root; every step below runs there.

# from the repository root
cd mash
  1. Build the dataset
    uv run python training/build_dataset.py --out training/data
  2. Finetune (QLoRA, loss masked to the correction only)
    uv run mlx_lm.lora \
      --model mlx-community/Qwen2.5-Coder-1.5B-Instruct-4bit \
      --train --data training/data \
      --batch-size 8 --iters 1200 --num-layers 16 \
      --mask-prompt --grad-checkpoint \
      --adapter-path training/adapters-1.5b
  3. Fuse and install
    uv run mlx_lm.fuse \
      --model mlx-community/Qwen2.5-Coder-1.5B-Instruct-4bit \
      --adapter-path training/adapters-1.5b \
      --save-path ~/.fash/models/mash
  4. Evaluate on the held-out test split
    uv run python training/eval.py --model ~/.fash/models/mash

fash discovers the model automatically on next start (fixer local+cloud in the header).