Instructions to use yujiepan/hy4-flash-fp8-tiny-random with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yujiepan/hy4-flash-fp8-tiny-random with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="yujiepan/hy4-flash-fp8-tiny-random") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("yujiepan/hy4-flash-fp8-tiny-random", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yujiepan/hy4-flash-fp8-tiny-random with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yujiepan/hy4-flash-fp8-tiny-random" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yujiepan/hy4-flash-fp8-tiny-random", "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/yujiepan/hy4-flash-fp8-tiny-random
- SGLang
How to use yujiepan/hy4-flash-fp8-tiny-random 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 "yujiepan/hy4-flash-fp8-tiny-random" \ --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": "yujiepan/hy4-flash-fp8-tiny-random", "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 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 "yujiepan/hy4-flash-fp8-tiny-random" \ --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": "yujiepan/hy4-flash-fp8-tiny-random", "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" } } ] } ] }' - Docker Model Runner
How to use yujiepan/hy4-flash-fp8-tiny-random with Docker Model Runner:
docker model run hf.co/yujiepan/hy4-flash-fp8-tiny-random
This is a randomly initialized tiny model based on tencent/Hy4-flash-FP8 for testing and debugging.
| Feature | Source | This repo |
|---|---|---|
| Checkpoint tensor elements | 66.78B BF16, 8.73M F32, 153.47B F8_E4M3, 483.27K I32 | 39.50M BF16, 217.96K F32, 6.08M F8_E4M3, 241.64K I32 |
| Safetensors weight files | 287.07 GB (148 files) | 86.99 MB (model.safetensors) |
| Architecture / input | HYV4-Flash FP8; text, image | Same |
| Vocabulary rows / tied embeddings | 120,832 / false | Same |
| Backbone layers / attention cadence | 42 / 2 indexed + 10x(3 SWA + 1 indexed) | 10 / 2 indexed + 2x(3 SWA + 1 indexed) |
| MLP layout | 1 dense + 41 Latent-MoE | 1 dense + 9 Latent-MoE |
| Hidden width / dense MLP width | 3,072 / 13,824 | 128 / 128 |
| Routed experts / top-k / shared | 512 / 16 / 1 | 8 / 8 / 1 |
| Expert intermediate / latent width | 1,536 / 1,536 | 128 / 128 |
| Q heads; non-RoPE / RoPE / V dims | 32; 192 / 64 / 256 | 8; 32 / 64 / 32 |
| Q / KV LoRA rank | 1,024 / 512 | 128 / 512 |
| Engram memory | 4 layers, 2 orders, 8 heads/order | 2 layers, 2 orders, 8 heads |
| Compressed indexer | stage-2 coarse recall, ratio 4 | Same cadence |
| SWA window | 512 | 512 |
| DFly2 draft layers | 5 dense MLA layers + fusion + hidden correction | Same structure |
| Quantization | native FP8 (E4M3, block 128x128, BF16 scale_inv) on experts / o_proj / linear_gate / q_b_proj and the DFly MLP+attention; embeddings, vit, indexers, latent-MoE and Engram stay BF16 | Same descriptor and exclusions |
| Checkpoint precision | FP8 E4M3 weights + BF16 block scales; F32 iHC/sinks/router bias | Same |
Hy4-flash has no released Transformers model and Transformers cannot load the native-FP8 experts, so this repo is validated only with SGLang (PR #51672). hidden_size is 128 because the block-scaled FP8 GEMM requires the reduction dim K % 128 == 0 and hidden is the K of linear_gate. The untied BF16 token matrices dominate the size (~62 MB at hidden 128), a proven exception to the 30 MB target.
| File path | Size |
|---|---|
| model.safetensors | 87.0MB |
Example usage
SGLang (✅ verified)
Hy4-flash native-FP8 support is in SGLang PR #51672 (git+https://github.com/sgl-project/sglang.git@a0804a2f99719f5666ed2018e5d00a75645de6a8#subdirectory=python), not a released wheel; see the Hy4-flash cookbook. Install it into a CUDA 13 stack (torch 2.14.1+cu130, flashinfer 0.7.4, sgl-fa3, sgl-flash-mla) and set SGLANG_SKIP_SGL_KERNEL_VERSION_CHECK=1; on an H20 (driver 535) prepend the extracted cuda-compat-13 libcuda.so.1 to LD_LIBRARY_PATH and LIBRARY_PATH.
sglang serve --model-path tiny-random/hy4-flash-fp8 --tp 2 \
--dtype bfloat16 --context-length 4096 \
--served-model-name hy4-flash-fp8 --host 0.0.0.0 --port 30000
Send OpenAI chat messages: a plain text string, or image_url content parts for images.
from openai import OpenAI
client = OpenAI(base_url="http://localhost:30000/v1", api_key="EMPTY")
resp = client.chat.completions.create(
model="hy4-flash-fp8",
messages=[
{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": "path/to/image.jpg"}},
{"type": "text", "text": "Describe this image."},
],
}
],
max_tokens=64,
)
print(resp.choices[0].message.content)
Creating this repo
- Code: .meta/create_model.py
- Model structure: .meta/model.log
- Environment: .meta/env.json
Change log
- 2026-11-25: Initial tiny Hy4-flash FP8 vision-language checkpoint.
This repo is generated by DeepSeek-V4.1-Flash.
- Downloads last month
- 26
Model tree for yujiepan/hy4-flash-fp8-tiny-random
Base model
tencent/Hy4-flash-FP8