Instructions to use jinaai/jina-vlm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jinaai/jina-vlm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="jinaai/jina-vlm", 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)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("jinaai/jina-vlm", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jinaai/jina-vlm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jinaai/jina-vlm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jinaai/jina-vlm", "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/jinaai/jina-vlm
- SGLang
How to use jinaai/jina-vlm 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 "jinaai/jina-vlm" \ --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": "jinaai/jina-vlm", "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 "jinaai/jina-vlm" \ --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": "jinaai/jina-vlm", "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 jinaai/jina-vlm with Docker Model Runner:
docker model run hf.co/jinaai/jina-vlm
Will it support MLX?
Dear developers,
Thank you very much for releasing such a great model !!
Since the M4 Mac mini is very good, I hope to deploy such a great model on the Mac mini as well.
I would like to ask if there are any plans to support the MLX acceleration engine?
Thanks a lot !
Thank you so much !!
Btw, I found that this model may not have been quantized, as it seems to consume nearly 40G of RAM.
Will there be a quantized version released later? For example, 4-bit, 8-bit quantization.
Best Wishes.
Yes, we will probably do that once we have ironed out the details on vLLM support
Yes, we will probably do that once we have ironed out the details on vLLM support
wow, thanks!
Just can't wait to see it !
okay fixed, so now model size is down to 2gb with mixed precision, details here
- Language Model: 5.84 bits/weight (4-bit linear + float16 embeddings)
- Vision Encoder: 7.95 bits/weight (4-bit where possible + float16)
- VL Connector: 4.00 bits/weight (fully 4-bit)
pushing pr here, once its merged we should be able to use it directly via lmstudio etc on macos.