Instructions to use Xylolabs/Hy4-flash-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Xylolabs/Hy4-flash-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Xylolabs/Hy4-flash-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Xylolabs/Hy4-flash-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Xylolabs/Hy4-flash-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Xylolabs/Hy4-flash-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Xylolabs/Hy4-flash-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Xylolabs/Hy4-flash-GGUF:Q4_K_M
Use Docker
docker model run hf.co/Xylolabs/Hy4-flash-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use Xylolabs/Hy4-flash-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Xylolabs/Hy4-flash-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xylolabs/Hy4-flash-GGUF", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Xylolabs/Hy4-flash-GGUF:Q4_K_M
- Ollama
How to use Xylolabs/Hy4-flash-GGUF with Ollama:
ollama run hf.co/Xylolabs/Hy4-flash-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use Xylolabs/Hy4-flash-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Xylolabs/Hy4-flash-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Xylolabs/Hy4-flash-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Xylolabs/Hy4-flash-GGUF with Docker Model Runner:
docker model run hf.co/Xylolabs/Hy4-flash-GGUF:Q4_K_M
- Lemonade
How to use Xylolabs/Hy4-flash-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Xylolabs/Hy4-flash-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Hy4-flash-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Xylolabs/Hy4-flash-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Xylolabs/Hy4-flash-GGUF:Q4_K_M
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:9931/v1 hermes config set model.default Xylolabs/Hy4-flash-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Xylolabs/Hy4-flash-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Xylolabs/Hy4-flash-GGUF:Q4_K_M
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:9931/v1 \ --custom-model-id "Xylolabs/Hy4-flash-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
GGUF quants of tencent/Hy4-flash (220B parameters, 12B active) for llama.cpp, on CUDA, Metal or CPU, without the DFly2 speculative-decoding drafter.
Files
| Files | Size |
|---|---|
Hy4-flash-Q8_0-00001-of-00002.gguf to Hy4-flash-Q8_0-00002-of-00002.gguf |
228.859 GB |
Hy4-flash-Q6_K-00001-of-00002.gguf to Hy4-flash-Q6_K-00002-of-00002.gguf |
193.251 GB |
Hy4-flash-Q5_K_M-00001-of-00002.gguf to Hy4-flash-Q5_K_M-00002-of-00002.gguf |
176.726 GB |
Hy4-flash-Q4_K_M-00001-of-00002.gguf to Hy4-flash-Q4_K_M-00002-of-00002.gguf |
161.174 GB |
Hy4-flash-Q4_K_S-00001-of-00002.gguf to Hy4-flash-Q4_K_S-00002-of-00002.gguf |
155.549 GB |
Hy4-flash-NVFP4-00001-of-00002.gguf to Hy4-flash-NVFP4-00002-of-00002.gguf |
154.945 GB |
Hy4-flash-Q4M-E5-00001-of-00002.gguf to Hy4-flash-Q4M-E5-00002-of-00002.gguf |
141.373 GB |
Hy4-flash-Q4M-E4-00001-of-00002.gguf to Hy4-flash-Q4M-E4-00002-of-00002.gguf |
133.453 GB |
Hy4-flash-IQ4_XS-E4-00001-of-00002.gguf to Hy4-flash-IQ4_XS-E4-00002-of-00002.gguf |
122.582 GB |
Hy4-flash-Q3_K_M-E4-00001-of-00002.gguf to Hy4-flash-Q3_K_M-E4-00002-of-00002.gguf |
114.220 GB |
Hy4-flash-IQ3_M-E4-00001-of-00002.gguf to Hy4-flash-IQ3_M-E4-00002-of-00002.gguf |
108.133 GB |
Hy4-flash-IQ3_XXS-E4-00001-of-00002.gguf to Hy4-flash-IQ3_XXS-E4-00002-of-00002.gguf |
100.527 GB |
Hy4-flash-IQ2_M-E4-00001-of-00002.gguf to Hy4-flash-IQ2_M-E4-00002-of-00002.gguf |
91.901 GB |
Hy4-flash-IQ2_XXS-E4-00001-of-00002.gguf to Hy4-flash-IQ2_XXS-E4-00002-of-00002.gguf |
83.070 GB |
mmproj-Hy4-flash-BF16.gguf |
1.044 GB |
mmproj-Hy4-flash-Q8_0.gguf |
0.785 GB |
Hy4-flash.imatrix.gguf |
0.810 GB |
Q4M-E5 and Q4M-E4 are Q4_K_M with Q5_0 and IQ4_NL Engram tables (the Q4_K_M / Q5_0 and Q4_K_M / IQ4_NL rows of the accuracy table). NVFP4 is for NVIDIA Blackwell GPUs, where llama.cpp runs it on the native FP4 tensor cores; Q4M-E5 is smaller and more accurate.
Which file for your hardware
The most accurate of our files whose weights, the KV cache at the stated context and about 2 GB of buffers fit in 90% of the memory. The KV cache is llama.cpp's f16 latent cache: 0.79 GB at 32K tokens, 24.2 GB at 1M. On discrete GPUs the Engram table stays in system RAM, as in the commands below; on unified memory the whole file counts. The vision projector adds 0.8 GB (Q8_0) or 1.0 GB (BF16).
| Hardware | Memory | Recommended file | Context that fits | Notes |
|---|---|---|---|---|
| RTX 4090 / RTX 3090 | 24 GB | Q4_K_M (offload, slower) | 32K | routed experts and Engram table in system RAM with -ot '.ffn_.*_exps.=CPU'; about 11 GB on the GPU; system RAM needed: Q4_K_M 153 GB, IQ4_XS-E4 115 GB, IQ2_XXS-E4 75 GB (less with --n-cpu-moe N, which puts only the first N layers' experts in RAM) |
| RTX 5090 | 32 GB | Q4_K_M (offload, slower) | 32K | routed experts and Engram table in system RAM with -ot '.ffn_.*_exps.=CPU'; about 11 GB on the GPU; system RAM needed: Q4_K_M 153 GB, IQ4_XS-E4 115 GB, IQ2_XXS-E4 75 GB (less with --n-cpu-moe N, which puts only the first N layers' experts in RAM) |
| RTX 6000 Ada (or 2 x 24 GB) | 48 GB | Q4_K_M (offload, slower) | 32K | routed experts and Engram table in system RAM with -ot '.ffn_.*_exps.=CPU'; about 11 GB on the GPU; system RAM needed: Q4_K_M 153 GB, IQ4_XS-E4 115 GB, IQ2_XXS-E4 75 GB (less with --n-cpu-moe N, which puts only the first N layers' experts in RAM) |
| H100 | 80 GB | IQ3_XXS-E4 | 32K (up to 192K) | Engram table (35.6 GB) in system RAM; 64.9 GB on the GPU |
| RTX PRO 6000 Blackwell | 96 GB | Q3_K_M-E4 | 32K (up to 224K) | Engram table (35.6 GB) in system RAM; 78.6 GB on the GPU |
| DGX Spark | 128 GB unified | IQ3_M-E4 | 32K (up to 192K) | unified memory: the whole file, Engram table included, counts |
| Mac Studio M5 Max | 128 GB unified | IQ3_M-E4 | 32K (up to 192K) after raising the limit | macOS lets the GPU use about 75% of memory by default (96 GB); this file needs about 111 GB at 32K; needs the macOS GPU memory limit raised. |
| H200 | 141 GB | Q5_K_M | 32K (up to 480K) | Engram table (63.4 GB) in system RAM; 113.4 GB on the GPU |
| B200 | 192 GB (about 180 GB usable) | Q6_K | 32K (up to 1M) | Engram table (63.4 GB) in system RAM; 129.9 GB on the GPU; NVFP4 (91.6 GB on the GPU) also fits; llama.cpp has native FP4 tensor-core kernels for it on Blackwell, but it is less accurate than Q6_K |
| Mac Studio M5 Ultra | 256 GB unified | Q6_K | 32K (up to 1M) after raising the limit | macOS lets the GPU use about 75% of memory by default (192 GB); this file needs about 196 GB at 32K; needs the macOS GPU memory limit raised. |
| Mac Studio M5 Ultra | 512 GB unified | Q8_0 | 32K (up to 1M) | macOS lets the GPU use about 75% of memory by default (384 GB), enough here |
| B300 | 288 GB | Q8_0 | 32K (up to 1M) | Engram table (63.4 GB) in system RAM; 165.5 GB on the GPU; NVFP4 (91.6 GB on the GPU) also fits; llama.cpp has native FP4 tensor-core kernels for it on Blackwell, but it is less accurate than Q8_0 |
| 2 x H100 | 160 GB | Q6_K | 32K (up to 416K) | Engram table (63.4 GB) in system RAM; 129.9 GB on the GPUs |
How to run
Keep both shards of the chosen pair in the same folder and pass the first shard to llama.cpp.
Hy4-flash support in llama.cpp is pull request #32517 (commit 0a054d0b0) until it is merged. The same build runs on CUDA and on Metal. Tencent's patched build also loads these files.
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
git fetch origin pull/32517/head:hy4-flash && git checkout hy4-flash
cmake -B build -DCMAKE_BUILD_TYPE=Release # add -DGGML_CUDA=ON for NVIDIA GPUs
cmake --build build -j --target llama-cli llama-server
./build/bin/llama-cli -m Hy4-flash-Q4_K_M-00001-of-00002.gguf \
--override-tensor '^per_layer_token_embd\.weight$=CPU' --load-mode mmap --lazy-mode on \
-ngl 99 --jinja -c 8192
--override-tensor keeps the Engram tables in host memory, and --load-mode mmap --lazy-mode on reads them from disk only when a prompt needs them. llama-server takes the same flags.
Accuracy
Mean KL divergence from BF16 (lower is better) and top-1 agreement with BF16, measured with llama.cpp.
| Quant | Size | WikiText-2 KL | top-1 | Chat KL | top-1 | Held-out KL | top-1 | Answers |
|---|---|---|---|---|---|---|---|---|
| Q8_0 / E4M3 | 228.859 GB | 0.1450 | 88.343% | 0.2483 | 87.501% | 0.1051 | 90.333% | 5/5 |
| Q6_K / E4M3 | 193.251 GB | 0.1458 | 87.882% | 0.2486 | 87.179% | 0.0998 | 90.392% | 5/5 |
| Q5_K_M / E4M3 | 176.726 GB | 0.1664 | 87.500% | 0.2705 | 86.637% | 0.1127 | 89.500% | 5/5 |
| AngelSlim Q4_K_M | 168.347 GB | 0.2161 | 85.059% | 0.3335 | 84.816% | 0.1384 | 88.686% | |
| Q4_K_M / E4M3 | 161.174 GB | 0.2123 | 85.078% | 0.3205 | 85.339% | 0.1444 | 88.529% | 5/5 |
| Q4_K_S / E4M3 | 155.549 GB | 0.2202 | 84.946% | 0.3498 | 85.118% | 0.1489 | 88.157% | 5/5 |
| AngelSlim Q3_K | 155.371 GB | 0.2969 | 82.392% | 0.4543 | 82.192% | 0.2109 | 86.059% | |
| NVFP4 / E4M3 | 154.945 GB | 0.2511 | 83.814% | 0.4033 | 83.348% | 0.1724 | 87.324% | 5/5 |
| Q4_K_M / Q5_0 | 141.373 GB | 0.2235 | 85.025% | 0.3586 | 85.108% | 0.1416 | 88.863% | 5/5 |
| AngelSlim IQ2_AH | 134.996 GB | 0.7328 | 71.353% | 1.0025 | 73.826% | 0.5515 | 76.559% | |
| Q4_K_M / IQ4_NL | 133.453 GB | 0.2333 | 85.049% | 0.3514 | 84.424% | 0.1556 | 88.265% | 5/5 |
| IQ4_XS / IQ4_NL | 122.582 GB | 0.2362 | 84.422% | 0.3671 | 84.253% | 0.1706 | 87.725% | 5/5 |
| Q3_K_M / IQ4_NL | 114.220 GB | 0.3393 | 80.966% | 0.5192 | 81.227% | 0.2446 | 84.833% | 5/5 |
| IQ3_M / IQ4_NL | 108.133 GB | 0.4028 | 79.417% | 0.5664 | 79.789% | 0.3105 | 82.775% | 5/5 |
| IQ3_XXS / IQ4_NL | 100.527 GB | 0.4698 | 77.304% | 0.6502 | 78.552% | 0.3389 | 81.412% | 5/5 |
| IQ2_M / IQ4_NL | 91.901 GB | 0.6412 | 73.324% | 0.8604 | 74.862% | 0.4699 | 78.167% | 5/5 |
| Others 0 | 84.701 GB | 0.8341 | 69.069% | 1.1769 | 72.097% | 0.6315 | 74.951% | |
| IQ2_XXS + IQ2_S / MXFP4 | 83.070 GB | 0.8349 | 69.314% | 1.1280 | 72.086% | 0.6276 | 75.059% | 5/5 |
License and notices
These files are under the Tencent Hy License, Version 1.0, copied in LICENSE. Its terms apply to them, including the extra terms for large Model-as-a-Service operators. NOTICE names the source model and its copyright holder. Xylolabs is not affiliated with or endorsed by Tencent.
Updates
- 2026-11-22: Replaced NVFP4 with a more accurate file in the same format: mean KL 16%, 5% and 14% lower on WikiText-2, chat and held-out text, at the same 154.9 GB. Added a hardware recommendation table.
- 2026-11-22: Renamed the files with smaller Engram tables so that the Hub's quant list does not count them under its Q5_0, IQ4_NL, MXFP4 or Q4_K_M entries:
Q4_K_M-EQ5_0andQ4_K_M-EIQ4_NLare nowQ4M-E5andQ4M-E4;IQ4_XS-EIQ4_NL,Q3_K_M-EIQ4_NL,IQ3_M-EIQ4_NL,IQ3_XXS-EIQ4_NLandIQ2_M-EIQ4_NLare nowIQ4_XS-E4,Q3_K_M-E4,IQ3_M-E4,IQ3_XXS-E4andIQ2_M-E4;IQ2_XXS-IQ2_S-EMXFP4is nowIQ2_XXS-E4. The files are unchanged. - 2026-11-22: Removed IQ4_XS, Q3_K_M, IQ3_M, IQ3_XXS, Q2_K and IQ2_M with FP8 Engram tables, and Q3_K_M with Q5_0 Engram tables, to save storage; the files that stay cover the same size range.
- 2026-11-22: Added IQ2_M, IQ3_XXS, IQ3_M and IQ4_XS with IQ4_NL Engram tables (91.9 to 122.6 GB), IQ2_XXS with IQ2_S down projections and MXFP4 Engram tables (83.1 GB), and NVFP4 (154.9 GB). The accuracy table and charts were re-measured against a rebuilt BF16 reference on WikiText-2, chat and held-out text; all earlier values are replaced.
- 2026-11-20: First release: Q8_0 to IQ2_M with FP8 E4M3 Engram tables (two parts each), Q4_K_M and Q3_K_M with Q5_0 or IQ4_NL Engram tables, the importance matrix and the BF16 and Q8_0 vision projectors.
Tencent's original model description
The text below is reproduced from the README of tencent/Hy4-flash (the model introduction, highlights, benchmarks, quickstart and deployment sections), copyright Tencent, under the Tencent Hy License (see above). It describes Tencent's original model, not these files, and its usage instructions (Transformers, vLLM, SGLang) are for Tencent's checkpoints; for the GGUF files use "How to run" above. Changes by Xylolabs: heading levels are one level deeper, and image and link paths point to Tencent's repository instead of copies; the wording is unchanged. Tencent's own README is the authoritative version.
Model Introduction
Hy4 flash is our most cost-effective Hy model to date, featuring 220B total parameters (including 64B Engram parameters) with just 12B active parameters per token. It natively accepts text and image inputs, generates text, and supports a context window of up to 1M tokens.
Its 42-layer language backbone consists of one dense feed-forward layer and 41 MoE layers, with identity Hyper-Connections (iHC) supporting inter-layer information flow. A vision encoder (adapted from SigLIP2-So400m-Patch16-Res512) is connected to the backbone through an MLP projector. In addition to the backbone, a built-in 5-layer drafter, DFly2 (0.85B parameters), reuses the target model's KV cache and sparse indices to support long-context speculative decoding at a low, constant cost.
Compared with Hy4, Hy4 Flash introduces three notable architectural changes:
- Hybrid attention. Sparse attention (IndexPool) and sliding-window attention (SWA) are interleaved at a 1:3 ratio.
- LatentMoE. Routed experts operate in a lower-dimensional latent space. Each token activates 16 of 512 routed experts, alongside one shared expert.
- N-gram embedding (Engram). The backbone is augmented with learned bigram and trigram representations, retrieved via multi-head hash lookups.
| Property | Value |
|---|---|
| Overview | |
| Architecture | Mixture-of-Experts (MoE) |
| Total Parameters (excluding Engram, ViT, and DFly2) | 155.5B |
| Engram Parameters | 63.5B |
| ViT Parameters | 0.43B |
| DFly2 Parameters | 0.85B |
| Activated Parameters per Token | Text 11.3B + Vision 0.43B |
| Context Length | 1M (1,048,576 tokens) |
| Language Backbone | |
| Backbone Layers | 42 — 1 dense layer and 41 MoE layers |
| Hidden Size | 3,072 |
| Vocabulary Size | 120,832 |
| Residual Connections | iHC (identity Hyper-Connections) with 4 residual streams |
| Attention — Hybrid Layout | |
| Attention Architecture | Sparse attention + sliding-window attention (SWA) |
| Backbone Layer Pattern | 2 × Sparse → 10 × (3 × SWA → Sparse) |
| Attention Formulation | Multi-head Latent Attention (MLA) |
| Multimodal Position Encoding | Interleaved MRoPE |
| Attention — Layers | Sparse / SWA |
| Backbone Layers | 12 / 30 |
| Attention Heads | 32 / 64 |
| MLA q_lora_rank | 1,024 / 1,024 |
| MLA kv_lora_rank | 512 / 512 |
| QK Head Dimension (non-RoPE + RoPE) | 192 + 64 / 192 + 64 |
| Value Head Dimension | 256 / 256 |
| RoPE Base | 10,000,000 / 10,000 |
| Sparse Context Selection | Up to 2,048 tokens via group-level selection |
| SWA Context Window | 512-token causal window (511 preceding + current) |
| Feed-Forward Networks | |
| Dense FFN Intermediate Size | 13,824 |
| Routed Experts per MoE Layer | 512 |
| Shared Experts per MoE Layer | 1 |
| Activated Routed Experts per Token | 16 |
| MoE Latent Dimension | 1,536 |
| Expert Intermediate Size | 1,536 |
| N-gram Embedding | |
| N-gram Orders | Bigrams and trigrams |
| Backbone Layer Indices (starting from 0) | 1, 11, 21, 31 |
| Hash Heads per N-gram Order | 8 |
| Hash Vocabulary Size per Head | 10.3M |
| Embedding Dimension per N-gram Order | 768 (8 heads × 96 dimensions) |
| Embedding Table Parameters | 63.4B |
| Vision Encoder | |
| Vision Encoder Layers | 27 |
| Vision Encoder Hidden Size | 1,152 |
| Vision Encoder Intermediate Size | 4,304 |
| Vision Encoder Attention Heads | 16 |
| Vision Patch Size | 16 × 16 |
| Vision Position Embedding Size | 128 × 128 |
| Visual Feature Merging | 2 x 2 |
Pretrained model capability
Bits-per-byte (BPB) on internal code & agent validation, lower is better:
Few-shot pretrain benchmark evaluation:
| Category | Benchmark | #Shots | Hy4 flash Base | Hy4 Base | Hy3 preview Base | DeepSeek-V4-flash-Base | DeepSeek-V4-Pro-Base |
|---|---|---|---|---|---|---|---|
| Knowledge | MMLU† | 5 | 88.7 | 91.6 | 87.5 | 89.7 | 91.1 |
| MMLU-Pro† | 5 | 71.1 | 73.9 | 65.8 | 68.6 | 73.4 | |
| MMLU-Redux† | 5 | 87.6 | 90.6 | 87.0 | 88.8 | 90.2 | |
| SuperGPQA† | 5 | 57.8 | 62.7 | 52.3 | 52.5 | 54.8 | |
| C-Eval† | 5 | 92.0 | 95.0 | 90.1 | 91.9 | 93.4 | |
| CMMLU† | 5 | 91.6 | 93.1 | 89.6 | 89.8 | 90.7 | |
| SimpleQA | 5 | 37.5 | 57.2 | 26.4 | 31.3 | 52.1 | |
| Chinese-SimpleQA† | 5 | 74.6 | 83.9 | 69.6 | 71.9 | 76.6 | |
| AGIEval (English)† | 3 | 75.4 | 79.3 | 76.0 | 76.3 | 78.2 | |
| AGIEval (Chinese)† | 3 | 90.6 | 91.2 | 87.8 | 88.5 | 89.8 | |
| Reasoning | HellaSwag (3,000-item subset) | 10 | 85.2 | 87.1 | 85.7 | 85.1 | 86.8 |
| PIQA | 4 | 84.4 | 85.3 | 84.6 | 83.8 | 84.9 | |
| ARC-Challenge | 0 | 95.0 | 97.3 | 96.0 | 97.3 | 97.0 | |
| Social IQa | 0 | 80.1 | 82.7 | 80.5 | 72.5 | 73.1 | |
| KOR-Bench | 3 | 54.7 | 57.6 | 54.6 | 53.4 | 55.4 | |
| C³ | 0 | 77.3 | 82.4 | 75.9 | 74.1 | 78.3 | |
| Math | U-MATH | 5 | 69.8 | 71.6 | 60.9 | 57.4 | 64.8 |
| OCW Courses | 5 | 64.0 | 66.7 | 62.6 | 63.3 | 68.2 | |
| Code | MBPP-plus | 3 | 73.7 | 74.0 | 77.4 | 76.8 | 79.1 |
| Multilingual | Belebele (5-language subset)† | 5 | 93.8 | 95.0 | 94.2 | 94.4 | 95.2 |
| INCLUDE† | 5 | 82.8 | 88.1 | 84.3 | 84.0 | 84.3 | |
| Multimodal | MMMU-Pro (Standard, 10 opts) | 4 | 52.0 | 59.6 | — | — | — |
| SimpleVQA | 4 | 48.5 | 54.5 | — | — | — | |
| CVBench | 4 | 83.4 | 86.7 | — | — | — | |
| RealWorldQA | 4 | 71.1 | 72.3 | — | — | — | |
| TextVQA | 4 | 73.4 | 78.2 | — | — | — | |
| CountBenchQA | 4 | 86.6 | 90.6 | — | — | — |
† Macro-averaged accuracy for the marked text benchmarks. Other text rows use the accuracy metric reported by our evaluation suite. Bold marks the highest available numerical score in each row; it does not indicate statistical significance.
Multimodal results are reported only for Hy4 flash Base and Hy4 Base.
ARC-Challenge and HellaSwag use 299-item and 3,000-item subsets, respectively. INCLUDE uses a 5,000-example Lite subset covering 44 languages. Belebele covers German, Korean, Vietnamese, Spanish, and Russian (4,475 examples in total).
Disclaimer: Because our base model was exposed to a large amount of synthetic instruction data during mid-training, it occasionally fails to follow the expected answer format in few-shot evaluations, which may distort the scores.
Practicality and Cost Efficiency
Optimization Approach
Across training, evaluation, and inference, we aggressively optimized for cost efficiency while preserving intelligence:
- Pre-training: Hy4 flash integrates hybrid attention, LatentMoE, and Engram into its architecture—reducing KV cache size to just 1/24 of Hy3 and 1/6 of Hy4, with extensive scaling ladder experiments ensuring performance meets expectations.
- Post-training: Self-distillation from Hy4 establishes strong general intelligence, while reinforcement learning cuts average end-to-end output tokens by 50%.
- Evaluation: We built WorkIndex, an internal benchmark grounded in typical WorkBuddy tasks, and paired it with human evaluation—focusing on deliverable quality, single-turn output length, and task turnaround time rather than public benchmark scores detached from everyday work.
- Inference: Combining megakernels, 4-bit quantization, and DFly2 pushes decoding speed past 150 tokens/s, enabling low-cost serving at scale.
Task Performance and Cost
Hy4 flash delivers overall task performance slightly above Hy4 preview at a much lower cost per task. On WorkIndex, it scores 42.1, compared with 39.7 for Hy4 preview, while its average cost per task is just 1/13 of Hy4 preview, 1/20 of Hy4, and 1/8 of DeepSeek-V4.1-Flash-1017 (Max tier, peak-hour pricing).
Figure 1: Performance and cost across internal and external tasks. WorkIndex (internal) comprises 8 evaluation sets covering slide creation, slide editing, human-AI slide co-writing, Markdown human-AI co-writing, document editing, spreadsheet repair, audio/video processing, and visual understanding.
Open Benchmarks includes 7 public agent benchmarks: DeepSWE, ProgramBench, Terminal-Bench 4.0, APEX-Agents, AutomationBench, HLE, and OSWorld 2.1.
Figure 2: Average cost per task on WorkIndex. Task scores are 42.1 for Hy4 flash, 39.7 for Hy4 preview, and 51.4 for Hy4.
We recommend Hy4 flash for most everyday productivity tasks, including deep search, document processing, slide creation, simple frontend demos, and computer use. For complex tasks such as long-horizon software engineering, we recommend Hy4 for its higher intelligence ceiling.
User Blind Evaluation
In the blind evaluation, Hy4 flash achieved user satisfaction close to Claude Haiku 5.5, while recording the lowest cost per task and shortest median end-to-end completion time among the evaluated models. Its user satisfaction score was 2.79/4 (Claude Haiku 5.5: 2.81/4), with a median end-to-end completion time of 6.7 minutes and a cost of RMB 0.26 per task.
Figure 3: Blind evaluation with 85 internal WorkBuddy users across 259 tasks spanning 27 categories.
Appendix: Benchmark results
Quickstart
Use Transformers to load the model for local inference, or deploy a server and access it through the OpenAI-compatible API.
Reasoning mode (instruct models):
reasoning_effortsupports"high"(default, thinking enabled) and"no_think"(direct responses). Both examples below use"no_think".Recommended sampling parameters:
temperature=0.9,top_p=1.0.
Transformers
Support for Hy4 flash will be merged into the
transformersmain branch soon. Until then, install from the commit below.
pip install "transformers[torch,vision] @ git+https://github.com/huggingface/transformers.git@refs/pull/50903/head"
The following example generates a brief image description:
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "tencent/Hy4-flash"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(model_id, device_map="auto")
messages = [
{
"role": "user",
"content": [
{
"type": "image",
"url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg",
},
{"type": "text", "text": "Describe this image in one sentence."},
],
}
]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
reasoning_effort="no_think",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(processor.decode(outputs[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True))
OpenAI-compatible API
For API access, start a server using the vLLM deployment instructions, then run the following client example:
from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="EMPTY")
response = client.chat.completions.create(
model="hy4-flash",
messages=[
{"role": "user", "content": "Hello! Can you briefly introduce yourself?"},
],
temperature=0.9,
top_p=1.0,
extra_body={"chat_template_kwargs": {"reasoning_effort": "no_think"}},
)
print(response.choices[0].message.content)
Deployment
DFly2 for Speculative Decoding
DFly2 is Hy4 flash's speculative-decoding drafter, trained with AngelSpec and built directly on the target model's Top-k Sparse KV: each draft layer shares the KV cache (KV Share) and the compressed indexer's selection of up to 2,048 positions (Index Share) with its corresponding sparse attention layer. This yields three advantages:
- Constant cost: each draft token attends to at most ~2K keys, regardless of context length.
- Zero extra KV memory: no separate KV cache is maintained for the drafter.
- PD-disaggregation ready: not involved in prefill; the prefill-to-decode transfer adds only one last-layer hidden state.
Quantization
We provide AngelSlim, a more accessible, comprehensive, and efficient toolkit for large model compression. AngelSlim supports a comprehensive suite of compression tools for large-scale multimodal models, including common quantization algorithms, low-bit quantization, and speculative sampling.
For this model, we have provided a GGUF compressed version for end-to-end testing purposes.
Inference Frameworks
For production serving, we recommend using vLLM or SGLang. Please refer to the recipes:
vLLM
Use official prebuilt image vllm/vllm-openai:hy4-flash:
docker run --gpus all \
-p 8000:8000 \
--ipc=host \
-v ~/.cache/huggingface:/root/.cache/huggingface \
vllm/vllm-openai:hy4-flash tencent/Hy4-flash-FP8 \
--tensor-parallel-size 8 \
--speculative-config '{"num_speculative_tokens":5,"method":"dfly"}' \
--attention-backend FLASHMLA_SPARSE \
--tool-call-parser hy_v4 \
--reasoning-parser hy_v4 \
--enable-auto-tool-choice \
--port 8000 \
--served-model-name hy4-flash
SGLang
Use the official prebuilt image lmsysorg/sglang:hy4-flash (multi-arch, x86 and Arm):
docker pull lmsysorg/sglang:hy4-flash
docker run --gpus all \
-p 8000:8000 \
--ipc=host \
lmsysorg/sglang:hy4-flash \
sglang serve \
--trust-remote-code \
--model-path tencent/Hy4-flash-FP8 \
--tp 8 \
--cuda-graph-backend-prefill disabled \
--speculative-algorithm DFLY \
--speculative-dfly-block-size 6 \
--host 127.0.0.1 \
--port 8000
- Downloads last month
- 13,340
Model tree for Xylolabs/Hy4-flash-GGUF
Base model
tencent/Hy4-flash






docker model run hf.co/Xylolabs/Hy4-flash-GGUF: