Instructions to use Rapid42/GLM-4.7-Flash-MXFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Rapid42/GLM-4.7-Flash-MXFP4 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("Rapid42/GLM-4.7-Flash-MXFP4") 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 Rapid42/GLM-4.7-Flash-MXFP4 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Rapid42/GLM-4.7-Flash-MXFP4"
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": "Rapid42/GLM-4.7-Flash-MXFP4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Rapid42/GLM-4.7-Flash-MXFP4 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 "Rapid42/GLM-4.7-Flash-MXFP4"
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 Rapid42/GLM-4.7-Flash-MXFP4
Run Hermes
hermes
- MLX LM
How to use Rapid42/GLM-4.7-Flash-MXFP4 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Rapid42/GLM-4.7-Flash-MXFP4"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Rapid42/GLM-4.7-Flash-MXFP4" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rapid42/GLM-4.7-Flash-MXFP4", "messages": [ {"role": "user", "content": "Hello"} ] }'
Rapid42/GLM-4.7-Flash-MXFP4
GLM-4.7-Flash (~30B) — quantized to MXFP4 for Apple Silicon
Converted and optimized by Rapid42 — engineering tools for fast pipelines.
What This Is
This is GLM-4.7-Flash from ZhipuAI quantized to MXFP4 format using mlx-lm. GLM-4.7 is the latest generation of Zhipu AI's GLM series — strong on both English and Chinese, with a large context window and fast generation.
- Parameters: ~30B
- Quantization: MXFP4 (via mlx-lm 0.31.1)
- Base model: zai-org/GLM-4.7-Flash
- Framework: Apple MLX
- Strengths: English + Chinese bilingual, strong coding, long context
Hardware Requirements
| Device | RAM | Experience |
|---|---|---|
| M3 Max (128GB) | ~18GB | ✅ Excellent |
| M3 Pro (36GB) | ~18GB | ✅ Comfortable |
| M2 Ultra (192GB) | ~18GB | ✅ Excellent |
| M2 Pro (16GB) | ~18GB | ⚠️ Very tight — may page |
| M1/M2 (24GB) | ~18GB | ✅ Works |
Quick Start
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("Rapid42/GLM-4.7-Flash-MXFP4")
messages = [{"role": "user", "content": "Explain the difference between EXR and OpenEXR multipart files."}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_dict=False
)
response = generate(model, tokenizer, prompt=prompt, max_tokens=512, verbose=True)
print(response)
CLI:
mlx_lm.generate \
--model Rapid42/GLM-4.7-Flash-MXFP4 \
--prompt "What makes GLM different from Llama-style architectures?" \
--max-tokens 512
Why GLM-4.7-Flash?
GLM-4.7-Flash is the "fast" variant of the GLM-4.7 series — optimized for inference speed while retaining most of the quality of the full model. Key differentiators:
- Bilingual English/Chinese — genuine dual-language capability, not fine-tuned bilingualism
- Flash inference — optimized attention for faster generation
- Large context — handles long documents and complex multi-turn conversations
- Alternative architecture — General Language Model (GLM) uses bidirectional attention blanking rather than causal masking
A solid alternative to Qwen-family models, especially for Chinese-language tasks or for those who want architectural diversity in their local model stack.
Why MXFP4?
MXFP4 (Microscaling FP4) preserves more dynamic range than standard int4 through per-block scaling factors, and runs natively fast on Apple Silicon via MLX — no special runtimes needed.
Conversion
python -m mlx_lm.convert \
--hf-path zai-org/GLM-4.7-Flash \
--mlx-path Rapid42/GLM-4.7-Flash-MXFP4 \
--quantize --q-bits 4 --q-group-size 64
Converted using mlx-lm 0.31.1.
About Rapid42
Rapid42 builds fast, precise engineering tools — from VFX pipeline utilities to optimized ML model distributions.
→ rapid42.com · ExrToPsd · Level Careers
- Downloads last month
- 107
4-bit
Model tree for Rapid42/GLM-4.7-Flash-MXFP4
Base model
zai-org/GLM-4.7-Flash