How to Self-Host Tencent Hy4 Flash with vLLM or SGLang
A practical guide to deploying Tencent's Hy4 Flash model locally using vLLM or SGLang, with notes on FP8, GGUF, and speculative decoding.

What is Tencent Hy4 Flash, and why deploy it yourself?
Hy4 Flash is Tencent’s cost-optimized large language model, built for teams that want strong agentic and document-processing performance without the serving bill of a frontier-scale model. It has 220 billion total parameters (including a 64 billion parameter “Engram” embedding component) but activates only around 12 billion parameters per token, which is what makes it cheap and fast to run compared to dense models of similar size. It supports text and image input, outputs text, and handles context windows up to 1 million tokens. Tencent ships it with official Docker recipes for vLLM and SGLang, plus FP8 and GGUF quantized variants, which makes self-hosting it a realistic option for anyone with a decent GPU setup rather than just hyperscaler infrastructure.
TL;DR
- Hy4 Flash trades parameter count for active compute, using 220B total parameters but only about 12B active per token thanks to a mixture-of-experts design with 512 routed experts and 16 activated per token.
- The architecture is built for cheap long-context inference, combining sparse attention, sliding-window attention, Multi-head Latent Attention, and an n-gram “Engram” lookup table that cuts KV cache size to a fraction of Tencent’s earlier Hy3 and Hy4 models.
- A built-in speculative decoding drafter called DFly2 (0.85B parameters) reuses the target model’s KV cache to speed up long-context generation at low extra cost.
- Official deployment paths are vLLM and SGLang, both distributed as ready-to-use Docker images from Tencent, alongside a GGUF conversion for llama.cpp-style local inference.
- FP8 quantization is available out of the box as “Hy4 Flash-FP8,” and community quantizations (including NVFP4 builds for newer Blackwell GPUs) are already appearing on Hugging Face.
- Tencent reports decoding speeds above 150 tokens per second when combining megakernels, 4-bit quantization, and DFly2, which is the performance profile the official deployment configs are tuned to hit.
- The model is pitched as a Claude Haiku-class alternative for everyday productivity tasks like deep search, document editing, slide creation, and simple frontend work, not for long-horizon software engineering where Tencent recommends the full Hy4 model instead.
Workers waitfor instructions.Contractors deliverthe outcome.
Describe what you need. Remy builds it, secures it and hands it over running.
How is Hy4 Flash architected, and why does it matter for deployment?
Hy4 Flash’s language backbone has 42 layers: one dense feed-forward layer and 41 mixture-of-experts (MoE) layers. Each MoE layer routes tokens to 16 of 512 experts operating in a reduced-dimensionality “LatentMoE” space, plus one always-on shared expert. That sparsity is the main reason the model is cheap to run despite its large total parameter count.
Three design choices matter specifically for anyone deploying it:
Hybrid attention. Hy4 Flash interleaves sparse attention (called IndexPool) with sliding-window attention at roughly a 1:3 ratio, using Multi-head Latent Attention (MLA) as the underlying formulation. Sparse layers can select up to 2,048 tokens via group-level selection; sliding-window layers use a fixed 512-token causal window. This combination is why Tencent reports KV cache sizes of just 1/24 of its Hy3 model and 1/6 of the full Hy4 model, which directly reduces the GPU memory needed to serve long contexts.
Engram n-gram embeddings. Learned bigram and trigram representations, retrieved through multi-head hash lookups, are injected at four specific backbone layers (indices 1, 11, 21, and 31). This is where most of the 63.5 billion “Engram” parameters live, and it’s a departure from a standard transformer that quantization and serving tools need to account for.
DFly2 speculative decoding. A built-in 5-layer, 0.85B parameter drafter reuses the target model’s KV cache and sparse attention indices to propose tokens ahead of the main model, specifically targeting long-context speculative decoding at low added cost. This is distinct from bolting on a separate draft model, since DFly2 ships as part of the same checkpoint.
How do you deploy Hy4 Flash with vLLM?
Tencent’s model card documents vLLM as one of two primary inference frameworks for serving Hy4 Flash through an OpenAI-compatible API. The practical workflow looks like this:
- Pick a precision. Use the base
tencent/Hy4-flashweights for full precision, ortencent/Hy4-flash-FP8for the pre-quantized FP8 variant, which roughly halves memory footprint versus full precision with minimal quality loss. - Pull or build a vLLM image that supports Hy4 Flash’s custom layers. Because of the hybrid sparse/sliding-window attention and MLA formulation, you need a vLLM build with patches for these components rather than a vanilla release. Community images (for example, builds targeting NVFP4 on Blackwell-class GPUs with compute capability SM120) ship with patch files for attention, the DFly drafter config, and sparse-window index trimming, which indicates these pieces aren’t yet in stock vLLM and need explicit support.
- Configure speculative decoding. If you want DFly2 active, confirm the serving config references the drafter’s checkpoint files and KV cache sharing settings, since that’s what delivers the throughput gains Tencent reports.
- Launch the server with the model path, tensor parallelism settings sized to your GPU count, and expose the OpenAI-compatible endpoint.
- Set sampling defaults. Tencent recommends
temperature=0.9andtop_p=1.0for both chat and reasoning modes.
Reasoning behavior is controlled by a reasoning_effort parameter: "high" enables the model’s default thinking mode, while "no_think" forces direct responses without the extended reasoning trace. This matters for latency-sensitive deployments where you want faster, shorter answers.
Build a purchaseapproval app for2,000 storemanagers
One prompt. Role-based access, audit trail and SSO come built in.
How do you deploy Hy4 Flash with SGLang?
SGLang is the second framework Tencent documents for Hy4 Flash, and the deployment shape is similar to vLLM: pull a container, point it at the model weights (standard or FP8), and expose an OpenAI-compatible API. SGLang is generally chosen over vLLM when teams want its radix-attention caching for high-throughput multi-request serving or already have SGLang in their stack. Because Hy4 Flash’s attention pattern is nonstandard, the same caveat applies as with vLLM: use the Tencent-provided or community-patched SGLang build rather than assuming an unmodified release handles the sparse attention, MLA, and Engram lookups correctly.
Is the GGUF version a viable option for local, non-server deployment?
Tencent publishes a GGUF conversion of Hy4 Flash (via the AngelSlim GGUF repository linked from the model card), intended for llama.cpp-style local inference rather than server-grade throughput. GGUF is the right choice if you’re running the model on a single workstation or laptop-class GPU setup and want simpler, quantized weights without standing up a full inference server. It’s the wrong choice if you need the throughput, batching, or speculative decoding support that vLLM and SGLang provide, since GGUF runtimes generally don’t implement DFly2’s cache-sharing speculative decoding.
Is self-hosting Hy4 Flash worth it compared to a hosted API?
The model card’s own cost comparisons are the strongest argument for self-hosting at scale. Tencent reports that on its internal WorkIndex benchmark, Hy4 Flash scores 42.1, ahead of Hy4 preview’s 39.7, while costing about 1/13th as much per task as Hy4 preview, 1/20th as much as full Hy4, and roughly 1/8th the cost of DeepSeek-V4.1-Flash at peak-hour pricing. In a blind evaluation against Claude Haiku 5.5 across 259 tasks, Hy4 Flash scored 2.79 out of 4 on user satisfaction versus Haiku’s 2.81, with a median completion time of 6.7 minutes and a reported cost of RMB 0.26 per task, the lowest among models tested.
Those numbers describe Tencent’s own hosted deployment, not necessarily what you’ll get self-hosting on your own hardware. But they establish that Hy4 Flash’s architecture is genuinely built for low-cost inference rather than just marketed that way, which makes it a reasonable candidate for teams running their own GPU fleet instead of a managed API. The tradeoff is operational: you need a vLLM or SGLang build with the right patches, FP8 or GGUF weights sized to your VRAM, and enough context-length headroom (up to 1M tokens) to actually use what the architecture is designed for.
Frequently Asked Questions
How much VRAM does Hy4 Flash need to run?
The model card doesn’t publish a single VRAM figure, since requirements depend on precision (full weights vs. FP8 vs. GGUF quantization) and context length. The architecture is specifically optimized to need less memory than comparable models: its hybrid attention design cuts KV cache size to roughly 1/6 of Tencent’s full Hy4 model, which is the main lever for fitting long contexts into less GPU memory.
Does Hy4 Flash support image input?
Yes. It natively accepts text and image inputs through a vision encoder adapted from SigLIP2-So400m-Patch16-Res512, connected to the language backbone via an MLP projector. Output is text only.
What’s the difference between Hy4 Flash and Hy4 Flash-FP8?
Hy4 Flash-FP8 is Tencent’s own pre-quantized version of the instruct model, reducing memory footprint for serving while aiming to preserve most of the quality of the full-precision checkpoint. Use FP8 when GPU memory is the binding constraint.
Can I use Hy4 Flash for long-context agentic tasks?
It’s designed for this: Tencent recommends it for deep search, document processing, slide creation, and computer-use tasks, and the context window extends to 1,048,576 tokens. For long-horizon software engineering, Tencent recommends the larger Hy4 model instead, citing a higher intelligence ceiling.
Is DFly2 required to run Hy4 Flash?
No. DFly2 is an optional built-in speculative decoding drafter that speeds up generation, particularly for long contexts, by reusing the target model’s KV cache. You can serve Hy4 Flash without it, but enabling it is how Tencent reports achieving decoding speeds above 150 tokens per second.

