Instructions to use tiny-random/hy4-fp8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiny-random/hy4-fp8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="tiny-random/hy4-fp8") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("tiny-random/hy4-fp8") model = AutoModelForMultimodalLM.from_pretrained("tiny-random/hy4-fp8", device_map="auto") 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?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiny-random/hy4-fp8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiny-random/hy4-fp8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/hy4-fp8", "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/tiny-random/hy4-fp8
- SGLang
How to use tiny-random/hy4-fp8 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 "tiny-random/hy4-fp8" \ --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": "tiny-random/hy4-fp8", "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 "tiny-random/hy4-fp8" \ --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": "tiny-random/hy4-fp8", "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 tiny-random/hy4-fp8 with Docker Model Runner:
docker model run hf.co/tiny-random/hy4-fp8
This is a randomly initialized tiny model based on tencent/Hy4-FP8 for testing and debugging.
| Feature | Source | This repo |
|---|---|---|
| Checkpoint tensor elements | 11.58B BF16, 77.35M F32, 762.82B F8_E4M3 | 37.97M BF16, 85.62K F32, 17.37M F8_E4M3 |
| Safetensors weight files | 786.31 GB (245 files) | 93.90 MB (model.safetensors) |
| Architecture / input | HYV4-VL FP8; text, image, video | Same |
| Vocabulary rows / tied embeddings | 120,832 / false | Same |
| Backbone layers / MLP layout | 78 / 1 dense + 77 MoE | 10 / 1 dense + MoE |
| Hidden width / dense MLP width | 6,144 / 18,432 | 128 / 128 |
| Routed experts / top-k / shared experts | 256 / 8 / 1 | 32 / 8 / 1 |
| Expert intermediate size | 2,048 | 128 |
| Q heads; non-RoPE / RoPE / V dimensions | 64; 192 / 64 / 256 | 8; 32 / 64 / 32 |
| Q / KV LoRA rank | 2,048 / 512 | 64 / 512 |
| Indexer heads / dimension / top-k | 32 / 128 / 2,048 | 32 / 128 / 2,048 |
| Indexer layer cadence | full at 0, 1, then every 4th layer | Same |
| Independent Hyper-Connections | 4 streams; gated pre-branches | Same |
| MLA gating / learned sinks / SwiGLU clamp | elementwise / enabled / 10 | Same |
| Vision layers / width / output width | 40 / 1,536 / 6,144 | 4 / 64 / 128 |
| DFly2 draft layers | 5 dense MLA layers, fusion and hidden correction | Same structure |
| Quantization | compressed-tensors block FP8 (E4M3, F32 128x128 blocks); token matrices/vit/layer-0 attention BF16 | Same descriptor and exclusions |
| Checkpoint precision | FP8 E4M3 weights + F32 block scales; F32 iHC/sinks/router bias | Same |
Block-FP8 on SM90 requires the GEMM reduction dim K % 128 == 0; hidden_size is that dim for the expert gate/up, attention linear_gate and q_a_proj, so this variant uses hidden_size=128 and cannot reuse the BF16 sibling's width. Routed experts are stored per-expert (experts.E.{gate,up,down}_proj.weight[_scale]) as in the source, with 128x128 blocks tiled by ceil. The untied BF16 token matrices dominate the size (~62 MB at hidden 128).
| File path | Size |
|---|---|
| model.safetensors | 93.9MB |
Example usage
SGLang (✅ verified)
Hy4-VL block-FP8 support is in SGLang PR #51672 (git+https://github.com/sgl-project/sglang.git@a0804a2f99719f5666ed2018e5d00a75645de6a8#subdirectory=python), not a released wheel. 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 (Hy4 uses SGLang's bundled triton kernels). 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-fp8 --tp 1 \
--dtype bfloat16 --context-length 4096 \
--reasoning-parser auto --tool-call-parser auto \
--served-model-name hy4-fp8 --host 0.0.0.0 --port 30000
Images and videos use the prompt's <image> / <video> placeholders. Verify chat, image and video requests against the OpenAI-compatible endpoint.
Creating this repo
- Code: .meta/create_model.py
- Model structure: .meta/model.log
- Environment: .meta/env.json
Change log
- 2026-11-22: Initial tiny Hy4 FP8 vision-language checkpoint.
This repo is generated by DeepSeek-V4.1-Flash.
- Downloads last month
- -
Model tree for tiny-random/hy4-fp8
Base model
tencent/Hy4-FP8