Instructions to use inference-optimization/Qwen3-VL-1.0B-A0.8B-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inference-optimization/Qwen3-VL-1.0B-A0.8B-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="inference-optimization/Qwen3-VL-1.0B-A0.8B-small") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("inference-optimization/Qwen3-VL-1.0B-A0.8B-small") model = AutoModelForMultimodalLM.from_pretrained("inference-optimization/Qwen3-VL-1.0B-A0.8B-small", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inference-optimization/Qwen3-VL-1.0B-A0.8B-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inference-optimization/Qwen3-VL-1.0B-A0.8B-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inference-optimization/Qwen3-VL-1.0B-A0.8B-small", "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/inference-optimization/Qwen3-VL-1.0B-A0.8B-small
- SGLang
How to use inference-optimization/Qwen3-VL-1.0B-A0.8B-small 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 "inference-optimization/Qwen3-VL-1.0B-A0.8B-small" \ --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": "inference-optimization/Qwen3-VL-1.0B-A0.8B-small", "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 "inference-optimization/Qwen3-VL-1.0B-A0.8B-small" \ --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": "inference-optimization/Qwen3-VL-1.0B-A0.8B-small", "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 inference-optimization/Qwen3-VL-1.0B-A0.8B-small with Docker Model Runner:
docker model run hf.co/inference-optimization/Qwen3-VL-1.0B-A0.8B-small
Qwen3-VL-1.0B-A0.8B-small
This is a small version of Qwen/Qwen3-VL-30B-A3B-Instruct created for testing and development. It keeps every hyperparameter of the base model identical (text/vision hidden sizes, head counts, MoE topology, vocabulary, untied embeddings, mrope settings, vision patching) and only reduces the number of text decoder layers, the vision tower depth, the deepstack injection list, and the number of experts per MoE layer.
Model Details
- Base Model: Qwen/Qwen3-VL-30B-A3B-Instruct
- Architecture: Qwen3VLMoeForConditionalGeneration (
qwen3_vl_moe) - Total Parameters: 0.98B
- Activated Parameters: 0.85B (topk 8 of 10 routed experts per layer, text-path per-token accounting; vision tower excluded, matching the base's A-numbering convention)
Configuration Changes
Only the allowed change classes were applied; everything else is identical to the base:
| Parameter | Base | Small |
|---|---|---|
text_config.num_hidden_layers |
48 | 4 |
text_config.num_local_experts |
128 | 10 |
vision_config.depth |
27 | 2 |
vision_config.deepstack_visual_indexes |
[8, 16, 24] |
[1] |
All 48 base text layers are MoE with full attention (decoder_sparse_step 1, mlp_only_layers []), so the 4 small layers are uniform MoE layers โ the single layer type of the base. 10 experts = topk (8) + 2 so that routing is actually exercised; num_experts_per_tok (topk 8) is unchanged. The vision tower keeps its hidden size 1152 / out 2048 / patch 16 / spatial merge 2 / axial rope / 2304 position embeddings; only its depth is reduced, and the deepstack per-layer injection list is trimmed consistently from [8, 16, 24] (3 mergers) to [1] (1 merger) so the deepstack injection mechanism stays exercised (injects into text layer 0). All other values are kept from the base, including hidden_size 2048, moe_intermediate_size 768, 32 attention heads / 4 KV heads (head_dim 128, q/k norms), vocab_size 151936, untied embeddings (top-level tie_word_embeddings: false), mrope section [24,20,20] with theta 5e6, image_token_id/video_token_id/vision start/end token ids.
Checkpoint Structure
Single-file bf16 model.safetensors (86 tensors) using the original base checkpoint layout: model.language_model.* text tower with stacked expert tensors mlp.experts.gate_up_proj [num_experts, hidden, 2*moe_intermediate] and mlp.experts.down_proj [num_experts, moe_intermediate, hidden] (the base's transposed stacked layout, verified against the base shard headers), model.visual.* vision tower (blocks.*, merger, deepstack_merger_list.0, patch_embed, pos_embed), and untied lm_head.weight. Tensor-name patterns match the base model.safetensors.index.json exactly, modulo layer/expert/merger counts (validated programmatically: 0 extra patterns; the only missing patterns are deepstack_merger_list.{1,2}.* from the intentional 3 -> 1 merger trim; all checked shapes are identical to the base modulo the expert-count first dimension). The checkpoint loads through AutoModelForImageTextToText.from_pretrained with the same weight-conversion path as the base repo (Transpose(1,2) on the stacked experts), and the conversion round-trips exactly.
Usage
from transformers import AutoModelForImageTextToText, AutoProcessor
model = AutoModelForImageTextToText.from_pretrained("inference-optimization/Qwen3-VL-1.0B-A0.8B-small", device_map="auto")
processor = AutoProcessor.from_pretrained("inference-optimization/Qwen3-VL-1.0B-A0.8B-small")
inputs = processor("According to all known laws", return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=20)
print(processor.tokenizer.decode(output[0]))
# multimodal
from PIL import Image
inputs = processor(text="<|vision_start|><|image_pad|><|vision_end|>Describe this image.", images=[Image.open("image.jpg")], return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=20)
print(processor.tokenizer.decode(output[0]))
Creation Process
This model was created using the llm-compressor create-tiny-model skill:
- Loaded the base
AutoConfigand applied only the allowed changes (4 text layers, 10 experts, vision depth 2, deepstack indexes [1]). - Built the model with
skip_weights_downloadonAutoModelForImageTextToText, re-initialized weights (init_weights()+ NaN fixup), cast to bf16, and saved. - Converted the saved stacked-expert tensors to the base's transposed layout (
[E, H, 2I]/[E, I, H]) since transformers 5.17's save path emits the module layout for this architecture (its reverse conversion is a checked no-op); verified names + shapes against the base index/shard headers. - Fine-tuned on the skill's copypasta dataset (text-only, multimodal class) in bf16 (lr 5e-5, batch 2, early-stopped after ~190 steps / 10s) to target perplexity.
- Re-converted the fine-tuned checkpoint to the base layout and validated structure, perplexity, generation, and a multimodal image forward.
Validation
- Perplexity on the skill's validation text: 1.0017 (target <= 10)
- Greedy generation from "According to all known laws": produces the trained copypasta continuation correctly.
- Multimodal forward (image + text through the processor, deepstack injection active): finite logits.
Notes
- The base model has untied embeddings (top-level
tie_word_embeddings: false, separatelm_head.weightin the checkpoint; thetext_config.tie_word_embeddings: trueonly concerns the inner text model which has no LM head), so the embedding matrices account for 2 x 0.31B parameters. Total is 0.98B, within the expected ~0.9-1.1B range. - No
quantization_configin the base; nothing stripped. bf16 throughout. training_args.binand optimizer files are not part of the upload.
- Downloads last month
- 38
Model tree for inference-optimization/Qwen3-VL-1.0B-A0.8B-small
Base model
Qwen/Qwen3-VL-30B-A3B-Instruct