Instructions to use Zyphra/ZAYA1-VL-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Zyphra/ZAYA1-VL-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Zyphra/ZAYA1-VL-8B") 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)# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("Zyphra/ZAYA1-VL-8B", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Zyphra/ZAYA1-VL-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Zyphra/ZAYA1-VL-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zyphra/ZAYA1-VL-8B", "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/Zyphra/ZAYA1-VL-8B
- SGLang
How to use Zyphra/ZAYA1-VL-8B 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 "Zyphra/ZAYA1-VL-8B" \ --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": "Zyphra/ZAYA1-VL-8B", "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 "Zyphra/ZAYA1-VL-8B" \ --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": "Zyphra/ZAYA1-VL-8B", "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 Zyphra/ZAYA1-VL-8B with Docker Model Runner:
docker model run hf.co/Zyphra/ZAYA1-VL-8B
File size: 1,769 Bytes
769048c fda6d21 769048c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | {
"activation_func": "swiglu",
"activation_func_fp8_input_store": false,
"add_bias_linear": false,
"apply_rope_fusion": true,
"ar_threshold": 1,
"architectures": [
"Zaya1VLForConditionalGeneration"
],
"attention_bias": false,
"bias_activation_fusion": true,
"bos_token_id": 2,
"cca": true,
"clamp_temp": false,
"eos_token_id": 262143,
"ffn_hidden_size": 4096,
"fused_add_norm": false,
"gated_linear_unit": true,
"hidden_size": 2048,
"head_dim": 128,
"image_token_id": 262147,
"lm_head_bias": false,
"lora_rank": 0,
"max_position_embeddings": 32768,
"model_type": "zaya1_vl",
"moe_router_topk": 1,
"norm_epsilon": 1e-05,
"normalization": "RMSNorm",
"num_attention_heads": 8,
"num_experts": 16,
"num_hidden_layers": 40,
"num_key_value_heads": 2,
"num_query_groups": 2,
"pad_token_id": 0,
"padding_side": "right",
"projector_hidden_act": "gelu",
"residual_in_fp32": false,
"rope_pct": 0.5,
"rotary_base": 1000000,
"scale_residual_merge": true,
"sliding_window": null,
"temporal_patch_size": 1,
"tie_word_embeddings": true,
"torch_dtype": "bfloat16",
"transformers_version": "4.57.1",
"use_lora_att": false,
"use_rope_scaling": false,
"vision_config": {
"_attn_implementation_autoset": true,
"hidden_size": 1280,
"in_chans": 3,
"model_type": "qwen2_5_vl",
"out_hidden_size": 2048,
"spatial_patch_size": 14,
"temporal_patch_size": 1,
"tokens_per_second": 2,
"torch_dtype": "bfloat16"
},
"vision_end_token_id": 256000,
"vision_lora": true,
"vision_lora_rank_attn": 8,
"vision_lora_rank_mlp": 32,
"vision_start_token_id": 255999,
"vocab_size": 262272,
"zaya_mlp_expansion": 256,
"zaya_use_eda": true,
"zaya_use_mod": true
}
|