Text Generation
Transformers
Safetensors
hy_v3
hunyuan
hy3
Mixture of Experts
nvfp4
compressed-tensors
quantized
vllm
conversational
8-bit precision
Instructions to use kodelow/Hy3-NVFP4-W4A16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kodelow/Hy3-NVFP4-W4A16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kodelow/Hy3-NVFP4-W4A16") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kodelow/Hy3-NVFP4-W4A16") model = AutoModelForCausalLM.from_pretrained("kodelow/Hy3-NVFP4-W4A16") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kodelow/Hy3-NVFP4-W4A16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kodelow/Hy3-NVFP4-W4A16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kodelow/Hy3-NVFP4-W4A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kodelow/Hy3-NVFP4-W4A16
- SGLang
How to use kodelow/Hy3-NVFP4-W4A16 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 "kodelow/Hy3-NVFP4-W4A16" \ --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": "kodelow/Hy3-NVFP4-W4A16", "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 "kodelow/Hy3-NVFP4-W4A16" \ --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": "kodelow/Hy3-NVFP4-W4A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kodelow/Hy3-NVFP4-W4A16 with Docker Model Runner:
docker model run hf.co/kodelow/Hy3-NVFP4-W4A16
Upload folder using huggingface_hub
Browse files- README.md +5 -2
- model.safetensors.index.json +1 -1
README.md
CHANGED
|
@@ -35,10 +35,13 @@ are quantized to 4-bit; everything quality-sensitive stays BF16.
|
|
| 35 |
|
| 36 |
| | |
|
| 37 |
|---|---|
|
| 38 |
-
| **Size** | **
|
| 39 |
| **Format** | compressed-tensors `nvfp4-pack-quantized`, **weight-only (W4A16)** — E2M1 4-bit weights + FP8-E4M3 group-16 scales + FP32 per-tensor global scale |
|
| 40 |
| **Base** | [tencent/Hy3](https://huggingface.co/tencent/Hy3) — 295B MoE (21B active, 3.8B MTP), 80 layers + 1 MTP layer, 192 experts top-8 + 1 shared, 256K context |
|
| 41 |
|
|
|
|
|
|
|
|
|
|
| 42 |
### What is quantized to what
|
| 43 |
|
| 44 |
| Component | Precision | Why |
|
|
@@ -65,7 +68,7 @@ Functional evals run **end-to-end on a single NVIDIA B300 (275 GB)** with the
|
|
| 65 |
- **MTP preserved:** the MTP draft layer (layer 80) is served with
|
| 66 |
`--speculative-config '{"method":"mtp","num_speculative_tokens":1}'` and reaches **83.4%**
|
| 67 |
draft-token acceptance — lossless (GSM8K unchanged with it on).
|
| 68 |
-
- **Footprint:** ~
|
| 69 |
or multi-GPU tensor parallelism. `fastsafetensors` loads it in ~90 s.
|
| 70 |
- **Provenance:** built with [qstream](https://github.com/olka/qstream), experts-only,
|
| 71 |
NVFP4 with MSE-optimal FP8-E4M3 group-scale selection (group_size 16).
|
|
|
|
| 35 |
|
| 36 |
| | |
|
| 37 |
|---|---|
|
| 38 |
+
| **Size** | **181 GB** (from ~598 GB BF16 source, ~30%) |
|
| 39 |
| **Format** | compressed-tensors `nvfp4-pack-quantized`, **weight-only (W4A16)** — E2M1 4-bit weights + FP8-E4M3 group-16 scales + FP32 per-tensor global scale |
|
| 40 |
| **Base** | [tencent/Hy3](https://huggingface.co/tencent/Hy3) — 295B MoE (21B active, 3.8B MTP), 80 layers + 1 MTP layer, 192 experts top-8 + 1 shared, 256K context |
|
| 41 |
|
| 42 |
+
> **Note on HF's param count.** HF reports fewer "params" than the base's 295B because it counts *packed* 4-bit storage elements (each `U8` byte holds two FP4 weights) plus FP8 scales — not logical parameters. The logical model is unchanged: **295B total, 21B active**.
|
| 43 |
+
|
| 44 |
+
|
| 45 |
### What is quantized to what
|
| 46 |
|
| 47 |
| Component | Precision | Why |
|
|
|
|
| 68 |
- **MTP preserved:** the MTP draft layer (layer 80) is served with
|
| 69 |
`--speculative-config '{"method":"mtp","num_speculative_tokens":1}'` and reaches **83.4%**
|
| 70 |
draft-token acceptance — lossless (GSM8K unchanged with it on).
|
| 71 |
+
- **Footprint:** ~181 GB — fits a single large-VRAM GPU (verified on one **B300, 275 GB**)
|
| 72 |
or multi-GPU tensor parallelism. `fastsafetensors` loads it in ~90 s.
|
| 73 |
- **Provenance:** built with [qstream](https://github.com/olka/qstream), experts-only,
|
| 74 |
NVFP4 with MSE-optimal FP8-E4M3 group-scale selection (group_size 16).
|
model.safetensors.index.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 13818513
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3976e5f5f991872da5b15ac1cbf7656c33ca7ce25a9643be9e5effb5f74adc29
|
| 3 |
size 13818513
|