Instructions to use strangeropshf/qwen3-vl-4b-language_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use strangeropshf/qwen3-vl-4b-language_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="strangeropshf/qwen3-vl-4b-language_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("strangeropshf/qwen3-vl-4b-language_model") model = AutoModel.from_pretrained("strangeropshf/qwen3-vl-4b-language_model") messages = [ {"role": "user", "content": "Who are you?"}, ] 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
- vLLM
How to use strangeropshf/qwen3-vl-4b-language_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "strangeropshf/qwen3-vl-4b-language_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "strangeropshf/qwen3-vl-4b-language_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/strangeropshf/qwen3-vl-4b-language_model
- SGLang
How to use strangeropshf/qwen3-vl-4b-language_model 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 "strangeropshf/qwen3-vl-4b-language_model" \ --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": "strangeropshf/qwen3-vl-4b-language_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "strangeropshf/qwen3-vl-4b-language_model" \ --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": "strangeropshf/qwen3-vl-4b-language_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use strangeropshf/qwen3-vl-4b-language_model with Docker Model Runner:
docker model run hf.co/strangeropshf/qwen3-vl-4b-language_model
This is the text-only decoder component of the Qwen3-VL-4B-Instruct model. For more details, please visit the original model page or refer to the Qwen-VL technical reports published by Qwen.
Qwen3-VL-4B Language Model: The strangeropshf/qwen3-vl-4b-language_model is the extracted text-only decoder component from Qwen3-VL-4B-Instruct, featuring Qwen3's 28-layer transformer architecture with Grouped Query Attention (GQA) for efficient long-context processing up to 128K tokens, delivering near-lossless text understanding comparable to pure LLMs while maintaining seamless fusion compatibility with its DeepStack vision encoder. Optimized for multilingual instruction following across 100+ languages/dialects with strong translation capabilities, it employs interleaved rotary positional embeddings (i-MRoPE) adapted from the VL variant for robust temporal/spatial reasoning even in text-only mode, supporting advanced agentic workflows, visual coding and STEM reasoning tasks.
Quick Start with Transformers
Install the required packages
torch==2.8.0
torchvision
transformers==4.57.6
accelerate
Usage
import torch
from transformers import Qwen3VLForConditionalGeneration, AutoTokenizer
MODEL_PATH = "strangeropshf/qwen3-vl-4b-language_model"
def run_text_only_inference(model_path):
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Using device: {device.upper()}")
print("Loading tokenizer...")
tokenizer = AutoTokenizer.from_pretrained(
model_path,
trust_remote_code=True
)
print("Loading Qwen3-VL language model...")
model = Qwen3VLForConditionalGeneration.from_pretrained(
model_path,
torch_dtype=torch.bfloat16 if device == "cuda" else torch.float32,
device_map="auto",
trust_remote_code=True,
use_safetensors=True
)
model.eval()
print("Model loaded successfully.\n")
prompt = "Explain what multimodal AI is in simple terms."
inputs = tokenizer(
prompt,
return_tensors="pt"
).to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=1024,
temperature=0.7,
do_sample=True,
top_p=0.9
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print("----- Response -----")
print(response)
if __name__ == "__main__":
run_text_only_inference(MODEL_PATH)
- Downloads last month
- 7
Model tree for strangeropshf/qwen3-vl-4b-language_model
Base model
Qwen/Qwen3-VL-4B-Instruct