Image-Text-to-Text
Transformers
Safetensors
English
qwen2_5_vl
multimodal
image caption
captioning
conversational
text-generation-inference
Instructions to use internlm/CapRL-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use internlm/CapRL-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="internlm/CapRL-3B") 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 AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("internlm/CapRL-3B") model = AutoModelForImageTextToText.from_pretrained("internlm/CapRL-3B") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use internlm/CapRL-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "internlm/CapRL-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "internlm/CapRL-3B", "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/internlm/CapRL-3B
- SGLang
How to use internlm/CapRL-3B 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 "internlm/CapRL-3B" \ --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": "internlm/CapRL-3B", "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 "internlm/CapRL-3B" \ --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": "internlm/CapRL-3B", "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 internlm/CapRL-3B with Docker Model Runner:
docker model run hf.co/internlm/CapRL-3B
| language: | |
| - en | |
| library_name: transformers | |
| license: apache-2.0 | |
| pipeline_tag: image-text-to-text | |
| tags: | |
| - multimodal | |
| - image caption | |
| - captioning | |
| datasets: | |
| - internlm/CapRL-2M | |
| - internlm/CapRL-QA-75K | |
| # CapRL | |
| ๐<a href="https://arxiv.org/abs/2509.22647">Paper</a> | ๐ <a href="https://github.com/InternLM/CapRL">Github</a> | ๐ค<a href="https://huggingface.co/collections/long-xing1/caprl-68d64ac32ded31596c36e189">CapRL Collection</a> | ๐ค<a href="https://huggingface.co/papers/2509.22647">Daily Paper</a> | |
| ### CapRL Series Model & Dataset | |
| | Series | Models & Resources | | |
| | :--- | :--- | | |
| | **CapRL 2.0 Series** | [๐ค CapRL-Qwen3VL-2B](https://huggingface.co/internlm/CapRL-Qwen3VL-2B) \| [๐ค CapRL-Qwen3VL-4B](https://huggingface.co/internlm/CapRL-Qwen3VL-4B) \| [๐ฆ CapRL-Qwen3VL-2B-GGUF](https://huggingface.co/internlm/CapRL-Qwen3VL-2B-GGUF) \| [๐ฆ CapRL-Qwen3VL-4B-GGUF](https://huggingface.co/internlm/CapRL-Qwen3VL-4B-GGUF) \| [๐CapRL-Qwen3VL-4B Space](https://huggingface.co/spaces/yuhangzang/CapRL-Qwen3VL-4B) | |
| | **CapRL 1.0 Series** | [๐ค CapRL-Qwen2.5VL-3B](https://huggingface.co/internlm/CapRL-3B) \| [๐ค CapRL-InternVL3.5-8B](https://huggingface.co/yuhangzang/CapRL-InternVL3.5-8B) \|[๐ CapRL-QA-75K Dataset](https://huggingface.co/datasets/internlm/CapRL-QA-75K) \| [๐ CapRL-2M Dataset](https://huggingface.co/datasets/internlm/CapRL-2M) \| [๐ฆ CapRL-3B-GGUF](https://huggingface.co/mradermacher/CapRL-3B-GGUF) \| [๐ฆ CapRL-3B-i1-GGUF](https://huggingface.co/mradermacher/CapRL-3B-i1-GGUF) \| [๐CapRL-Qwen2.5VL-3B Space](https://huggingface.co/spaces/yuhangzang/caprl) | |
| We are excited to release the **CapRL 2.0 series**: **CapRL-Qwen3VL-2B** and **CapRL-Qwen3VL-4B**. These models feature fewer parameters while delivering even more powerful captioning performance. | |
| Notably, **CapRL-Qwen3VL-2B outperforms both CapRL-Qwen2.5VL-3B and Qwen2.5VL-72B in captioning tasks**. | |
| This leap in efficiency is driven by our upgraded training recipe, which includes a more rigorous QA data filter and a significantly more diverse image dataset. We welcome everyone to try them out! | |
| ## CapRL-3B | |
| Now you can try out CapRL-3B with your own images๐จ! โก๏ธ [๐CapRL Space](https://huggingface.co/spaces/yuhangzang/caprl) | |
| When selecting between the available CapRL models, it's essential to consider the trade-off between performance and computational cost. | |
| This guide will help you choose the most suitable model for your specific needs: | |
| |Model|Parameters|Strength| | |
| |-|-|-| | |
| |๐ค[CapRL-3B](https://huggingface.co/internlm/CapRL-3B)|3B|Speed, Efficiency| | |
| |๐ค[CapRL-InternVL3.5-8B](https://huggingface.co/yuhangzang/CapRL-InternVL3.5-8B)|8B|High Performance, Advanced Captioning Ability| | |
| ## ๐ข News | |
| We are working on even stronger base models and upgrading our training recipe โ stay tuned! | |
| - ๐ฅ [04/16/2026] We have released the **[CapRL-QA-75K](https://huggingface.co/datasets/internlm/CapRL-QA-75K)** training dataset! | |
| - ๐ฅ [12/24/2025] We are excited to release the CapRL 2.0 series: **[CapRL-Qwen3VL-2B](https://huggingface.co/internlm/CapRL-Qwen3VL-2B)** and **[CapRL-Qwen3VL-4B](https://huggingface.co/internlm/CapRL-Qwen3VL-4B)**! | |
| - ๐ฅ [12/24/2025] The total downloads of the CapRL-related [models and dataset](https://huggingface.co/collections/long-xing1/caprl-68d64ac32ded31596c36e189) reached 17,000! | |
| - ๐ฅ [10/15/2025] The total downloads of the CapRL-related [models and dataset](https://huggingface.co/collections/long-xing1/caprl-68d64ac32ded31596c36e189) reached 6,000 within just 20 days! | |
| - ๐ [10/15/2025] We are excited to announce the release of **[CapRL-InternVL3.5-8B](https://huggingface.co/internlm/CapRL-InternVL3.5-8B)**, whose image captioning capability outperforms Qwen2.5-VL-72B! | |
| - ๐ [10/15/2025] Thanks [mradermacher](https://huggingface.co/mradermacher) for the valuable contribution! [CapRL-3B-GGUF](https://huggingface.co/mradermacher/CapRL-3B-GGUF) is the static quants version, and [CapRL-3B-i1-GGUF](https://huggingface.co/mradermacher/CapRL-3B-i1-GGUF) is weighted/imatrix quants version. | |
| - ๐ [10/15/2025] We release [QA curation code](https://github.com/InternLM/CapRL). | |
| - ๐ [09/25/2025] We release **CapRL** repository, [CapRL-3B model](https://huggingface.co/internlm/CapRL-3B), [evaluation code](https://github.com/InternLM/CapRL) and [dataset](https://huggingface.co/datasets/internlm/CapRL-2M). | |
| ## Introduction | |
| We are excited to introduce [CapRL-3B](https://huggingface.co/internlm/CapRL-3B), a lightweight 3B image captioner that achieves perception capabilities comparable to Qwen2.5-VL-72B. | |
| This is the first study of applying Reinforcement Learning with Verifiable Rewards for the | |
| open-ended and subjective image captioning task. Unlike traditional Supervised Fine-Tuning, which | |
| can lead to models memorizing a limited set of annotated captions, our method allows the model to | |
| explore and generate a broader range of creative and general descriptions. | |
| CapRL is a new training paradigm featuring a decoupled two-stage pipeline. The initial | |
| stage uses LVLMs to generate rich and accurate captions. Subsequently, the second stage evaluates | |
| caption quality by using a vision-only LLM to perform the QA task. We also created a specific QA | |
| curation pipeline to ensure the quality of the questions and answers used for the second stage. | |
| By employing the CapRL training framework, initializing with the Qwen2.5-VL-3B model, and using a carefully | |
| filtered 75K QA dataset as the training set, we obtained a highly capable captioner, [CapRL-3B](https://huggingface.co/internlm/CapRL-3B). | |
| <p align="center"> | |
| <img src="./assets/teaser.png" width="750"/> | |
| </p> | |
| <p align="center"> | |
| <img src="./assets/performance_update.png" width="750"/> | |
| </p> | |
| ## Key Features | |
| * **Remarkable visual understanding for Chart, Infographics and Document**: [CapRL-3B](https://huggingface.co/internlm/CapRL-3B) achieves perception accuracy and visual information coverage comparable to Qwen2.5-VL-72B. | |
| * **Well-organized output**: The outputs of CapRL-3B are relatively well-structured, making them clear and easy to understand. | |
| * **Detailed description for natural images**: The outputs of [CapRL-3B](https://huggingface.co/internlm/CapRL-3B) can perfectly cover all valid visual information while containing fewer hallucinations. | |
| ## Usage | |
| If you want to use **[CapRL-3B](https://huggingface.co/internlm/CapRL-3B)** for captioning, you can directly follow the exact same inference approach as in [Qwen2.5-VL-series](https://github.com/QwenLM/Qwen3-VL/tree/d2240f11656bfe404b9ba56db4e51cd09f522ff1). | |
| We recommend using **vLLM** to speed up inference. | |
| ### Start an OpenAI API Service | |
| Run the command below to start an OpenAI-compatible API service: | |
| ```bash | |
| vllm serve "/PATH/CapRL-3B" \ | |
| --trust-remote-code \ | |
| --tensor-parallel-size=1 \ | |
| --pipeline-parallel-size=1 \ | |
| --gpu_memory_utilization=0.95 \ | |
| --served-model-name=caprl \ | |
| --port 8000 \ | |
| --host 0.0.0.0 | |
| ``` | |
| Then you can use the chat API as below: (see [OpenAI API protocol document](https://platform.openai.com/docs/guides/vision/uploading-base-64-encoded-images) for more details): | |
| ```python | |
| import base64 | |
| from openai import OpenAI | |
| # Set OpenAI's API key and API base to use vLLM's API server. | |
| openai_api_key = "EMPTY" | |
| openai_api_base = "http://localhost:8000/v1" | |
| client = OpenAI( | |
| api_key=openai_api_key, | |
| base_url=openai_api_base, | |
| ) | |
| image_path = "/path/to/local/image.png" | |
| with open(image_path, "rb") as f: | |
| encoded_image = base64.b64encode(f.read()) | |
| encoded_image_text = encoded_image.decode("utf-8") | |
| base64_qwen = f"data:image;base64,{encoded_image_text}" | |
| chat_response = client.chat.completions.create( | |
| model="caprl", | |
| messages=[ | |
| {"role": "system", "content": "You are a helpful assistant."}, | |
| { | |
| "role": "user", | |
| "content": [ | |
| { | |
| "type": "image_url", | |
| "image_url": { | |
| "url": base64_qwen | |
| }, | |
| }, | |
| {"type": "text", "text": "What is the text in the illustrate?"}, | |
| ], | |
| }, | |
| ], | |
| temperature=1.0, | |
| max_tokens=max_tokens, | |
| top_p=1.0, | |
| extra_body={ | |
| "repetition_penalty": 1.0, | |
| }, | |
| ) | |
| print("Chat response:", chat_response) | |
| ``` | |
| ## Cases | |
| <p align="center"> | |
| <img src="./assets/comparison.png" width="750"/> | |
| </p> | |
| <p align="center"> | |
| <img src="./assets/info_caprl.png" width="750"/> | |
| </p> | |
| <p align="center"> | |
| <img src="./assets/info_caprl2.png" width="750"/> | |
| </p> | |
| <p align="center"> | |
| <img src="./assets/natural_caprl.png" width="750"/> | |
| </p> |