Text Generation
MLX
Safetensors
English
Chinese
glm_moe_dsa
quantized
glm
Mixture of Experts
apple-silicon
mixed-precision
3-bit
long-context
speculative-decoding
mtp
conversational
4-bit precision
Run this model with HF Jobs
Run avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw 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("avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw") 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 avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw"
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": "avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw 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 "avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw"
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 avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw"
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 "avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw" \ --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"
Card+chart: sync 2.56 sibling to its re-measured clip+DWQ main (3.698/2.054, tasks 0.638n/0.812/0.744; wikitext gap −25%)
Browse filesFiles changed (3)
39 unmodified lines404142434445465 unmodified lines525354555657585960616263111 unmodified lines17517617717817918018118218318418518618739 unmodified lines| code (mlx_lm src) | 1.893 | 1.841 | 1.832 | **1.835** || ZH | — | — | 2.654 | **2.617** |The 8-bit teacher adds a further **−1.3% wikitext** beyond the 4.5-teacher retune — statistically significant, the 4.5-teacher figure sits above this build's 95% CI [2.781, 2.847]; code is nominally lower but within noise. The gain is modest because at 3.5 bpw the *student's capacity*, not the teacher's precision, is the binding constraint. We tested the more-quantized [2.56 bpw build](https://huggingface.co/avlp12/GLM-5.2-Alis-MLX-Dynamic-2.56bpw) with this same 8-bit teacher and it did **not** improve — strided PPL edged up slightly (within noise) even though its DWQ-vs-teacher loss dropped 35%: at 2 bpw the student is too capacity-starved to exploit a sharper teacher, and chasing its finer targets overfits the calibration set without helping held-out PPL. There is a teacher-precision / student-capacity sweet spot, and 3.5 bpw sits on the right side of it while 2.56 bpw sits on the wrong side. The pre-DWQ weights remain on the [`pre-dwq`](https://huggingface.co/avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw/tree/pre-dwq) branch; the earlier 4.5 bpw-teacher retune on [`dwq-4.5teacher`](https://huggingface.co/avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw/tree/dwq-4.5teacher). **The *Quality* figures below are measured on the current `main` (clip + 8-bit-teacher DWQ) weights.**> ⚠️ **Requires a patched `mlx-lm`** with the `glm_moe_dsa` correctness fixes **and** int8 MLA-KV support.>5 unmodified linesA 2-bit (≤256 GB) build of this model is *bit-starved*; lifting the budget to 512 GB and spending 3.5 bpw is the single biggest quality lever.| | this build (3.5 bpw) | 2.56 bpw build | Δ ||---|---|---|---|| wikitext-2 PPL (prose) | **2.777** | 3.774 | **−26%** || code PPL (mlx_lm src) | **1.835** | 2.069 | **−11%** |*Strided perplexity (ctx 2048 / stride 1024) from a fixed local harness — **relative** numbers for comparing builds, not directly comparable to perplexities other quantizers report on different corpora.*111 unmodified lines| | GLM-5.1 · 2.7 bpw | GLM-5.2 · 2.56 bpw | **GLM-5.2 · 3.5 bpw (this)** ||---|---|---|---|| Perplexity (lower) | 4.165 | 3.564 | **3.644** || HellaSwag (acc_norm) | 0.606 | 0.652 | **0.626** || PIQA (acc) | 0.796 | 0.808 | **0.838** || WinoGrande (acc) | 0.660 | 0.780 | **0.780** || Generation (tok/s) | 18.35 | 22.87 | **21.29** |Perplexity here is on `allenai/tulu-3-sft-mixture` (the `mlx_lm.perplexity` default) — a different corpus and method from the wikitext strided figure in *Quality* above, so values are not comparable across the two sections. Task accuracies use a 500-sample limit (CI ±0.02–0.04). All figures in this column are measured on the current `main` (clip + 8-bit-teacher DWQ): tulu 3.644 ±0.029 and HellaSwag 0.626 / PIQA 0.838 / WinoGrande 0.780 — each within 1 CI of the previous retune (`dwq-8bit-noclip`: 3.630, 0.604 / 0.822 / 0.780), i.e. no task-level regression. The campaign's real, significant gain is on the more sensitive **strided PPL** in *Quality* above. GLM-5.1 is a different (older) base model, so cross-generation gaps reflect both the newer model and quantization.---39 unmodified lines404142434445465 unmodified lines525354555657585960616263111 unmodified lines17517617717817918018118218318418518618739 unmodified lines| code (mlx_lm src) | 1.893 | 1.841 | 1.832 | **1.835** || ZH | — | — | 2.654 | **2.617** |The 8-bit teacher adds a further **−1.3% wikitext** beyond the 4.5-teacher retune — statistically significant, the 4.5-teacher figure sits above this build's 95% CI [2.781, 2.847]; code is nominally lower but within noise. The gain is modest because at 3.5 bpw the *student's capacity*, not the teacher's precision, is the binding constraint. We tested the more-quantized [2.56 bpw build](https://huggingface.co/avlp12/GLM-5.2-Alis-MLX-Dynamic-2.56bpw) (its pre-clip retune; that build's `main` has since moved to a clip + 4.5-teacher rework) with this same 8-bit teacher and it did **not** improve — strided PPL edged up slightly (within noise) even though its DWQ-vs-teacher loss dropped 35%: at 2 bpw the student is too capacity-starved to exploit a sharper teacher, and chasing its finer targets overfits the calibration set without helping held-out PPL. There is a teacher-precision / student-capacity sweet spot, and 3.5 bpw sits on the right side of it while 2.56 bpw sits on the wrong side. The pre-DWQ weights remain on the [`pre-dwq`](https://huggingface.co/avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw/tree/pre-dwq) branch; the earlier 4.5 bpw-teacher retune on [`dwq-4.5teacher`](https://huggingface.co/avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw/tree/dwq-4.5teacher). **The *Quality* figures below are measured on the current `main` (clip + 8-bit-teacher DWQ) weights.**> ⚠️ **Requires a patched `mlx-lm`** with the `glm_moe_dsa` correctness fixes **and** int8 MLA-KV support.>5 unmodified linesA 2-bit (≤256 GB) build of this model is *bit-starved*; lifting the budget to 512 GB and spending 3.5 bpw is the single biggest quality lever.| | this build (3.5 bpw) | 2.56 bpw build | Δ ||---|---|---|---|| wikitext-2 PPL (prose) | **2.777** | 3.698 | **−25%** || code PPL (mlx_lm src) | **1.835** | 2.054 | **−11%** |*Strided perplexity (ctx 2048 / stride 1024) from a fixed local harness — **relative** numbers for comparing builds, not directly comparable to perplexities other quantizers report on different corpora.*111 unmodified lines| | GLM-5.1 · 2.7 bpw | GLM-5.2 · 2.56 bpw | **GLM-5.2 · 3.5 bpw (this)** ||---|---|---|---|| Perplexity (lower) | 4.165 | 3.571 | **3.644** || HellaSwag (acc_norm) | 0.606 | 0.638 | **0.626** || PIQA (acc) | 0.796 | 0.812 | **0.838** || WinoGrande (acc) | 0.660 | 0.744 | **0.780** || Generation (tok/s) | 18.35 | 22.87 | **21.29** |Perplexity here is on `allenai/tulu-3-sft-mixture` (the `mlx_lm.perplexity` default) — a different corpus and method from the wikitext strided figure in *Quality* above, so values are not comparable across the two sections. Task accuracies use a 500-sample limit (CI ±0.02–0.04). All figures in this column are measured on the current `main` (clip + 8-bit-teacher DWQ): tulu 3.644 ±0.029 and HellaSwag 0.626 / PIQA 0.838 / WinoGrande 0.780 — each within 1 CI of the previous retune (`dwq-8bit-noclip`: 3.630, 0.604 / 0.822 / 0.780), i.e. no task-level regression. The campaign's real, significant gain is on the more sensitive **strided PPL** in *Quality* above. The 2.56 bpw column is that build's current `main` (clip + 4.5-teacher DWQ, re-measured 2026-07). GLM-5.1 is a different (older) base model, so cross-generation gaps reflect both the newer model and quantization.---
README.md+9-9
assets/quality.png

Large File Pointer Details
- SHA256: 861e3f1d63bb0dc5865ea0f2babc6fdfb5f53b60d91810cae4fa865dc218c50d
- Pointer size: 130 Bytes
- Size of remote file: 62 kB

Large File Pointer Details
- SHA256: cc4fea6ac5b598fcb8e5f225824fe9a91aec086a6a9bb71dfacf21dfd95e085e
- Pointer size: 130 Bytes
- Size of remote file: 61.7 kB
assets/quality.svg