Instructions to use enyoukai/Hy3-4bit-mtp-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use enyoukai/Hy3-4bit-mtp-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("enyoukai/Hy3-4bit-mtp-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 enyoukai/Hy3-4bit-mtp-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 "enyoukai/Hy3-4bit-mtp-mlx"
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": "enyoukai/Hy3-4bit-mtp-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use enyoukai/Hy3-4bit-mtp-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 "enyoukai/Hy3-4bit-mtp-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 enyoukai/Hy3-4bit-mtp-mlx
Run Hermes
hermes
- OpenClaw new
How to use enyoukai/Hy3-4bit-mtp-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 "enyoukai/Hy3-4bit-mtp-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 "enyoukai/Hy3-4bit-mtp-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"
- MLX LM
How to use enyoukai/Hy3-4bit-mtp-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 "enyoukai/Hy3-4bit-mtp-mlx"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "enyoukai/Hy3-4bit-mtp-mlx" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "enyoukai/Hy3-4bit-mtp-mlx", "messages": [ {"role": "user", "content": "Hello"} ] }'
Hy3-4bit-mtp-mlx
4-bit MLX quant of tencent/Hy3 with the MTP head actually included.
The circulating MLX quants of Hy3 drop the multi-token-prediction layer (layer 80) because mlx-lm's converter doesn't map it. Their configs still say num_nextn_predict_layers: 1, but the weights aren't there, so speculative decoding can't run.
Contents
- Backbone: the 34 shards from XavierLocalAI/Hy3-4bit, unchanged. Checked before reuse: pass-through tensors are bit-identical to the official bf16 weights, and dequantization error sits at the expected bound for affine 4-bit.
- Layer 80 (MTP head, in
model-mtp-00001.safetensors): quantized from the official tencent/Hy3 bf16 weights withmlx.core.quantize, same recipe as the backbone (affine, group size 64, 4-bit, router gate 8-bit). 99% of elements reconstruct within half a quantization step of the originals. - Config: adds the layer 80 router gate override so the quant block matches the weights.
Serving
Runs on vLLM TPU (tpu-inference) with speculative decoding:
vllm serve enyoukai/Hy3-4bit-mtp-mlx \
--trust-remote-code --enable-expert-parallel \
--speculative-config '{"method":"mtp","num_speculative_tokens":2}'
Measured on a v6e-8: draft acceptance length about 1.5 at temperature 0.7 with batch 8, about 1.7 single stream. Same ballpark as the preview-era quants got from their own MTP head.
Credits
- Base model: Tencent (
tencent/Hy3, Apache-2.0) - Backbone quant: XavierLocalAI / bicVanYonk
- MTP layer quant: this repo
- Downloads last month
- 445
4-bit
Model tree for enyoukai/Hy3-4bit-mtp-mlx
Base model
tencent/Hy3