Instructions to use scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Experimental AFM artifact. This checkpoint targets AFM and AFMKit
v0.1.18-rc.3or newer. It may not work with other MLX runtimes or older AFM releases. Behavior, quality, performance, memory use, compatibility, and file layout may change.
GLM-5.3-Flash AFM MLX 4-bit MTP
This is an AFM format-v3 conversion of the official
zai-org/GLM-5.3-Flash
checkpoint at revision 04c4e9e95c5da8862dced7e5056455116f83a7e0. It is
converted directly from the official FP8 SafeTensors distribution; it is not a
re-quantization of a third-party 4-bit checkpoint.
The conversion contains 201 weight files totaling 181,694,111,440 bytes (approximately 169.2 GiB), excluding runtime memory and KV cache. Loading the checkpoint measured approximately 169.4 GB wired memory on a 512 GB Apple Silicon development machine. A smaller minimum memory configuration has not been established.
Conversion
- AFM conversion format:
3 - Profile:
mlx-affine-4 - Quantization: affine 4-bit, group size 64
- Source MTP layer: preserved
num_nextn_predict_layers:1- Conversion units completed:
201/201 - Mapped tensors:
3,059 - Source tensors omitted from the NextN layer:
0 - Routed experts are reconstructed in numerical expert order.
- Router weights remain FP32.
- Attention projection layout transformations are applied for the AFM GLM runtime.
- Vision weights, tokenizer, processor assets, and the upstream chat template are preserved.
- Detailed source, shard, size, and SHA-256 provenance is recorded in
.afm-mlx-conversion.json.
End-to-end vision quality is not qualified. Weight preservation alone is not an image-quality parity claim.
MTP status
The structural layer 45 NextN tensors are present and converted. This is different from a general quality or speedup claim.
Qualification with AFMKit v0.1.18-rc.3 succeeded:
- The server loaded
GLM embedded NextN layerat depth 1. - An explicit greedy streaming request returned exactly
PASSwithfinish_reason=stop. - The diagnostic profile recorded
draftedTokens=4,acceptedTokens=4,headForwards=9,targetForwards=5, and zero rejection replays. - All 201 tensor files matched their recorded sizes and SHA-256 digests before upload.
- Hugging Face verified all 212 published files after upload.
This is runtime and integrity qualification, not a standard benchmark result. Throughput and correctness under other prompts, batch sizes, cache states, tool calls, and vision inputs remain unmeasured.
Run with AFM
Use AFM built against AFMKit v0.1.18-rc.3 or newer:
afm mlx -m scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit \
--mtp --reasoning-effort low --port 9999
The GLM-5.3 template does not expose a direct thinking off switch. Low reasoning effort reduces but does not eliminate reasoning output.
curl http://127.0.0.1:9999/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit",
"messages": [{"role": "user", "content": "Return exactly PASS and nothing else."}],
"temperature": 0,
"max_tokens": 128,
"stream": true
}'
Attribution and license
Original model by Z.AI. The original MIT license is included in LICENSE. The
upstream model card is preserved in UPSTREAM_README.md; upstream model claims
are not measurements of this conversion. AFM conversion and packaging are
provided by the AFM / AFMKit project.
- Downloads last month
- 240
4-bit
Model tree for scouzi1966/GLM-5.3-Flash-AFM-MLX-4bit
Base model
zai-org/GLM-5.3-Flash