Instructions to use openvuln/altar-1-4bit-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use openvuln/altar-1-4bit-mlx 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("openvuln/altar-1-4bit-mlx") 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 openvuln/altar-1-4bit-mlx with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "openvuln/altar-1-4bit-mlx"
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": "openvuln/altar-1-4bit-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use openvuln/altar-1-4bit-mlx with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "openvuln/altar-1-4bit-mlx"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "openvuln/altar-1-4bit-mlx" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openvuln/altar-1-4bit-mlx", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use openvuln/altar-1-4bit-mlx 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 "openvuln/altar-1-4bit-mlx"
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 openvuln/altar-1-4bit-mlx
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use openvuln/altar-1-4bit-mlx with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "openvuln/altar-1-4bit-mlx"
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 "openvuln/altar-1-4bit-mlx" \ --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"
Altar-1 (4-bit, MLX)
AikidoSec/altar-1 — the 504B expert-pruned
GLM-5.3 (REAP: 168 of 256 routed experts kept, INT4 W4A16 on the experts) — converted
to MLX format to run locally on Apple Silicon with stock mlx_lm. No additional
quantization was applied: the source INT4 codes and scales are copied bit-identically.
Requires ~330+ GB of unified memory. Developed and tested on a Mac Studio M3 Ultra (512 GB). Expect ~13 tok/s decode at any context length, 126–205 tok/s prefill depending on context length.
Usage
pip install mlx-lm>=0.31
mlx_lm.generate --model openvuln/altar-1-4bit-mlx \
--prompt "The capital of France is" --max-tokens 32
from mlx_lm import load, generate
model, tokenizer = load("openvuln/altar-1-4bit-mlx")
response = generate(model, tokenizer, prompt="Write a haiku about firewalls", max_tokens=64)
print(response)
OpenAI-compatible server:
mlx_lm.server --model openvuln/altar-1-4bit-mlx
# API on http://127.0.0.1:8080/v1
The custom model file (glm_moe_dsa_shared.py)
GLM-5.3's DeepSeek Sparse Attention computes the indexer top-k only on "full" layers;
"shared" layers reuse the previous full layer's selection. Materializing per-layer
indexer weights (required for a plain checkpoint) changes that behavior and stutters
on long contexts. This repo therefore ships glm_moe_dsa_shared.py, which
mlx_lm loads automatically via "model_file" in config.json (no
trust_remote_code flag needed) to restore true index sharing at run time.
Keep the .py file when copying the checkpoint — the model does not load without it.
Fidelity vs AikidoSec/altar-1
- INT4 codes, scales, and the computed MLX biases are bit-identical to the source (exhaustive audit, ~112k tensor comparisons).
kv_b_projis requantized at the same 4 bits / group 32 by mlx-lm's ownsanitize()(146 tensors, max deviation 0.856 of one quantization step; mathematical bound 1.0) — identical to official mlx-lm conversions of this family.- The MTP (multi-token prediction) layer that mlx-lm drops is not included.
Performance (Mac Studio M3 Ultra, 512 GB)
| context | prefill (tok/s) | TTFT | decode (tok/s) | peak memory |
|---|---|---|---|---|
| 128 | 86 | 1.5 s | 13.7 | 315 GB |
| 2k (dense) | 205 | 10.0 s | 12.6 | 319 GB |
| 4k | 194 | 21.1 s | 13.0 | 320 GB |
| 8k (DSA sparse) | 167 | 49.0 s | 12.3 | 323 GB |
| 16k | 126 | 2.2 min | 12.6 | 329 GB |
| 64k | 44.5 | 24.5 min | 11.7 | 367 GB |
| 128k | 23.7 | 92.3 min | 11.5 | 406 GB |
| 256k | ~12 (est.) | ~6.2 h (est., not run) | ~11.5 (est.) | ~485 GB (est.) |
Serving with mlx_lm.server, decode throughput scales with concurrency (MoE
batching): 12.4 tok/s single stream, 18.6 at 2 streams, 26.4 at 4.
License
Inherits the GLM-5.3 license through AikidoSec/altar-1 and cyankiwi/GLM-5.3-AWQ-INT4.
- Downloads last month
- 111
4-bit