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
File size: 2,806 Bytes
8aed42b b2491ee 8aed42b b2491ee 8aed42b | 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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | ---
license: apache-2.0
library_name: transformers
pipeline_tag: image-text-to-text
base_model: OpenGVLab/InternVL3_5-8B
tags:
- multimodal
- vision-language
- spatial-reasoning
- spatiolm
---
# SpatioLM-Perception-InternVL3.5
This is the official **SpatioLM Perception** checkpoint based on
**InternVL3.5 (8B)**. It is intended for metric depth and physical spatial perception.
SpatioLM adds a plug-and-play spatio-vision module to a frozen vision-language
model and learns physically coherent representations from pseudo depth and
camera-ray supervision. No additional 3D input is required at inference time.
## Resources
- GitHub: https://github.com/xiaomi-research/spatio-lm
- Paper: https://arxiv.org/abs/2608.01899
## Installation
```bash
git clone https://github.com/xiaomi-research/spatio-lm.git
cd spatio-lm
pip install -e .
```
## Image inference
```python
import torch
from lmms_eval.models.simple.internvl2 import load_image
from PIL import Image
from transformers import AutoTokenizer
from spatiolm.models import InternVL3RChatModel
checkpoint = "xiaomi-research/SpatioLM-Perception-InternVL3.5"
image = Image.open("/path/to/image.jpg").convert("RGB")
model = InternVL3RChatModel.from_pretrained(
checkpoint,
dtype=torch.bfloat16,
low_cpu_mem_usage=True,
).eval().cuda()
tokenizer = AutoTokenizer.from_pretrained(
checkpoint,
trust_remote_code=True,
use_fast=False,
)
pixel_values = load_image(image, input_size=448).to(
device="cuda",
dtype=torch.bfloat16,
)
answer = model.chat(
tokenizer,
pixel_values,
"Which object is closer to the camera?",
{"max_new_tokens": 128, "do_sample": False},
)
print(answer)
```
For video inference, benchmark evaluation, training details, and the Action
checkpoint interface, see the
[SpatioLM repository](https://github.com/xiaomi-research/spatio-lm).
## Intended use and limitations
- This checkpoint is intended for research on physical spatial intelligence.
- Outputs can be inaccurate and should not be used as the sole signal in
safety-critical or high-impact decisions.
- Performance can vary with image quality, viewpoint, scene domain, prompting,
and video sampling strategy.
- The custom SpatioLM model implementation is required; loading with only stock
Transformers auto classes is not supported.
## Citation
```bibtex
@inproceedings{wu2026spatiolm,
title={SpatioLM: Towards General Physical Spatial Intelligence in Vision-Language Models},
author={Wu, Jing and Wu, Jianhua and Guan, Jiayi and Chen, Jiahong and Lu, Jinghui and Ye, Hangjun and Gao, Bingzhao and Chen, Long},
booktitle={International Conference on Machine Learning (ICML)},
year={2026},
note={To appear},
eprint={2608.01899},
archivePrefix={arXiv},
url={https://arxiv.org/abs/2608.01899}
}
```
|