This is a randomly initialized tiny model based on tencent/Hy4-flash for testing and debugging.

Feature Source This repo
Checkpoint tensor elements 220.24B BF16, 8.73M F32, 483.27K I32 13.78M BF16, 144.49K F32, 241.64K I32
Safetensors weight files 440.52 GB (148 files) 29.16 MB (model.safetensors)
Architecture / input HYV4-Flash; 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 16 / 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 64 / 512
Engram memory 4 layers, 2 n-gram orders, 8 heads/order 2 layers, 2 orders, 8 heads
Compressed indexer stage-2 coarse recall, ratio 4 Same cadence
SWA window 512 512
Independent Hyper-Connections 4 streams; gated pre-branches Same
DFly2 draft layers 5 dense MLA layers + fusion + hidden correction Same structure
Checkpoint precision BF16 Same

hy_v4_flash has no released Transformers model; this repo builds with PR #50903. It adds the Engram n-gram memory (hashed lookups over per-layer tables), a stage-2 compressed indexer beside the DSA indexer, sliding-window attention interleaved 3:1 with sparse attention, and Latent-MoE projections. The source formats Engram lookup_table as a serialized buffer and the Latent-MoE projections as routed_expert_{up,down}_proj (latent->hidden and hidden->latent). Two full SWA cycles are retained.

File path Size
model.safetensors 29.2MB

Example usage

Transformers (✅ verified)

Hy4-flash (hy_v4_flash) is in Transformers PR #50903, not a released version; install it with pip install "transformers[torch,vision] @ git+https://github.com/huggingface/transformers.git@refs/pull/50903/head" first. The Engram memory and the compressed indexer only run with eager attention here.

def run_transformers(model_id: str):
    import numpy as np
    import torch
    from PIL import Image, ImageDraw
    from transformers import AutoModelForImageTextToText, AutoProcessor
    from transformers.video_utils import VideoMetadata

    model_id = str(model_id)
    processor = AutoProcessor.from_pretrained(model_id)
    model = AutoModelForImageTextToText.from_pretrained(
        model_id, dtype=torch.bfloat16, device_map="cuda", attn_implementation="eager"
    )
    image = Image.new("RGB", (128, 128), "white")
    ImageDraw.Draw(image).text((20, 20), "Hello", fill="black")
    frames = np.stack(
        [
            np.asarray(Image.new("RGB", (64, 64), color))
            for color in ((220, 30, 30), (30, 220, 30), (30, 30, 220), (220, 220, 30))
        ]
    )
    messages = [
        {
            "role": "user",
            "content": [
                {"type": "image", "image": image},
                {"type": "video", "video": frames},
                {"type": "text", "text": "Describe the image and the video."},
            ],
        }
    ]
    inputs = processor.apply_chat_template(
        messages,
        tokenize=True,
        add_generation_prompt=True,
        return_dict=True,
        return_tensors="pt",
        do_sample_frames=False,
        video_metadata=[VideoMetadata(total_num_frames=4, fps=2, frames_indices=[0, 1, 2, 3])],
    ).to(model.device)
    mm = inputs["mm_token_type_ids"]
    with torch.no_grad():
        logits = model(**inputs).logits
        assert torch.isfinite(logits).all()
        output = model.generate(**inputs, do_sample=False, max_new_tokens=10)
    assert int((mm == 1).sum()) > 0 and int((mm == 2).sum()) > 0
    print(processor.decode(output[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True))


if __name__ == "__main__":
    run_transformers(model_id="tiny-random/hy4-flash")

SGLang (✅ verified)

Hy4-flash 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 --tp 2 \
  --dtype bfloat16 --context-length 4096 \
  --served-model-name hy4-flash --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",
    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

Change log

  • 2026-11-24: Initial tiny Hy4-flash vision-language checkpoint.

This repo is generated by DeepSeek-V4.1-Flash.

Downloads last month
30
Safetensors
Model size
14.2M params
Tensor type
F32
·
I32
·
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for tiny-random/hy4-flash

Finetuned
(20)
this model

Collection including tiny-random/hy4-flash