Image-Text-to-Text
Transformers
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL3-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL3-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/InternVL3-2B", 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OpenGVLab/InternVL3-2B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenGVLab/InternVL3-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/InternVL3-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenGVLab/InternVL3-2B", "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/OpenGVLab/InternVL3-2B
- SGLang
How to use OpenGVLab/InternVL3-2B 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 "OpenGVLab/InternVL3-2B" \ --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": "OpenGVLab/InternVL3-2B", "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 "OpenGVLab/InternVL3-2B" \ --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": "OpenGVLab/InternVL3-2B", "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 OpenGVLab/InternVL3-2B with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL3-2B
Commit History
-
fix chat_template
Verified signatureInternVL3 chat template fails on system messages with OpenAI content format | vLLM | `0.22.1` | | PyTorch | `2.11.0+cu129` | | Transformers | `5.10.2` | run vllm serve: ```bash vllm serve /InternVL3-2B \ --trust-remote-code \ --host 0.0.0.0 \ --port 8000 \ --served-model-name internvl3-2b ``` when i crul serve such as: ```bash curl http://my_servers_ip:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "internvl3-2b", "messages": [ { "role": "system", "content": "你是一个专业的导游。" }, { "role": "user", "content": "请用三句话介绍一下杭州" } ], "temperature": 0.7, "max_tokens": 256 }' ``` error such as: can only concatenate str (not \"list\") to str63f4861
-
Upload tokenizer_config.json with huggingface_hub
Verified signature8991550 -
Upload tokenizer_config.json with huggingface_hub
Verified signature7a4e873
-
Update README.md
Verified signatureb48cc1d
-
Update README.md
Verified signature1c09cd1
-
Upload README.md with huggingface_hub
Verified signature25d507b
-
Upload modeling_intern_vit.py with huggingface_hub
Verified signaturebf0702d
-
Upload modeling_internvl_chat.py with huggingface_hub
Verified signature2550292 -
Upload README.md with huggingface_hub
Verified signaturefb82b92
-
Upload README.md with huggingface_hub
Verified signatureb6eca7a
-
Upload README.md with huggingface_hub
Verified signatureea89a73 -
Upload README.md with huggingface_hub
Verified signature6b48042 -
Upload README.md with huggingface_hub
Verified signature1594f77 -
Upload README.md with huggingface_hub
Verified signature0458c88
-
Upload folder using huggingface_hub
Verified signaturede3bd5d -
initial commit
Verified signature2406fb3