Instructions to use Beling86/Hy4-Flash-3.03BPW with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Beling86/Hy4-Flash-3.03BPW with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Beling86/Hy4-Flash-3.03BPW") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("Beling86/Hy4-Flash-3.03BPW", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Beling86/Hy4-Flash-3.03BPW with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Beling86/Hy4-Flash-3.03BPW" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Beling86/Hy4-Flash-3.03BPW", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Beling86/Hy4-Flash-3.03BPW
- SGLang
How to use Beling86/Hy4-Flash-3.03BPW with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Beling86/Hy4-Flash-3.03BPW" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Beling86/Hy4-Flash-3.03BPW", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Beling86/Hy4-Flash-3.03BPW" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Beling86/Hy4-Flash-3.03BPW", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Beling86/Hy4-Flash-3.03BPW with Docker Model Runner:
docker model run hf.co/Beling86/Hy4-Flash-3.03BPW
Hy4-Flash-3.03BPW
Empirical Pareto-optimal mixed-precision AutoRound quantization of tencent/Hy4-flash
for vLLM. Text-only (vit.* vision encoder and model.dfly_layers.* MTP drafter stripped). Non-Engram backbone size:
54.915 GiB (3.0320 avg bits/weight over 155.578 B params),
plus FP8 E4M3 Engram tables (~59.01 GiB, 63.36 B params) across L01, L11, L21, L31 (engram-fp8-L*.safetensors).
Precision layout (41-layer DP-Knapsack Pareto Optimal, <= 55.0 GiB)
| Component | Format |
|---|---|
Routed experts — hottest core (6 layers: L08, L10, L16, L17, L21, L25) |
W3A16, group 64, symmetric |
Routed experts — protected core (21 layers: L04, L12, L13, L14, L15, L18, L19, L20, L22, L23, L24, L26, L27, L28, L29, L30, L31, L32, L33, L34, L36) |
W3A16, group 128, symmetric |
Routed experts — low-sensitivity (6 layers: L02, L03, L06, L09, L37, L38) |
W2A16, group 64, symmetric |
Routed experts — lowest-sensitivity (8 layers: L01, L05, L07, L11, L35, L39, L40, L41) |
W2A16, group 128, symmetric |
Attention — 12 global DSA layers + compressed_indexer.(query|token_key)_projection |
W8A16, group 128, symmetric |
Attention — 30 local SWA layers (window=512) |
W4A16, group 128, symmetric |
Dense MLP (L00), mlp.shared_experts, mlp.routed_expert_(down|up)_proj bottlenecks |
W8A16, group 128, symmetric |
embed_tokens, lm_head, mlp.gate, engram_layer.(key_projs|value_proj), hc_*, norms, small indexer |
BF16 / FP32 |
Engram PLE tables (L01, L11, L21, L31 multi_head_embedding, 63.36 B params) |
FP8 E4M3 + FP32 scale (~59.01 GiB, SSD/host offloaded) |
AutoRound 0.16.1 (SignRound), 1000 iterations/block, 128 × 4096-token
balanced 5-domain calibration (calib_hy4_v3_128x4096.jsonl, not_use_best_mse=True, scale_dtype=fp16). Format auto_round:auto_gptq.
Fidelity vs. BF16 (Engram active: BF16 Engram teacher vs FP8 Engram candidate)
Teacher-forced full-vocabulary KL(P_bf16 ‖ Q_quant) on held-out 24 × 1024 windows (SSD-streamed Engram active on both teacher and candidate):
| Domain | Positions | Mean KL | Median KL | P99 KL | Top-1 agreement | PPL bf16 → quant |
|---|---|---|---|---|---|---|
| all | 24552 | 0.54920 | 0.04765 | 7.7773 | 80.03% | 22.085 → 26.542 |
| chat | 10230 | 0.72054 | 0.11651 | 10.2291 | 74.90% | 44.275 → 51.724 |
| code | 5115 | 0.31311 | 0.00032 | 5.6025 | 89.58% | 6.718 → 7.850 |
| math | 5115 | 0.34742 | 0.01612 | 5.3880 | 86.18% | 12.784 → 15.283 |
| prose | 4092 | 0.66821 | 0.18410 | 6.9114 | 73.22% | 34.027 → 45.762 |
P99.9 KL 15.2657, max 28.648.
- Downloads last month
- 95
Model tree for Beling86/Hy4-Flash-3.03BPW
Base model
tencent/Hy4-flash