Instructions to use OpensourceWTF/GLM-5.2-t158-MTPLX-streaming with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OpensourceWTF/GLM-5.2-t158-MTPLX-streaming 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("OpensourceWTF/GLM-5.2-t158-MTPLX-streaming") 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 OpensourceWTF/GLM-5.2-t158-MTPLX-streaming with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OpensourceWTF/GLM-5.2-t158-MTPLX-streaming"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "OpensourceWTF/GLM-5.2-t158-MTPLX-streaming" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use OpensourceWTF/GLM-5.2-t158-MTPLX-streaming 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 "OpensourceWTF/GLM-5.2-t158-MTPLX-streaming"
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 OpensourceWTF/GLM-5.2-t158-MTPLX-streaming
Run Hermes
hermes
- OpenClaw new
How to use OpensourceWTF/GLM-5.2-t158-MTPLX-streaming with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OpensourceWTF/GLM-5.2-t158-MTPLX-streaming"
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 "OpensourceWTF/GLM-5.2-t158-MTPLX-streaming" \ --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"
- MLX LM
How to use OpensourceWTF/GLM-5.2-t158-MTPLX-streaming with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "OpensourceWTF/GLM-5.2-t158-MTPLX-streaming"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "OpensourceWTF/GLM-5.2-t158-MTPLX-streaming" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpensourceWTF/GLM-5.2-t158-MTPLX-streaming", "messages": [ {"role": "user", "content": "Hello"} ] }'
GLM-5.2 t158 MTPLX-streaming
Ternary-expert GLM-5.2 for Apple Silicon, packaged for SSD-streamed serving with MTPLX. The 724.8B routed-expert parameters are stored as a serialized ternary bank (t158 codec: ternary weights, group-64 scales, 1.875 bits/weight stored — 158.2 GiB) and stream from SSD under a configurable memory envelope, so the model runs on Macs that cannot hold it resident.
⚠️ Not quality-validated. The ternary bank is lossy and has no end-to-end quality receipts — no HumanEval, no MBPP, no perplexity gate. The only quality evidence is construction-time: SwiGLU output cosine ≈0.920 against its 2-bit parent bank on sampled hidden states, and the parent itself was never task-evaluated. Treat this as an engineering artifact for streaming-runtime work, not a serving recommendation.
Repo contents (~187 GiB)
| files | size | what |
|---|---|---|
resident-*.safetensors (3) + model.safetensors.index.json |
10.6 GiB | attention, routers, shared experts, embeddings (4-bit, from mlx-community/GLM-5.2-4bit); the index covers exactly these 2,806 resident tensors |
experts-q1-t158.bin + expert-manifest-q1-t158.json |
158.2 GiB | all 19,200 routed expert records (78 layers × 256 experts minus dense layers) as an aligned bank; every record sha256-pinned, whole file sha256-pinned by the authoritative manifest |
expert-manifest.json |
— | authoritative manifest (model key glm52-expert-q1t): pins the resident shards, the bank sidecar, and all 2,806 resident tensors |
mtp/layer78-bf16.safetensors + mtp/mtp-artifact-manifest.json |
18.5 GiB | GLM-5.2 MTP head (speculative decoding), bf16; every tensor sha256-pinned by the bundled artifact manifest |
island-placement.json, route-census.json |
— | per-machine seeds; MTPLX regenerates them on first serve |
Routed experts ship only in the serialized bank — there are no expert safetensors shards. Download everything:
hf download OpensourceWTF/GLM-5.2-t158-MTPLX-streaming
Measured decode (M5 Max, 614 GB/s, 12.47 GiB/s SSD)
Receipted 2026-07-18 (cache-72-slots configuration, 1024-token context, greedy, seed 0):
| mode | decode tok/s | decode hit rate |
|---|---|---|
| AR | 5.33 | 0.775 |
| MTP depth 3 | 5.93 | 0.767 |
Peak memory 84.1 GiB. Decode is SSD-miss-bound at this hit rate: a measured I/O roofline places the depth-3 ceiling near 8.4 tok/s for this configuration; higher residency envelopes move it.
Serving notes
- Requires MTPLX main (the
mtplx-expert-q1-v1loader; model keyglm52-expert-q1t). The engine verifies record hashes on read. - The MTP head is always resident (never streamed).
- The resident shards are pre-quantized; never requantize them at load.
Provenance and integrity
- Base model zai-org/GLM-5.2
(MIT); residents and quantization parent from
mlx-community/GLM-5.2-4bit
rev
6b347a64. - Derivation chain: 4-bit source → 2-bit expert bank → t158 ternary bank;
each step's manifest pins its source manifest by sha256
(
source_manifest_sha256). expert-manifest.jsonpins the 3 resident shards and the bank (whole-file sha256 + size);expert-manifest-q1-t158.jsonpins each of the 19,200 records individually.
Not measured
Any task eval or perplexity gate (see warning above). Contexts other than 1024. The 6.67 tok/s figure from exploratory runs has no durable receipt and is deliberately not claimed here.
- Downloads last month
- 741
4-bit
Model tree for OpensourceWTF/GLM-5.2-t158-MTPLX-streaming
Base model
zai-org/GLM-5.2