Text Generation
MLX
Safetensors
English
Chinese
hy_v4
quantized
hy4
Mixture of Experts
conversational
4-bit precision
Instructions to use Xylolabs/Hy4-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Xylolabs/Hy4-MLX-4bit 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("Xylolabs/Hy4-MLX-4bit") 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 Xylolabs/Hy4-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Xylolabs/Hy4-MLX-4bit"
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": "Xylolabs/Hy4-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Xylolabs/Hy4-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Xylolabs/Hy4-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Xylolabs/Hy4-MLX-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xylolabs/Hy4-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Xylolabs/Hy4-MLX-4bit 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 "Xylolabs/Hy4-MLX-4bit"
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 Xylolabs/Hy4-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Xylolabs/Hy4-MLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Xylolabs/Hy4-MLX-4bit"
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 "Xylolabs/Hy4-MLX-4bit" \ --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"
Card: publish corrected accuracy and metric charts
Browse files- .gitattributes +4 -0
- README.md +9 -4
- accuracy-by-size.csv +7 -3
- accuracy-kl-dark.png +0 -0
- accuracy-kl.png +0 -0
- accuracy-top1-dark.png +0 -0
- accuracy-top1.png +0 -0
.gitattributes
CHANGED
|
@@ -35,3 +35,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
accuracy-by-size.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
accuracy-by-size-dark.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
accuracy-by-size.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
accuracy-by-size-dark.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
accuracy-kl-dark.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
accuracy-kl.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
accuracy-top1-dark.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
accuracy-top1.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -66,12 +66,17 @@ Mean KL divergence from BF16 (lower is better) and top-1 agreement with BF16.
|
|
| 66 |
|
| 67 |
| Quant | Size | WikiText-2 KL | top-1 | Chat KL | top-1 | Held-out KL | top-1 |
|
| 68 |
|---|---:|---:|---:|---:|---:|---:|---:|
|
| 69 |
-
| **MLX 4-bit** | 447.58 GB | **0.
|
| 70 |
-
| **MLX 8-bit** | 819.63 GB | | | | | | |
|
| 71 |
|
| 72 |
<picture>
|
| 73 |
-
<source media="(prefers-color-scheme: dark)" srcset="
|
| 74 |
-
<img src="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
</picture>
|
| 76 |
|
| 77 |
## License and notices
|
|
|
|
| 66 |
|
| 67 |
| Quant | Size | WikiText-2 KL | top-1 | Chat KL | top-1 | Held-out KL | top-1 |
|
| 68 |
|---|---:|---:|---:|---:|---:|---:|---:|
|
| 69 |
+
| **MLX 4-bit** | **447.58 GB** | **0.142528** | **88.549%** | **0.193011** | **90.126%** | **0.066185** | **92.363%** |
|
| 70 |
+
| **MLX 8-bit** | **819.63 GB** | | | | | | |
|
| 71 |
|
| 72 |
<picture>
|
| 73 |
+
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/Xylolabs/Hy4-MLX-4bit/resolve/main/accuracy-kl-dark.png">
|
| 74 |
+
<img src="https://huggingface.co/Xylolabs/Hy4-MLX-4bit/resolve/main/accuracy-kl.png" alt="Mean KL divergence by file size">
|
| 75 |
+
</picture>
|
| 76 |
+
|
| 77 |
+
<picture>
|
| 78 |
+
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/Xylolabs/Hy4-MLX-4bit/resolve/main/accuracy-top1-dark.png">
|
| 79 |
+
<img src="https://huggingface.co/Xylolabs/Hy4-MLX-4bit/resolve/main/accuracy-top1.png" alt="Top-1 agreement by file size">
|
| 80 |
</picture>
|
| 81 |
|
| 82 |
## License and notices
|
accuracy-by-size.csv
CHANGED
|
@@ -1,3 +1,7 @@
|
|
| 1 |
-
provider,quant,bytes,kl,top1,text,context,chunk_indices,chunk_count,scored_positions,scored_predictions,reference,reference_revision,software,batch,
|
| 2 |
-
Xylolabs,MLX 4-bit,447576537740,0.
|
| 3 |
-
Xylolabs,MLX
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
provider,quant,bytes,kl,top1,text,context,chunk_indices,chunk_count,scored_positions,scored_predictions,ppl,reference,reference_revision,reference_batch,reference_ubatch,reference_software,software,batch,input_sha256,result_log_sha256,weight_repo,weight_revision,source,size_source,measurement_note,chart_selected
|
| 2 |
+
Xylolabs,MLX 4-bit,447576537740,0.1425278112316929,88.54901960784314,WikiText-2 raw test,512,0-79,80,256-510,20400,3.3099513725070513,tencent/Hy4 BF16 GGUF with native FP8 Engram; checked redo bases,c10c0de5b6f850703fb0a90e65d1c32b558b9167,12288,12288,llama.cpp; checked BIG_BASES2 redo completed 2026-11-21,MLX 0.32.4; mlx-lm 0.32.2; CUDA 13; bf16 activations; fp32 LM head; zero cache; sequential layer loading,1,173c87a53759e0201f33e0ccf978e510c2042d7f2cb78229d9a50d79b9e7dd08,3766cffb20a064f19e033e41bd9617fe9157d12cebaff439ca5055f1b96731d1,Xylolabs/Hy4-MLX-4bit,41619c55b00b41f7900c7d60c66eb0c790b63a6d,https://huggingface.co/Xylolabs/Hy4-MLX-4bit/tree/41619c55b00b41f7900c7d60c66eb0c790b63a6d,Exact sum of safetensors weight bytes at pinned Hub revision,Corrected full aggregate; no exclusions or batch-bug rows,yes
|
| 3 |
+
Xylolabs,MLX 4-bit,447576537740,0.19301077975582598,90.1256913021619,Chat evaluation text,512,0-38,39,256-510,9945,11.838745453335,tencent/Hy4 BF16 GGUF with native FP8 Engram; checked redo bases,c10c0de5b6f850703fb0a90e65d1c32b558b9167,12288,12288,llama.cpp; checked BIG_BASES2 redo completed 2026-11-21,MLX 0.32.4; mlx-lm 0.32.2; CUDA 13; bf16 activations; fp32 LM head; zero cache; sequential layer loading,1,f84b78403f3719ae91118fff277c8c17da876545c2be32f98734b062df00fb5b,3766cffb20a064f19e033e41bd9617fe9157d12cebaff439ca5055f1b96731d1,Xylolabs/Hy4-MLX-4bit,41619c55b00b41f7900c7d60c66eb0c790b63a6d,https://huggingface.co/Xylolabs/Hy4-MLX-4bit/tree/41619c55b00b41f7900c7d60c66eb0c790b63a6d,Exact sum of safetensors weight bytes at pinned Hub revision,Corrected full aggregate; no exclusions or batch-bug rows,no
|
| 4 |
+
Xylolabs,MLX 4-bit,447576537740,0.06618458081589519,92.36274509803921,Held-out evaluation text,512,0-39,40,256-510,10200,3.7460758857742245,tencent/Hy4 BF16 GGUF with native FP8 Engram; checked redo bases,c10c0de5b6f850703fb0a90e65d1c32b558b9167,12288,12288,llama.cpp; checked BIG_BASES2 redo completed 2026-11-21,MLX 0.32.4; mlx-lm 0.32.2; CUDA 13; bf16 activations; fp32 LM head; zero cache; sequential layer loading,1,4d3d0d85545c1738bf0b7e0c1d1cd74f09523c27d34d9e1a9c51e44f3de4c665,3766cffb20a064f19e033e41bd9617fe9157d12cebaff439ca5055f1b96731d1,Xylolabs/Hy4-MLX-4bit,41619c55b00b41f7900c7d60c66eb0c790b63a6d,https://huggingface.co/Xylolabs/Hy4-MLX-4bit/tree/41619c55b00b41f7900c7d60c66eb0c790b63a6d,Exact sum of safetensors weight bytes at pinned Hub revision,Corrected full aggregate; no exclusions or batch-bug rows,no
|
| 5 |
+
Xylolabs,MLX 8-bit,819628080300,,,WikiText-2 raw test,512,0-79,80,256-510,20400,,tencent/Hy4 BF16 GGUF with native FP8 Engram; checked redo bases,c10c0de5b6f850703fb0a90e65d1c32b558b9167,12288,12288,llama.cpp; checked BIG_BASES2 redo completed 2026-11-21,MLX 0.32.4; mlx-lm 0.32.2; CUDA 13; bf16 activations; fp32 LM head; zero cache; sequential layer loading,1,173c87a53759e0201f33e0ccf978e510c2042d7f2cb78229d9a50d79b9e7dd08,,Xylolabs/Hy4-MLX-8bit,cbce8a7f0cde8ca47731102c596a41208932c4de,https://huggingface.co/Xylolabs/Hy4-MLX-8bit/tree/cbce8a7f0cde8ca47731102c596a41208932c4de,Exact sum of safetensors weight bytes at pinned Hub revision,Pending; no completed corrected 8-bit measurement,yes
|
| 6 |
+
Xylolabs,MLX 8-bit,819628080300,,,Chat evaluation text,512,0-38,39,256-510,9945,,tencent/Hy4 BF16 GGUF with native FP8 Engram; checked redo bases,c10c0de5b6f850703fb0a90e65d1c32b558b9167,12288,12288,llama.cpp; checked BIG_BASES2 redo completed 2026-11-21,MLX 0.32.4; mlx-lm 0.32.2; CUDA 13; bf16 activations; fp32 LM head; zero cache; sequential layer loading,1,f84b78403f3719ae91118fff277c8c17da876545c2be32f98734b062df00fb5b,,Xylolabs/Hy4-MLX-8bit,cbce8a7f0cde8ca47731102c596a41208932c4de,https://huggingface.co/Xylolabs/Hy4-MLX-8bit/tree/cbce8a7f0cde8ca47731102c596a41208932c4de,Exact sum of safetensors weight bytes at pinned Hub revision,Pending; no completed corrected 8-bit measurement,no
|
| 7 |
+
Xylolabs,MLX 8-bit,819628080300,,,Held-out evaluation text,512,0-39,40,256-510,10200,,tencent/Hy4 BF16 GGUF with native FP8 Engram; checked redo bases,c10c0de5b6f850703fb0a90e65d1c32b558b9167,12288,12288,llama.cpp; checked BIG_BASES2 redo completed 2026-11-21,MLX 0.32.4; mlx-lm 0.32.2; CUDA 13; bf16 activations; fp32 LM head; zero cache; sequential layer loading,1,4d3d0d85545c1738bf0b7e0c1d1cd74f09523c27d34d9e1a9c51e44f3de4c665,,Xylolabs/Hy4-MLX-8bit,cbce8a7f0cde8ca47731102c596a41208932c4de,https://huggingface.co/Xylolabs/Hy4-MLX-8bit/tree/cbce8a7f0cde8ca47731102c596a41208932c4de,Exact sum of safetensors weight bytes at pinned Hub revision,Pending; no completed corrected 8-bit measurement,no
|
accuracy-kl-dark.png
ADDED
|
accuracy-kl.png
ADDED
|
accuracy-top1-dark.png
ADDED
|
accuracy-top1.png
ADDED
|