Image-Text-to-Text
Transformers
Safetensors
English
molmo2
multimodal
molmo
web-agent
full-precision
vllm-compatible
conversational
custom_code
Instructions to use ravilution/MolmoWeb-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ravilution/MolmoWeb-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ravilution/MolmoWeb-4B", 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 AutoModelForImageTextToText model = AutoModelForImageTextToText.from_pretrained("ravilution/MolmoWeb-4B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ravilution/MolmoWeb-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ravilution/MolmoWeb-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ravilution/MolmoWeb-4B", "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/ravilution/MolmoWeb-4B
- SGLang
How to use ravilution/MolmoWeb-4B 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 "ravilution/MolmoWeb-4B" \ --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": "ravilution/MolmoWeb-4B", "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 "ravilution/MolmoWeb-4B" \ --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": "ravilution/MolmoWeb-4B", "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 ravilution/MolmoWeb-4B with Docker Model Runner:
docker model run hf.co/ravilution/MolmoWeb-4B
| license: apache-2.0 | |
| base_model: | |
| - allenai/MolmoWeb-4B | |
| language: | |
| - en | |
| pipeline_tag: image-text-to-text | |
| library_name: transformers | |
| tags: | |
| - multimodal | |
| - molmo | |
| - molmo2 | |
| - web-agent | |
| - full-precision | |
| - vllm-compatible | |
| # ravilution/MolmoWeb-4B | |
| This is a **full-precision** Hugging Face– and **vLLM-compatible** release of [`allenai/MolmoWeb-4B`](https://huggingface.co/allenai/MolmoWeb-4B), a vision-based web agent model by Ai2 capable of navigating and interacting with web browsers. | |
| It follows the same idea as [`ravilution/MolmoWeb-8B-8bit-mlx`](https://huggingface.co/ravilution/MolmoWeb-8B-8bit-mlx): a personal Hub copy with a clear description and practical loading notes—here for the **4B** dense checkpoint rather than an MLX quantization. | |
| > **Note:** This is a **4B** parameter model (four `safetensors` shards). A few **post-download patches** were applied locally so tokenization and generation metadata match what downstream stacks (including vLLM) expect: `eos_token_id` / `bos_token_id` / `pad_token_id`, `transformers_version` in `config.json` and `generation_config.json`, and the tokenizer pretokenizer regex (Mistral-style `(?i:...)` fix). Patches are **idempotent** if you re-run them on a fresh download. | |
| Refer to the [original model card](https://huggingface.co/allenai/MolmoWeb-4B) for benchmarks, architecture, training data, and intended use. | |
| ## Use with Transformers | |
| ```bash | |
| pip install -U transformers accelerate torch pillow | |
| ``` | |
| ```python | |
| from transformers import AutoProcessor, AutoModelForImageTextToText | |
| import torch | |
| model_id = "ravilution/MolmoWeb-4B" | |
| model = AutoModelForImageTextToText.from_pretrained( | |
| model_id, | |
| trust_remote_code=True, | |
| torch_dtype=torch.float32, | |
| attn_implementation="sdpa", | |
| device_map="auto", | |
| ) | |
| processor = AutoProcessor.from_pretrained( | |
| model_id, | |
| trust_remote_code=True, | |
| padding_side="left", | |
| ) | |
| ``` | |
| ## Provenance | |
| - **Upstream weights:** `allenai/MolmoWeb-4B` | |
| - **Changes on top:** compatibility patches only (config / generation_config / tokenizer metadata as above); **no** retraining or architectural edits. | |
| ## License | |
| Apache 2.0 — see the [original model](https://huggingface.co/allenai/MolmoWeb-4B) for details. Please review Ai2’s Responsible Use Guidelines for intended use. | |