Image-Text-to-Text
Transformers
Safetensors
English
Japanese
llmjpvl
feature-extraction
conversational
custom_code
Instructions to use llm-jp/llm-jp-4-vl-9b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use llm-jp/llm-jp-4-vl-9b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="llm-jp/llm-jp-4-vl-9b", 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 AutoModel model = AutoModel.from_pretrained("llm-jp/llm-jp-4-vl-9b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use llm-jp/llm-jp-4-vl-9b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "llm-jp/llm-jp-4-vl-9b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "llm-jp/llm-jp-4-vl-9b", "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/llm-jp/llm-jp-4-vl-9b
- SGLang
How to use llm-jp/llm-jp-4-vl-9b 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 "llm-jp/llm-jp-4-vl-9b" \ --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": "llm-jp/llm-jp-4-vl-9b", "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 "llm-jp/llm-jp-4-vl-9b" \ --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": "llm-jp/llm-jp-4-vl-9b", "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 llm-jp/llm-jp-4-vl-9b with Docker Model Runner:
docker model run hf.co/llm-jp/llm-jp-4-vl-9b
Nemotron-Image-Training-v3 subsets used
For reproducibility, the following lists the exact subsets of nvidia/Nemotron-Image-Training-v3 used to train LLM-jp-4-VL 9B, after removing subsets with license / terms-of-use issues.
| subset | samples |
|---|---|
| openimages_1 | 1,236,601 |
| openimages_3 | 1,236,572 |
| cc3m | 867,065 |
| openimages_4 | 504,275 |
| openimages_2 | 504,262 |
| mulberry_2 | 191,329 |
| openimages_5 | 92,905 |
| ecd | 55,341 |
| long_document_arxiv_1 | 53,990 |
| long_document_arxiv_2 | 46,247 |
| docvqa | 35,759 |
| textvqa_commercial | 34,602 |
| long_document_arxiv_3 | 31,089 |
| textcaps | 27,109 |
| aokvqa_1 | 19,200 |
| zhwiki_2 | 11,341 |
| long_document_sec_3 | 8,306 |
| pubtables_1m | 5,013 |
| long_document_sec_4 | 3,579 |
| geometry3k | 2,078 |
| hiertext | 514 |
| turing | 193 |
| total | 4,967,370 |