Image-Text-to-Text
Transformers
TensorBoard
Safetensors
feature-extraction
conversational
custom_code
Instructions to use lmms-lab/LLaVA-OneVision-1.5-4B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lmms-lab/LLaVA-OneVision-1.5-4B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="lmms-lab/LLaVA-OneVision-1.5-4B-Instruct", 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("lmms-lab/LLaVA-OneVision-1.5-4B-Instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lmms-lab/LLaVA-OneVision-1.5-4B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lmms-lab/LLaVA-OneVision-1.5-4B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lmms-lab/LLaVA-OneVision-1.5-4B-Instruct", "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/lmms-lab/LLaVA-OneVision-1.5-4B-Instruct
- SGLang
How to use lmms-lab/LLaVA-OneVision-1.5-4B-Instruct 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 "lmms-lab/LLaVA-OneVision-1.5-4B-Instruct" \ --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": "lmms-lab/LLaVA-OneVision-1.5-4B-Instruct", "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 "lmms-lab/LLaVA-OneVision-1.5-4B-Instruct" \ --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": "lmms-lab/LLaVA-OneVision-1.5-4B-Instruct", "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 lmms-lab/LLaVA-OneVision-1.5-4B-Instruct with Docker Model Runner:
docker model run hf.co/lmms-lab/LLaVA-OneVision-1.5-4B-Instruct
Commit History
-
Update README.md
Verified signatureae6819d
-
Update modeling_llavaonevision1_5.py
Verified signature3ad1d87
-
Update modeling_llavaonevision1_5.py
Verified signaturee6bb4cd
-
Update README.md
Verified signature21cbb17 -
Update README.md
Verified signatured6fbfb7 -
Update README.md
Verified signatured51517f -
Update README.md
Verified signatureef3fa61
-
Update README.md
Verified signature6430d15 -
Improve model card: add prominent links, comprehensive guides, and project details (#2)
Verified signature- Improve model card: add prominent links, comprehensive guides, and project details (ff264893f327294b99bd0c59896d42002f48150d) Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>967d049
-
Update README.md
YiyeVerified signature152c522
-
Update README.md
Verified signaturefb4fc57 -
Update README.md
Verified signature381249b -
Upload events.out.tfevents.1758101239.109436.0
Verified signature034d0f7 -
Create tensorboard/instruct/README.md
Verified signature854a794
-
Create README.md
YiyeVerified signature03e6f76 -
Upload vocab.json with huggingface_hub
YiyeVerified signature4a137ed -
Upload tokenizer.json with huggingface_hub
YiyeVerified signature029d188 -
Upload special_tokens_map.json with huggingface_hub
YiyeVerified signatureaee2e22 -
Upload model.safetensors.index.json with huggingface_hub
YiyeVerified signature36e0b04 -
Upload model-00002-of-00002.safetensors with huggingface_hub
YiyeVerified signature1232b04 -
Upload merges.txt with huggingface_hub
YiyeVerified signature269b086 -
Upload configuration_llavaonevision1_5.py with huggingface_hub
YiyeVerified signature5d5fed2 -
Upload chat_template.jinja with huggingface_hub
YiyeVerified signature4af0aab -
Upload tokenizer_config.json with huggingface_hub
YiyeVerified signature057e4a8 -
Upload preprocessor_config.json with huggingface_hub
YiyeVerified signaturea09199b -
Upload modeling_llavaonevision1_5.py with huggingface_hub
YiyeVerified signature3a186f0 -
Upload model-00001-of-00002.safetensors with huggingface_hub
YiyeVerified signature344d069 -
Upload generation_config.json with huggingface_hub
YiyeVerified signaturee3b72e1 -
Upload added_tokens.json with huggingface_hub
YiyeVerified signature2686dea -
Upload config.json with huggingface_hub
YiyeVerified signature7a59d7a -
initial commit
YiyeVerified signatureca0fe71