Image-Text-to-Text
Transformers
Safetensors
qwen3_5
thinking_modes
qwen3.5
grape
vision
multimodal
instruct
chat
coding
math
science
reasoning
creative_writing
roleplay
conversational
Instructions to use SL-AI/GRaPE-2.5-Helios with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SL-AI/GRaPE-2.5-Helios with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SL-AI/GRaPE-2.5-Helios") 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, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("SL-AI/GRaPE-2.5-Helios") model = AutoModelForMultimodalLM.from_pretrained("SL-AI/GRaPE-2.5-Helios", device_map="auto") 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 SL-AI/GRaPE-2.5-Helios with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SL-AI/GRaPE-2.5-Helios" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SL-AI/GRaPE-2.5-Helios", "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/SL-AI/GRaPE-2.5-Helios
- SGLang
How to use SL-AI/GRaPE-2.5-Helios 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 "SL-AI/GRaPE-2.5-Helios" \ --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": "SL-AI/GRaPE-2.5-Helios", "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 "SL-AI/GRaPE-2.5-Helios" \ --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": "SL-AI/GRaPE-2.5-Helios", "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 SL-AI/GRaPE-2.5-Helios with Docker Model Runner:
docker model run hf.co/SL-AI/GRaPE-2.5-Helios
| {%- set image_count = namespace(value=0) %} | |
| {%- set video_count = namespace(value=0) %} | |
| {%- set add_vision_id = add_vision_id if add_vision_id is defined else false %} | |
| {%- set enable_thinking = enable_thinking if enable_thinking is defined else true %} | |
| {%- set _preserve_thinking = preserve_thinking if preserve_thinking is defined else true %} | |
| {%- set ns_state = namespace(thinking=enable_thinking) %} | |
| {%- macro render_content(content, do_vision_count, is_system_content=false) %} | |
| {%- if content is string %} | |
| {{- content }} | |
| {%- elif content is iterable and content is not mapping %} | |
| {%- for item in content %} | |
| {%- if item is mapping %} | |
| {%- if item.type == 'image' or 'image' in item or 'image_url' in item %} | |
| {%- if is_system_content %} | |
| {{- raise_exception('System message cannot contain images.') }} | |
| {%- endif %} | |
| {%- if do_vision_count %} | |
| {%- set image_count.value = image_count.value + 1 %} | |
| {%- endif %} | |
| {%- if add_vision_id %} | |
| {{- 'Picture ' ~ image_count.value ~ ': ' }} | |
| {%- endif %} | |
| {{- '<|vision_start|><|image_pad|><|vision_end|>' }} | |
| {%- elif item.type == 'video' or 'video' in item %} | |
| {%- if is_system_content %} | |
| {{- raise_exception('System message cannot contain videos.') }} | |
| {%- endif %} | |
| {%- if do_vision_count %} | |
| {%- set video_count.value = video_count.value + 1 %} | |
| {%- endif %} | |
| {%- if add_vision_id %} | |
| {{- 'Video ' ~ video_count.value ~ ': ' }} | |
| {%- endif %} | |
| {{- '<|vision_start|><|video_pad|><|vision_end|>' }} | |
| {%- elif 'text' in item %} | |
| {{- item.text }} | |
| {%- else %} | |
| {{- raise_exception('Unexpected item type in content.') }} | |
| {%- endif %} | |
| {%- else %} | |
| {{- item | string }} | |
| {%- endif %} | |
| {%- endfor %} | |
| {%- elif content is none or content is undefined %} | |
| {{- '' }} | |
| {%- else %} | |
| {{- raise_exception('Unexpected content type.') }} | |
| {%- endif %} | |
| {%- endmacro %} | |
| {%- if not messages %} | |
| {{- raise_exception('No messages provided.') }} | |
| {%- endif %} | |
| {%- set _first_role = messages[0].role %} | |
| {%- if _first_role == 'system' or _first_role == 'developer' %} | |
| {%- set _sys_msg = messages[0] %} | |
| {%- set _msgs = messages[1:] %} | |
| {%- else %} | |
| {%- set _sys_msg = none %} | |
| {%- set _msgs = messages %} | |
| {%- endif %} | |
| {%- set _sc = '' %} | |
| {%- if _sys_msg is not none %} | |
| {%- set _sc = render_content(_sys_msg.content, false, true) | trim %} | |
| {%- endif %} | |
| {%- if _sc %} | |
| {{- '<|im_start|>system\n' + _sc + '<|im_end|>\n' }} | |
| {%- endif %} | |
| {%- set _last_idx = _msgs | length - 1 %} | |
| {%- set ns = namespace(last_query_index=_last_idx) %} | |
| {%- for message in _msgs[::-1] %} | |
| {%- set index = (_msgs | length - 1) - loop.index0 %} | |
| {%- if message.role == 'user' %} | |
| {%- set ns.last_query_index = index %} | |
| {%- break %} | |
| {%- endif %} | |
| {%- endfor %} | |
| {%- for message in _msgs %} | |
| {%- set is_system = (message.role == "system" or message.role == "developer") %} | |
| {%- set content = render_content(message.content, true, is_system) | trim %} | |
| {%- if is_system or message.role == 'user' %} | |
| {%- if '<|think_off|>' in content %} | |
| {%- set ns_state.thinking = false %} | |
| {%- set content = content.split('<|think_off|>') | join('') | trim %} | |
| {%- elif '<|think_on|>' in content %} | |
| {%- set ns_state.thinking = true %} | |
| {%- set content = content.split('<|think_on|>') | join('') | trim %} | |
| {%- endif %} | |
| {%- endif %} | |
| {%- if is_system %} | |
| {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }} | |
| {%- elif message.role == 'user' %} | |
| {{- '<|im_start|>user\n' + content + '<|im_end|>\n' }} | |
| {%- elif message.role == 'assistant' %} | |
| {%- set reasoning_content = '' %} | |
| {%- if message.reasoning_content is defined and message.reasoning_content is not none %} | |
| {%- if message.reasoning_content is string %} | |
| {%- set reasoning_content = message.reasoning_content %} | |
| {%- else %} | |
| {%- set reasoning_content = message.reasoning_content | string %} | |
| {%- endif %} | |
| {%- elif message.thinking is defined and message.thinking is not none %} | |
| {%- if message.thinking is string %} | |
| {%- set reasoning_content = message.thinking %} | |
| {%- else %} | |
| {%- set reasoning_content = message.thinking | string %} | |
| {%- endif %} | |
| {%- else %} | |
| {%- set _think_end = '' %} | |
| {%- if content.startswith('</think>') %} | |
| {%- set _think_end = '</think>' %} | |
| {%- elif content.startswith('</thinking>') %} | |
| {%- set _think_end = '</thinking>' %} | |
| {%- elif '\n</think>' in content %} | |
| {%- set _think_end = '\n</think>' %} | |
| {%- elif '\n</thinking>' in content %} | |
| {%- set _think_end = '\n</thinking>' %} | |
| {%- elif '\n</ think>' in content %} | |
| {%- set _think_end = '\n</ think>' %} | |
| {%- elif '\n</think >' in content %} | |
| {%- set _think_end = '\n</think >' %} | |
| {%- endif %} | |
| {%- if _think_end %} | |
| {%- if 'thinking' in _think_end %} | |
| {%- set _think_start = '<thinking>' %} | |
| {%- else %} | |
| {%- set _think_start = '<think>' %} | |
| {%- endif %} | |
| {%- set reasoning_content = content.split(_think_end)[0].rstrip('\n') %} | |
| {%- if _think_start in reasoning_content %} | |
| {%- set reasoning_content = reasoning_content.split(_think_start)[-1].lstrip('\n') %} | |
| {%- endif %} | |
| {%- set content = content.split(_think_end)[-1].lstrip('\n') %} | |
| {%- endif %} | |
| {%- endif %} | |
| {%- set reasoning_content = reasoning_content | trim %} | |
| {%- if (_preserve_thinking or loop.index0 > ns.last_query_index) and reasoning_content %} | |
| {{- '<|im_start|>assistant\n<think>\n' + reasoning_content + '\n</think>\n\n' + content + '<|im_end|>\n' }} | |
| {%- else %} | |
| {{- '<|im_start|>assistant\n' + content + '<|im_end|>\n' }} | |
| {%- endif %} | |
| {%- else %} | |
| {{- '<|im_start|>user\n[' + message.role + ']: ' + content + '<|im_end|>\n' }} | |
| {%- endif %} | |
| {%- endfor %} | |
| {%- if add_generation_prompt %} | |
| {{- '<|im_start|>assistant\n' }} | |
| {%- endif %} | |