Image-Text-to-Text
Transformers
Safetensors
English
step3p7
text-generation
vision-language
unsloth - multimodal - moe
conversational
custom_code
Instructions to use unsloth/Step-3.7-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/Step-3.7-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="unsloth/Step-3.7-Flash", trust_remote_code=True) 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 AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("unsloth/Step-3.7-Flash", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use unsloth/Step-3.7-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/Step-3.7-Flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/Step-3.7-Flash", "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/unsloth/Step-3.7-Flash
- SGLang
How to use unsloth/Step-3.7-Flash 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 "unsloth/Step-3.7-Flash" \ --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": "unsloth/Step-3.7-Flash", "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 "unsloth/Step-3.7-Flash" \ --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": "unsloth/Step-3.7-Flash", "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 unsloth/Step-3.7-Flash with Docker Model Runner:
docker model run hf.co/unsloth/Step-3.7-Flash
| { | |
| "architectures": [ | |
| "Step3p7ForConditionalGeneration" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_step3p7.Step3p7Config", | |
| "AutoModelForCausalLM": "modeling_step3p7.Step3p7ForConditionalGeneration", | |
| "AutoProcessor": "processing_step3.Step3VLProcessor" | |
| }, | |
| "hidden_size": 4096, | |
| "im_end_token": "<im_end>", | |
| "im_patch_token": "<im_patch>", | |
| "im_start_token": "<im_start>", | |
| "image_token_id": 128001, | |
| "image_token_len": 169, | |
| "max_position_embeddings": 262144, | |
| "model_type": "step3p7", | |
| "pad_token_id": 2, | |
| "patch_token_len": 81, | |
| "projector_bias": false, | |
| "text_config": { | |
| "architectures": [ | |
| "Step3p5ForCausalLM" | |
| ], | |
| "att_impl_type": "GQA", | |
| "attention_dropout": 0.0, | |
| "attention_other_setting": { | |
| "attention_type": "sliding_attention", | |
| "head_dim": 128, | |
| "num_attention_groups": 8, | |
| "num_attention_heads": 96, | |
| "true_head_dim": 128 | |
| }, | |
| "bos_token_id": 0, | |
| "torch_dtype": "bfloat16", | |
| "eos_token_id": [ | |
| 1, | |
| 2, | |
| 128007 | |
| ], | |
| "head_dim": 128, | |
| "hidden_size": 4096, | |
| "intermediate_size": 11264, | |
| "layer_types": [ | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention" | |
| ], | |
| "max_position_embeddings": 262144, | |
| "max_seq_len": 262144, | |
| "model_type": "step3p5", | |
| "moe_every_n_layer": 1, | |
| "moe_intermediate_size": 1280, | |
| "moe_layer_offset": 0, | |
| "moe_layers_enum": "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", | |
| "moe_num_experts": 288, | |
| "moe_router_activation": "sigmoid", | |
| "moe_router_scaling_factor": 3.0, | |
| "moe_top_k": 8, | |
| "need_fp32_gate": true, | |
| "norm_expert_weight": true, | |
| "num_attention_groups": 8, | |
| "num_attention_heads": 64, | |
| "num_hidden_layers": 45, | |
| "num_nextn_predict_layers": 3, | |
| "pad_token_id": 1, | |
| "partial_rotary_factors": [ | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0, | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0, | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0, | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0, | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0, | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0, | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0, | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0, | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0, | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0, | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0, | |
| 0.5, | |
| 1.0, | |
| 1.0, | |
| 1.0 | |
| ], | |
| "rms_norm_eps": 1e-05, | |
| "rope_parameters": { | |
| "factor": 2.0, | |
| "high_freq_factor": 32.0, | |
| "low_freq_factor": 1.0, | |
| "original_max_position_embeddings": 131072, | |
| "rope_theta": [ | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0 | |
| ], | |
| "rope_type": "llama3" | |
| }, | |
| "rope_theta": [ | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0, | |
| 5000000.0, | |
| 10000.0, | |
| 10000.0, | |
| 10000.0 | |
| ], | |
| "share_expert_dim": 1280, | |
| "sink": false, | |
| "sliding_window": 512, | |
| "swiglu_limits": [ | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 7, | |
| 7, | |
| 0.0, | |
| 0.0, | |
| 0.0 | |
| ], | |
| "swiglu_limits_shared": [ | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 16, | |
| 16, | |
| 0.0, | |
| 0.0, | |
| 0.0 | |
| ], | |
| "use_head_wise_attn_gate": true, | |
| "use_mfa": false, | |
| "use_moe": true, | |
| "use_moe_router_bias": true, | |
| "use_qk_norm": false, | |
| "use_rope_layers": [], | |
| "vocab_size": 128896, | |
| "yarn_only_types": [ | |
| "full_attention" | |
| ] | |
| }, | |
| "transformers_version": "5.10.0.dev0", | |
| "understand_projector_stride": 2, | |
| "unsloth_fixed": true, | |
| "use_im_start_end": "true", | |
| "vision_config": { | |
| "heads": 16, | |
| "hidden_act": "quick_gelu", | |
| "image_size": 728, | |
| "layer_norm_eps": 1e-05, | |
| "layers": 47, | |
| "ls_init_value": 0.1, | |
| "mlp_ratio": 5.833333333333333, | |
| "model_type": "perception_encoder", | |
| "num_channels": 3, | |
| "output_dim": null, | |
| "patch_size": 14, | |
| "pool_type": "none", | |
| "ues_cls_token": false, | |
| "use_abs_posemb": true, | |
| "use_cls_token": false, | |
| "use_ln_post": false, | |
| "use_ln_pre": true, | |
| "use_rope2d": true, | |
| "width": 1536 | |
| }, | |
| "vision_select_layer": -1 | |
| } |