Instructions to use lmms-lab/LLaVA-OneVision-1.5-8B-Base 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-8B-Base 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-8B-Base", 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-8B-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lmms-lab/LLaVA-OneVision-1.5-8B-Base 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-8B-Base" # 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-8B-Base", "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-8B-Base
- SGLang
How to use lmms-lab/LLaVA-OneVision-1.5-8B-Base 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-8B-Base" \ --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-8B-Base", "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-8B-Base" \ --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-8B-Base", "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-8B-Base with Docker Model Runner:
docker model run hf.co/lmms-lab/LLaVA-OneVision-1.5-8B-Base
Commit History
-
Create README.md
YiyeVerified signature0ee4560 -
Upload configuration_llavaonevision1_5.py with huggingface_hub
YiyeVerified signature7a7cf09 -
Upload generation_config.json with huggingface_hub
YiyeVerified signature01b3cba -
Upload config.json with huggingface_hub
YiyeVerified signaturebef9daa -
Upload modeling_llavaonevision1_5.py with huggingface_hub
YiyeVerified signature1f28aa3 -
Upload vocab.json with huggingface_hub
YiyeVerified signature0afe81b -
Upload tokenizer.json with huggingface_hub
YiyeVerified signature8668888 -
Upload special_tokens_map.json with huggingface_hub
YiyeVerified signature68d03fc -
Upload model.safetensors.index.json with huggingface_hub
YiyeVerified signature7b73f02 -
Upload model-00003-of-00004.safetensors with huggingface_hub
YiyeVerified signature2df8636 -
Upload model-00001-of-00004.safetensors with huggingface_hub
YiyeVerified signature2805325 -
Upload chat_template.jinja with huggingface_hub
YiyeVerified signature33a1f52 -
Upload tokenizer_config.json with huggingface_hub
YiyeVerified signaturef5203b5 -
Upload preprocessor_config.json with huggingface_hub
YiyeVerified signature33110f9 -
Upload model-00004-of-00004.safetensors with huggingface_hub
YiyeVerified signature274bb76 -
Upload model-00002-of-00004.safetensors with huggingface_hub
YiyeVerified signaturea2c49a6 -
Upload merges.txt with huggingface_hub
YiyeVerified signaturebb9b4ab -
Upload added_tokens.json with huggingface_hub
YiyeVerified signatureafdd0f6 -
initial commit
YiyeVerified signature6d96105