Image-Text-to-Text
Transformers
Safetensors
English
molmo2
multimodal
olmo
molmo
conversational
custom_code
Instructions to use sunjuice/Molmo2-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sunjuice/Molmo2-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="sunjuice/Molmo2-8B", 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("sunjuice/Molmo2-8B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use sunjuice/Molmo2-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sunjuice/Molmo2-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sunjuice/Molmo2-8B", "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/sunjuice/Molmo2-8B
- SGLang
How to use sunjuice/Molmo2-8B 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 "sunjuice/Molmo2-8B" \ --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": "sunjuice/Molmo2-8B", "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 "sunjuice/Molmo2-8B" \ --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": "sunjuice/Molmo2-8B", "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 sunjuice/Molmo2-8B with Docker Model Runner:
docker model run hf.co/sunjuice/Molmo2-8B
| { | |
| "adapter_config": { | |
| "attention_dropout": 0.0, | |
| "attn_implementation": "sdpa", | |
| "float32_attention": true, | |
| "head_dim": 72, | |
| "hidden_act": "silu", | |
| "hidden_size": 1152, | |
| "image_feature_dropout": 0.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 12288, | |
| "model_type": "molmo2", | |
| "num_attention_heads": 16, | |
| "num_key_value_heads": 16, | |
| "pooling_attention_mask": true, | |
| "residual_dropout": 0.0, | |
| "text_hidden_size": 4096, | |
| "vit_layers": [ | |
| -3, | |
| -9 | |
| ] | |
| }, | |
| "architectures": [ | |
| "Molmo2ForConditionalGeneration" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_molmo2.Molmo2Config", | |
| "AutoModelForImageTextToText": "modeling_molmo2.Molmo2ForConditionalGeneration" | |
| }, | |
| "dtype": "float32", | |
| "frame_end_token_id": 151944, | |
| "frame_start_token_id": 151943, | |
| "image_col_id": 151939, | |
| "image_end_token_id": 151937, | |
| "image_high_res_id": 151938, | |
| "image_low_res_id": 151942, | |
| "image_patch_id": 151938, | |
| "image_start_token_id": 151936, | |
| "initializer_range": 0.02, | |
| "low_res_image_start_token_id": 151940, | |
| "model_type": "molmo2", | |
| "text_config": { | |
| "additional_vocab_size": 128, | |
| "attention_dropout": 0.0, | |
| "attn_implementation": "sdpa", | |
| "embedding_dropout": 0.0, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 4096, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 12288, | |
| "layer_norm_eps": 1e-06, | |
| "max_position_embeddings": 36864, | |
| "model_type": "molmo2_text", | |
| "norm_after": false, | |
| "num_attention_heads": 32, | |
| "num_hidden_layers": 36, | |
| "num_key_value_heads": 8, | |
| "qk_norm_type": "qwen3", | |
| "qkv_bias": false, | |
| "residual_dropout": 0.0, | |
| "rope_scaling": null, | |
| "rope_scaling_layers": null, | |
| "rope_theta": 1000000.0, | |
| "use_cache": true, | |
| "use_qk_norm": true, | |
| "vocab_size": 151936 | |
| }, | |
| "tie_word_embeddings": false, | |
| "transformers_version": "4.57.1", | |
| "use_cache": true, | |
| "use_frame_special_tokens": false, | |
| "vit_config": { | |
| "attention_dropout": 0.0, | |
| "attn_implementation": "sdpa", | |
| "float32_attention": true, | |
| "head_dim": 72, | |
| "hidden_act": "gelu_pytorch_tanh", | |
| "hidden_size": 1152, | |
| "image_default_input_size": [ | |
| 378, | |
| 378 | |
| ], | |
| "image_num_pos": 729, | |
| "image_patch_size": 14, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 4304, | |
| "layer_norm_eps": 1e-06, | |
| "model_type": "molmo2", | |
| "num_attention_heads": 16, | |
| "num_hidden_layers": 27, | |
| "num_key_value_heads": 16, | |
| "residual_dropout": 0.0 | |
| } | |
| } | |