Image-Text-to-Text
Transformers
Safetensors
qwen3_5
vllm
llm-compressor
compressed-tensors
int4
conversational
Instructions to use RedHatAI/Qwen3.8-27B-INT4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/Qwen3.8-27B-INT4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="RedHatAI/Qwen3.8-27B-INT4") 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("RedHatAI/Qwen3.8-27B-INT4") model = AutoModelForMultimodalLM.from_pretrained("RedHatAI/Qwen3.8-27B-INT4", 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 RedHatAI/Qwen3.8-27B-INT4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/Qwen3.8-27B-INT4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/Qwen3.8-27B-INT4", "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/RedHatAI/Qwen3.8-27B-INT4
- SGLang
How to use RedHatAI/Qwen3.8-27B-INT4 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 "RedHatAI/Qwen3.8-27B-INT4" \ --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": "RedHatAI/Qwen3.8-27B-INT4", "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 "RedHatAI/Qwen3.8-27B-INT4" \ --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": "RedHatAI/Qwen3.8-27B-INT4", "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 RedHatAI/Qwen3.8-27B-INT4 with Docker Model Runner:
docker model run hf.co/RedHatAI/Qwen3.8-27B-INT4
Friggin AWESOME quant of a GREAT model.
#2
by Bellesteck - opened
Running this in Docker Compose, I'm getting great results on my 5090:
services:
vllm-agents-a1-nvfp4:
image: vllm/vllm-openai:v0.23.0
container_name: vllm-qwen3-6-nvfp4
ports:
- "8007:8000"
environment:
- CUDA_VISIBLE_DEVICES=0
- HF_TOKEN=${HF_TOKEN}
- VLLM_USE_FLASHINFER_SAMPLER=0
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
entrypoint: ["/bin/bash", "-c"]
command:
- |
/usr/bin/python3 /opt/vllm-patches/patch_anthropic_system.py
exec vllm serve RedHatAI/Qwen3.8-27B-INT4 \
--host 0.0.0.0 \
--port 8000 \
--served-model-name mars \
--kv-cache-dtype fp8_e4m3 \
--mamba-cache-dtype float32 \
--gpu-memory-utilization 0.925 \
--max-model-len 262144 \
--max-num-seqs 4 \
--max-num-batched-tokens 8192 \
--language-model-only \
--reasoning-parser qwen3 \
--tool-call-parser qwen3_coder \
--enable-auto-tool-choice \
--mamba-cache-mode align \
--kv-offloading-backend native \
--kv-offloading-size 48 \
--enable-prefix-caching \
--trust-remote-code
restart: unless-stopped
shm_size: '8gb'
ulimits:
memlock: -1
stack: 67108864
ipc: host
volumes:
- ~/.cache/huggingface:/root/.cache/huggingface
- ./patch_anthropic_system.py:/opt/vllm-patches/patch_anthropic_system.py:ro
Getting 130-220t/s decode and 12kt/s prefill - plus the external prefix cache buys about 1s reload time for a RAM offloaded session.
I'm very happy with this.
Awesome, thank you for sharing!