Image-Text-to-Text
Transformers
Safetensors
internvl_chat
multimodal
vision-language
spatial-reasoning
spatiolm
conversational
Instructions to use xiaomi-research/SpatioLM-Perception-InternVL3.5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xiaomi-research/SpatioLM-Perception-InternVL3.5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="xiaomi-research/SpatioLM-Perception-InternVL3.5") 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 AutoModel model = AutoModel.from_pretrained("xiaomi-research/SpatioLM-Perception-InternVL3.5", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use xiaomi-research/SpatioLM-Perception-InternVL3.5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xiaomi-research/SpatioLM-Perception-InternVL3.5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xiaomi-research/SpatioLM-Perception-InternVL3.5", "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/xiaomi-research/SpatioLM-Perception-InternVL3.5
- SGLang
How to use xiaomi-research/SpatioLM-Perception-InternVL3.5 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 "xiaomi-research/SpatioLM-Perception-InternVL3.5" \ --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": "xiaomi-research/SpatioLM-Perception-InternVL3.5", "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 "xiaomi-research/SpatioLM-Perception-InternVL3.5" \ --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": "xiaomi-research/SpatioLM-Perception-InternVL3.5", "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 xiaomi-research/SpatioLM-Perception-InternVL3.5 with Docker Model Runner:
docker model run hf.co/xiaomi-research/SpatioLM-Perception-InternVL3.5
| { | |
| "architectures": [ | |
| "InternVL3RChatModel" | |
| ], | |
| "downsample_ratio": 0.5, | |
| "dtype": "bfloat16", | |
| "dynamic_image_size": true, | |
| "eos_token_id": 151645, | |
| "force_image_size": 448, | |
| "hidden_size": 4096, | |
| "keys_to_ignore_at_inference": [ | |
| "past_key_values" | |
| ], | |
| "llm_config": { | |
| "architectures": [ | |
| "Qwen3ForV3RCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 151643, | |
| "debug": false, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 151645, | |
| "ep_size": 1, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 4096, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 12288, | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "max_position_embeddings": 40960, | |
| "max_window_layers": 36, | |
| "micro_forward": false, | |
| "model_type": "qwen3_v3r", | |
| "num_attention_heads": 32, | |
| "num_hidden_layers": 36, | |
| "num_key_value_heads": 8, | |
| "pad_token_id": 151643, | |
| "rms_norm_eps": 1e-06, | |
| "rope_scaling": null, | |
| "rope_theta": 1000000, | |
| "skip_checkpoint": false, | |
| "sliding_window": null, | |
| "use_cache": false, | |
| "use_deepep": false, | |
| "use_sliding_window": false, | |
| "vision3r_head_dim": 32, | |
| "vision3r_intermediate_size": 1024, | |
| "vision3r_layer_ids": [ | |
| 4, | |
| 8, | |
| 12, | |
| 16, | |
| 20, | |
| 24 | |
| ], | |
| "vision3r_num_attention_heads": 16, | |
| "vocab_size": 151936 | |
| }, | |
| "max_dynamic_patch": 12, | |
| "min_dynamic_patch": 1, | |
| "model_type": "internvl_chat", | |
| "output_attentions": false, | |
| "pad2square": false, | |
| "pad_token_id": 151643, | |
| "ps_version": "v2", | |
| "select_layer": 18, | |
| "template": "internvl2_5", | |
| "tie_word_embeddings": false, | |
| "transformers_version": null, | |
| "use_backbone_lora": 0, | |
| "use_llm_lora": 0, | |
| "use_thumbnail": true, | |
| "vision_condition_config": null, | |
| "vision_config": { | |
| "architectures": [ | |
| "InternVisionModel" | |
| ], | |
| "attention_dropout": 0.0, | |
| "drop_path_rate": 0.1, | |
| "dropout": 0.0, | |
| "dtype": "bfloat16", | |
| "hidden_act": "gelu", | |
| "hidden_size": 1024, | |
| "image_size": 448, | |
| "initializer_factor": 1.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 4096, | |
| "layer_norm_eps": 1e-06, | |
| "model_type": "intern_vit_6b", | |
| "norm_type": "layer_norm", | |
| "num_attention_heads": 16, | |
| "num_channels": 3, | |
| "num_hidden_layers": 24, | |
| "pad_token_id": 151643, | |
| "patch_size": 14, | |
| "qk_normalization": false, | |
| "qkv_bias": true, | |
| "use_fa3": false, | |
| "use_flash_attn": true | |
| }, | |
| "vision_dpt_config": { | |
| "_name_or_path": "", | |
| "add_cross_attention": false, | |
| "architectures": null, | |
| "bad_words_ids": null, | |
| "begin_suppress_tokens": null, | |
| "bos_token_id": null, | |
| "chunk_size_feed_forward": 0, | |
| "cross_attention_hidden_size": null, | |
| "decoder_start_token_id": null, | |
| "diversity_penalty": 0.0, | |
| "do_sample": false, | |
| "dpt_config": { | |
| "_name_or_path": "", | |
| "add_cross_attention": false, | |
| "alt_start": 8, | |
| "architectures": [ | |
| "DA3Model" | |
| ], | |
| "backbone_name": "vitl", | |
| "bad_words_ids": null, | |
| "begin_suppress_tokens": null, | |
| "bos_token_id": null, | |
| "camera_dec_dim_in": 2048, | |
| "camera_enc_dim_out": 1024, | |
| "cat_token": true, | |
| "chunk_size_feed_forward": 0, | |
| "cross_attention_hidden_size": null, | |
| "decoder_start_token_id": null, | |
| "depth_dim_in": 4096, | |
| "depth_dim_out": 2, | |
| "depth_features": 256, | |
| "depth_out_channels": [ | |
| 256, | |
| 512, | |
| 1024, | |
| 1024 | |
| ], | |
| "diversity_penalty": 0.0, | |
| "do_sample": false, | |
| "dtype": null, | |
| "early_stopping": false, | |
| "encoder_no_repeat_ngram_size": 0, | |
| "eos_token_id": null, | |
| "exponential_decay_length_penalty": null, | |
| "finetuning_task": null, | |
| "forced_bos_token_id": null, | |
| "forced_eos_token_id": null, | |
| "hidden_size": 4096, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "image_size": 518, | |
| "is_decoder": false, | |
| "is_encoder_decoder": false, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "length_penalty": 1.0, | |
| "max_length": 20, | |
| "min_length": 0, | |
| "model_type": "depth_anything_3", | |
| "no_repeat_ngram_size": 0, | |
| "num_beam_groups": 1, | |
| "num_beams": 1, | |
| "num_return_sequences": 1, | |
| "out_layers": [ | |
| 11, | |
| 15, | |
| 19, | |
| 23 | |
| ], | |
| "output_attentions": false, | |
| "output_hidden_states": false, | |
| "output_scores": false, | |
| "pad_token_id": 151643, | |
| "patch_size": 14, | |
| "prefix": null, | |
| "problem_type": null, | |
| "pruned_heads": {}, | |
| "qknorm_start": 8, | |
| "remove_invalid_values": false, | |
| "repetition_penalty": 1.0, | |
| "return_dict": true, | |
| "return_dict_in_generate": false, | |
| "rope_start": 8, | |
| "sep_token_id": null, | |
| "suppress_tokens": null, | |
| "task_specific_params": null, | |
| "temperature": 1.0, | |
| "tf_legacy_loss": false, | |
| "tie_encoder_decoder": false, | |
| "tie_word_embeddings": true, | |
| "tokenizer_class": null, | |
| "top_k": 50, | |
| "top_p": 1.0, | |
| "torchscript": false, | |
| "transformers_version": "4.57.1", | |
| "typical_p": 1.0, | |
| "use_bfloat16": false | |
| }, | |
| "dtype": "float32", | |
| "early_stopping": false, | |
| "encoder_no_repeat_ngram_size": 0, | |
| "eos_token_id": null, | |
| "exponential_decay_length_penalty": null, | |
| "finetuning_task": null, | |
| "forced_bos_token_id": null, | |
| "forced_eos_token_id": null, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "is_decoder": false, | |
| "is_encoder_decoder": false, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "layer_ids": [ | |
| 0, | |
| 2, | |
| 4, | |
| 6 | |
| ], | |
| "length_penalty": 1.0, | |
| "max_length": 20, | |
| "min_length": 0, | |
| "no_repeat_ngram_size": 0, | |
| "num_beam_groups": 1, | |
| "num_beams": 1, | |
| "num_return_sequences": 1, | |
| "output_attentions": false, | |
| "output_hidden_states": false, | |
| "output_scores": false, | |
| "pad_token_id": null, | |
| "prefix": null, | |
| "problem_type": null, | |
| "pruned_heads": {}, | |
| "remove_invalid_values": false, | |
| "repetition_penalty": 1.0, | |
| "return_dict": true, | |
| "return_dict_in_generate": false, | |
| "sep_token_id": null, | |
| "suppress_tokens": null, | |
| "task_specific_params": null, | |
| "temperature": 1.0, | |
| "tf_legacy_loss": false, | |
| "tie_encoder_decoder": false, | |
| "tie_word_embeddings": true, | |
| "tokenizer_class": null, | |
| "top_k": 50, | |
| "top_p": 1.0, | |
| "torchscript": false, | |
| "transformers_version": null, | |
| "typical_p": 1.0, | |
| "use_bfloat16": false | |
| } | |
| } | |