GLM 5.3 Flash-sauhard

Recipe · about 30 minutes, most of it downloading

Run it on your Mac.
Five steps, no cloud.

GLM 5.3 Flash-sauhard is published as ready-to-run MLX weights. Download them, start the server, and point Claude Code or any OpenAI-compatible app at localhost. Nothing leaves your machine.

Apple SiliconM-series Mac; tested on M5 Max
128 GBunified memory; 96 GB is too tight
75 GBfree disk for the weights
macOS 14+with Xcode command-line tools
  1. 1

    Install uv and get the code

    uv manages Python and pins every package to the versions this build was tested with (MLX 0.32.4, mlx-vlm 0.7.9). The repo holds the server, the memory cap and the dashboard.

    curl -LsSf https://astral.sh/uv/install.sh | sh
    git clone https://github.com/Sauhard74/glm-5.3-flash-sauhard.git
    cd glm-5.3-flash-sauhard
    uv sync
  2. 2

    Download the weights

    71 GB from Hugging Face. The download resumes if it is interrupted; run the same command again.

    uv run hf download Sauhard74/GLM-5.3-Flash-sauhard-MLX --local-dir models/glm-5.3-flash-sauhard
  3. 3

    Start the server

    Serves the OpenAI API (/v1/chat/completions) and the Anthropic API (/v1/messages) on port 8080, capped at 84 GB. Loading takes a minute or two; the vision warning in the log is expected, since this build is text-only.

    # a key so only your apps can use the server
    openssl rand -hex 24 > control/api_key
    CAP_GB=84 MTP=0 scripts/quickserve.sh models/glm-5.3-flash-sauhard
  4. 4

    Say hello

    In a second terminal. The model field must be the same path the server was started with.

    curl -s http://127.0.0.1:8080/v1/chat/completions \
      -H "Authorization: Bearer $(cat control/api_key)" -H "Content-Type: application/json" \
      -d '{"model":"models/glm-5.3-flash-sauhard","messages":[{"role":"user","content":"Write a haiku about unified memory."}],"max_tokens":800}'
  5. 5

    Connect Claude Code

    Runs Claude Code against the local model, with a 128K context window. Subagents use it too.

    MODEL_ID=models/glm-5.3-flash-sauhard scripts/claude-local.sh
Other apps

Any OpenAI-compatible client works

Use these settings in Open WebUI, Cline, Continue, Zed, Jan, LM Studio's client mode or your own code.

Base URL

http://127.0.0.1:8080/v1

Model

models/glm-5.3-flash-sauhard

API key

contents of control/api_key

Recommended sampling: temperature 1.0, top-p 0.95. The model thinks before it answers, so allow at least 2,000 output tokens.

Optional

The dashboard, always on

Installs a small launchd service with the control panel at http://127.0.0.1:8090: start, stop and restart with one click, live memory and speed, and it comes back after a reboot. It creates the API key for you.

scripts/install-control.sh             # open http://127.0.0.1:8090, pick GLM 5.3 Flash-sauhard, Start
scripts/install-control.sh --uninstall # remove it

The dashboard's second profile, Qwen3.8-Flash-Next, needs its own download; see control/profiles.json.

If something goes wrong

Troubleshooting

The server is killed while loading, or the Mac swaps heavily
Close large apps (browsers with many tabs, Docker, other models) before starting. The model needs about 72 GB resident; macOS kills a process that pushes memory pressure too high.
"model not found" or the model loads twice
The model field in requests must match the path passed to quickserve.sh exactly.
Slow first reply
The first request after loading warms the Metal kernels. Long prompts prefill at about 630 tokens per second, so a 30K-token codebase takes about a minute; repeated prefixes are cached.
401 from the server
Send the key as Authorization: Bearer … (OpenAI style) or x-api-key (Anthropic style).
Advanced

Rebuild it from the original

Every step that made these weights is in the repo, so you can calibrate on your own workload or pick a different size. You need the full GLM-5.3-Flash checkpoint (about 600 GB of temporary disk) and an evening: calibration took 5.5 hours on the M5 Max and the build about 10 minutes.

# 1. the original checkpoint
uv run hf download zai-org/GLM-5.3-Flash --local-dir models/src-glm-5.3-flash
# 2. calibration set: public code, agent, math and long-document data
uv run python -m calib_data.build --model glm --out artifacts/glm/data
# 3. stream the model layer by layer, recording routing and sensitivity (~5.5 h)
uv run python -m calib.run --model glm --src models/src-glm-5.3-flash --data artifacts/glm/data --out artifacts/glm/calib
# 4. prune to 153 experts, allocate bits to a 76 GB budget, LSQ rounding (~10 min)
uv run python -m build.make --model glm --src models/src-glm-5.3-flash --calib artifacts/glm/calib \
  --prune 153 --score reap --budget-gb 76 --drop-vision --rounding lsq --out models/glm-5.3-flash-sauhard
# 5. check it against the original
uv run python -m evals.kl --model models/glm-5.3-flash-sauhard

Change --budget-gb for a smaller or larger build, or edit calib_data/recipes.py to calibrate on a different mix of work.