Instructions to use unigilby/Hy3-MLX-MXFP4-imatrix with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use unigilby/Hy3-MLX-MXFP4-imatrix 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("unigilby/Hy3-MLX-MXFP4-imatrix") 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 unigilby/Hy3-MLX-MXFP4-imatrix with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "unigilby/Hy3-MLX-MXFP4-imatrix"
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": "unigilby/Hy3-MLX-MXFP4-imatrix" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use unigilby/Hy3-MLX-MXFP4-imatrix 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 "unigilby/Hy3-MLX-MXFP4-imatrix"
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 unigilby/Hy3-MLX-MXFP4-imatrix
Run Hermes
hermes
- OpenClaw new
How to use unigilby/Hy3-MLX-MXFP4-imatrix with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "unigilby/Hy3-MLX-MXFP4-imatrix"
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 "unigilby/Hy3-MLX-MXFP4-imatrix" \ --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 unigilby/Hy3-MLX-MXFP4-imatrix with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "unigilby/Hy3-MLX-MXFP4-imatrix"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "unigilby/Hy3-MLX-MXFP4-imatrix" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unigilby/Hy3-MLX-MXFP4-imatrix", "messages": [ {"role": "user", "content": "Hello"} ] }'
Hy3-MLX-MXFP4-imatrix
MX-float (mxfp4/mxfp8, group size 32) quantization of tencent/Hy3 (HunYuan V3, 80-layer MoE: 192 routed experts + 1 shared, sigmoid router with expert bias), placed by the imatrix + sensitivity analysis of its affine sibling unigilby/Hy3-oQ4e: mxfp4 where the oQ4e chose 4-bit (237 modules), mxfp8 where it boosted precision (562 modules — concentrated in the most sensitive layers 76–79 and 2–4), bf16 elsewhere.
- 150 GB (vs 158 GB affine oQ4e, from the 598 GB BF16 source).
- Same 128×512-token imatrix calibration (876 entries incl. per-expert statistics for all 192 experts) as the oQ4e.
- MTP (
num_nextn_predict_layers) weights stripped; pure decoder checkpoint. - Coherency at temperature 0: 5/6 vs the oQ4e's 6/6 (one 3-digit multiplication slip, 30504 for 847×36=30492; reasoning, code, facts, and format-following all exact).
⚠️ Benchmarked: prefer the affine oQ4e for this model
On a 12-category graded benchmark (thinking mode on), this MX-float quant lost clearly to its affine sibling Hy3-oQ4e at identical speed (~25 tok/s on M3 Ultra). The failure mode is sporadic stray-token garbling in long outputs — corrupted identifiers appearing inside otherwise-correct code, configs, and contract clauses (coding graded C vs the oQ4e's A-; prose and medical categories held A-range). The cause: mxfp4's parameter-free E2M1 rounding (power-of-two block scales, no zero-point, nothing for the imatrix to optimize within a block) damages precision-critical circuits that the imatrix-weighted affine fit preserves. The longer the generation, the more often a garble lands.
Interesting datapoint: the same recipe on MiniMax-M3 produced an MX-float sibling that matched its affine twin — MX-float-at-affine-placements is model-dependent, and for Hy3 it does not hold. This repo stays up as that datapoint; for serving, use Hy3-oQ4e.
Requirements
model_type: hy_v3 support is not yet merged into mlx-lm — it requires
mlx-lm PR #1211 (adds
mlx_lm/models/hy_v3.py, the hy_v3 tool parsers, and thinking-tag inference).
Apply the PR (or install from its branch) before loading:
from mlx_lm import load, generate
model, tokenizer = load("unigilby/Hy3-MLX-MXFP4-imatrix")
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": "Hello!"}], add_generation_prompt=True
)
print(generate(model, tokenizer, prompt=prompt, max_tokens=200))
Quantized with oMLX quantize_oq_streaming
(MX-float predicate at oQ4e placements) on a Mac Studio M3 Ultra.
- Downloads last month
- 5
4-bit
Model tree for unigilby/Hy3-MLX-MXFP4-imatrix
Base model
tencent/Hy3