Image-Text-to-Text
Transformers
Safetensors
GGUF
Chinese
English
hy_v4_flash
text-generation
hunyuan
hy4-flash
Mixture of Experts
multimodal
instruct
hy4
flash
bf16
tencent
conversational
Instructions to use AMAImedia/Hy4-Flash-BF16-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AMAImedia/Hy4-Flash-BF16-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AMAImedia/Hy4-Flash-BF16-GGUF") 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("AMAImedia/Hy4-Flash-BF16-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use AMAImedia/Hy4-Flash-BF16-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS # Run inference directly in the terminal: llama cli -hf AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS # Run inference directly in the terminal: llama cli -hf AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS # Run inference directly in the terminal: ./build/bin/llama cli -hf AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
Use Docker
docker model run hf.co/AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
- Llama new
- LM Studio
- Jan
- vLLM
How to use AMAImedia/Hy4-Flash-BF16-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AMAImedia/Hy4-Flash-BF16-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AMAImedia/Hy4-Flash-BF16-GGUF", "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/AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
- SGLang
How to use AMAImedia/Hy4-Flash-BF16-GGUF 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 "AMAImedia/Hy4-Flash-BF16-GGUF" \ --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": "AMAImedia/Hy4-Flash-BF16-GGUF", "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 "AMAImedia/Hy4-Flash-BF16-GGUF" \ --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": "AMAImedia/Hy4-Flash-BF16-GGUF", "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" } } ] } ] }' - Ollama
How to use AMAImedia/Hy4-Flash-BF16-GGUF with Ollama:
ollama run hf.co/AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
- Unsloth Desktop
- Pi
How to use AMAImedia/Hy4-Flash-BF16-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use AMAImedia/Hy4-Flash-BF16-GGUF with Docker Model Runner:
docker model run hf.co/AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
- Lemonade
How to use AMAImedia/Hy4-Flash-BF16-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
Run and chat with the model
lemonade run user.Hy4-Flash-BF16-GGUF-IQ4_XS
List all available models
lemonade list
- Hermes Agent
How to use AMAImedia/Hy4-Flash-BF16-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use AMAImedia/Hy4-Flash-BF16-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "AMAImedia/Hy4-Flash-BF16-GGUF:IQ4_XS" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Download config.json from AMAImedia/Hy4-Flash-BF16-GGUF: direct link, hf CLI and curl.
- Browser
- Download file 10.8 kB
-
https://huggingface.co/AMAImedia/Hy4-Flash-BF16-GGUF/resolve/main/config.json
- Command line
-
hf download hf://AMAImedia/Hy4-Flash-BF16-GGUF/config.json
-
curl -L -o config.json https://huggingface.co/AMAImedia/Hy4-Flash-BF16-GGUF/resolve/main/config.json
10.8 kB
| { | |
| "architectures": [ | |
| "HYV4FlashForConditionalGeneration" | |
| ], | |
| "dtype": "bfloat16", | |
| "image_end_token_id": 120119, | |
| "image_newline_token_id": 120121, | |
| "image_start_token_id": 120118, | |
| "image_token_id": 120120, | |
| "model_type": "hy_v4_flash", | |
| "processor_class": "HYV4FlashProcessor", | |
| "spatial_merge_size": 2, | |
| "text_config": { | |
| "architectures": [ | |
| "HYV4FlashForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bitwise_backward_align": true, | |
| "bos_token_id": 120000, | |
| "compressed_indexer_candidate_topk": 2048, | |
| "compressed_indexer_compress_ratio": 4, | |
| "compressed_indexer_group_topk": 512, | |
| "compressed_indexer_head_dim": 128, | |
| "compressed_indexer_key_pooling": "gated", | |
| "compressed_indexer_num_attention_heads": 16, | |
| "compressed_indexer_reuse_fine_indexer": false, | |
| "compressed_indexer_skip_fine_select": true, | |
| "compressed_indexer_stage2_query_block_size": 8192, | |
| "compressed_indexer_teacher_pooling_type": "max", | |
| "compressed_indexer_triton_pooling_min_groups": 1, | |
| "compressed_indexer_use_triton_pooling": true, | |
| "dsa_skip_attn_post_norm": false, | |
| "enable_ihc": true, | |
| "enable_lm_head_fp32": true, | |
| "engram_embed_random_seed": 1234, | |
| "engram_fp8_embedding": true, | |
| "engram_isolate_fffd_namespace": false, | |
| "engram_layer_head_vocab_sizes": { | |
| "12": [ | |
| [ | |
| 10312277, | |
| 10312283, | |
| 10312301, | |
| 10312343, | |
| 10312373, | |
| 10312397, | |
| 10312409, | |
| 10312453 | |
| ], | |
| [ | |
| 10312457, | |
| 10312483, | |
| 10312507, | |
| 10312513, | |
| 10312531, | |
| 10312543, | |
| 10312567, | |
| 10312571 | |
| ] | |
| ], | |
| "2": [ | |
| [ | |
| 10312007, | |
| 10312021, | |
| 10312039, | |
| 10312069, | |
| 10312091, | |
| 10312121, | |
| 10312123, | |
| 10312147 | |
| ], | |
| [ | |
| 10312177, | |
| 10312187, | |
| 10312207, | |
| 10312213, | |
| 10312229, | |
| 10312241, | |
| 10312249, | |
| 10312259 | |
| ] | |
| ], | |
| "22": [ | |
| [ | |
| 10312613, | |
| 10312619, | |
| 10312633, | |
| 10312657, | |
| 10312681, | |
| 10312699, | |
| 10312723, | |
| 10312747 | |
| ], | |
| [ | |
| 10312759, | |
| 10312789, | |
| 10312811, | |
| 10312823, | |
| 10312867, | |
| 10312873, | |
| 10312889, | |
| 10312903 | |
| ] | |
| ], | |
| "32": [ | |
| [ | |
| 10312909, | |
| 10312919, | |
| 10312927, | |
| 10312957, | |
| 10312979, | |
| 10313011, | |
| 10313021, | |
| 10313057 | |
| ], | |
| [ | |
| 10313063, | |
| 10313117, | |
| 10313123, | |
| 10313129, | |
| 10313161, | |
| 10313179, | |
| 10313189, | |
| 10313201 | |
| ] | |
| ] | |
| }, | |
| "engram_layer_ids": [ | |
| 2, | |
| 12, | |
| 22, | |
| 32 | |
| ], | |
| "engram_max_ngram_size": 3, | |
| "engram_n_embed_per_ngram": 768, | |
| "engram_n_head_per_ngram": 8, | |
| "engram_pad_id": 120002, | |
| "engram_seed": 0, | |
| "engram_tokenizer_name_or_path": null, | |
| "engram_vocab_map_path": null, | |
| "engram_vocab_size": [ | |
| 10312000, | |
| 10312000 | |
| ], | |
| "eos_token_id": 120025, | |
| "fast_op_fp32_linear_gemm": true, | |
| "first_k_dense_replace": 1, | |
| "full_nope": false, | |
| "gate_groups": 1, | |
| "gate_lora_op": "none", | |
| "gate_lora_rank": null, | |
| "gated_mla": true, | |
| "gating_type": "elementwise", | |
| "hc_eps": 1e-06, | |
| "hc_magnitude": 2.0, | |
| "hc_mult": 4, | |
| "head_dim": 64, | |
| "hidden_act": "silu", | |
| "hidden_size": 3072, | |
| "ihc_kernel_backend": "naive", | |
| "index_head_dim": 128, | |
| "index_n_heads": 16, | |
| "index_topk": 2048, | |
| "indexer_types": [ | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full", | |
| "full" | |
| ], | |
| "initializer_range": 0.006, | |
| "intermediate_size": 13824, | |
| "kv_lora_rank": 512, | |
| "layer_types": [ | |
| "deepseek_sparse_attention", | |
| "deepseek_sparse_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "deepseek_sparse_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "deepseek_sparse_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "deepseek_sparse_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "deepseek_sparse_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "deepseek_sparse_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "deepseek_sparse_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "deepseek_sparse_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "deepseek_sparse_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "deepseek_sparse_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "deepseek_sparse_attention" | |
| ], | |
| "learnable_sink": true, | |
| "learnable_sink_init": 0.0, | |
| "max_position_embeddings": 1048576, | |
| "mlp_layer_types": [ | |
| "dense", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse" | |
| ], | |
| "model_type": "hy_v4_flash", | |
| "moe_aux_loss_coeff": 0.0, | |
| "moe_intermediate_size": 1536, | |
| "moe_router_enable_expert_bias": true, | |
| "moe_router_use_sigmoid": true, | |
| "n_group": 1, | |
| "n_routed_experts": 512, | |
| "n_shared_experts": 1, | |
| "norm_topk_prob": true, | |
| "num_attention_heads": 32, | |
| "num_experts_per_tok": 16, | |
| "num_hidden_layers": 42, | |
| "num_key_value_heads": 32, | |
| "num_nextn_predict_layers": 0, | |
| "o_groups": 1, | |
| "o_lora_op": "none", | |
| "o_lora_rank": null, | |
| "output_router_logits": false, | |
| "pad_token_id": 120002, | |
| "q_lora_rank": 1024, | |
| "qk_head_dim": 256, | |
| "qk_nope_head_dim": 192, | |
| "qk_norm": true, | |
| "qk_rope_head_dim": 64, | |
| "return_bos_score": true, | |
| "return_max_logit": true, | |
| "rms_norm_eps": 1e-05, | |
| "rope_parameters": { | |
| "sliding_attention": { | |
| "mrope_interleaved": true, | |
| "mrope_section": [ | |
| 12, | |
| 10, | |
| 10 | |
| ], | |
| "rope_theta": 10000, | |
| "rope_type": "default" | |
| }, | |
| "deepseek_sparse_attention": { | |
| "mrope_interleaved": true, | |
| "mrope_section": [ | |
| 12, | |
| 10, | |
| 10 | |
| ], | |
| "rope_theta": 10000000, | |
| "rope_type": "default" | |
| } | |
| }, | |
| "routed_expert_hidden_size": 1536, | |
| "routed_scaling_factor": 3.998, | |
| "sandwich_norm": true, | |
| "sliding_window": 512, | |
| "swa_num_attention_heads": 64, | |
| "swa_pattern": [ | |
| 0, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 0 | |
| ], | |
| "swa_qk_head_dim": 256, | |
| "swa_qk_nope_head_dim": 192, | |
| "swa_qk_rope_head_dim": 64, | |
| "swa_v_head_dim": 256, | |
| "swiglu_limit": 10.0, | |
| "tie_word_embeddings": false, | |
| "topk_group": 1, | |
| "use_cache": true, | |
| "use_compressed_indexer": true, | |
| "use_dsa": true, | |
| "use_grouped_mm": false, | |
| "use_mla": true, | |
| "v_head_dim": 256, | |
| "vocab_size": 120832, | |
| "window_size": [ | |
| 511, | |
| 0 | |
| ] | |
| }, | |
| "transformers_version": "5.23.0", | |
| "video_end_token_id": 120123, | |
| "video_start_token_id": 120122, | |
| "video_token_id": 120124, | |
| "vision_config": { | |
| "add_patchemb_bias": true, | |
| "anyres_vit_max_image_size": 2048, | |
| "attention_backend": "hf_align_sdpa", | |
| "attention_dropout": 0.0, | |
| "bias_activation_fusion": true, | |
| "cat_extra_token": 0, | |
| "hidden_act": "gelu", | |
| "hidden_dropout": 0.0, | |
| "hidden_size": 1152, | |
| "img_max_token_num": 4096, | |
| "intermediate_size": 4304, | |
| "interpolate_mode": "bilinear", | |
| "learnable_mlp_pooling_size": 0, | |
| "max_image_size": 2048, | |
| "max_vit_seq_len": 16384, | |
| "min_image_size": 512, | |
| "model_type": "hy_v4_flash", | |
| "num_attention_heads": 16, | |
| "num_channels": 3, | |
| "num_hidden_layers": 27, | |
| "num_key_value_heads": 16, | |
| "out_hidden_size": 3072, | |
| "packed_seq_alignment": 128, | |
| "patch_size": 16, | |
| "perceive_post_norm": false, | |
| "perceive_pre_norm": true, | |
| "projector_type": "rmsnorm_mlp_adapter", | |
| "remove_prenorm": true, | |
| "resize_resolution": 2048, | |
| "rms_norm_eps": 1e-05, | |
| "rope_2d_percent": 1.0, | |
| "rope_2d_theta": 10000.0, | |
| "spatial_merge_size": 2, | |
| "spatial_patch_size": 1, | |
| "temporal_patch_size": 1, | |
| "text_hidden_size": 3072, | |
| "video_max_image_size": 768, | |
| "video_min_image_size": 256, | |
| "video_spatial_compression": false, | |
| "video_temporal_compression": false, | |
| "vision_full_attention": false | |
| }, | |
| "vision_start_token_id": 120118, | |
| "speculative_config": { | |
| "method": "dfly", | |
| "model": "dfly", | |
| "num_speculative_tokens": 5, | |
| "draft_sample_method": "probabilistic" | |
| }, | |
| "dfly_mtp_fusion": "slot0", | |
| "dfly_target_index_topk": 2048, | |
| "dfly_context_local_window": null, | |
| "dfly_enable_hidden_correction": true, | |
| "dfly_num_hidden_layers": 5, | |
| "dfly_mask_token_id": 120009, | |
| "dfly_target_index_layer": [ | |
| 25, | |
| 29, | |
| 33, | |
| 37, | |
| 41 | |
| ], | |
| "dfly_target_kv_layers": [ | |
| 25, | |
| 29, | |
| 33, | |
| 37, | |
| 41 | |
| ] | |
| } | |