Instructions to use Qwen/Qwen2.5-3B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen2.5-3B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Qwen/Qwen2.5-3B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-3B-Instruct") model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/Qwen2.5-3B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen2.5-3B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen2.5-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Qwen/Qwen2.5-3B-Instruct
- SGLang
How to use Qwen/Qwen2.5-3B-Instruct 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 "Qwen/Qwen2.5-3B-Instruct" \ --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": "Qwen/Qwen2.5-3B-Instruct", "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 "Qwen/Qwen2.5-3B-Instruct" \ --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": "Qwen/Qwen2.5-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Qwen/Qwen2.5-3B-Instruct with Docker Model Runner:
docker model run hf.co/Qwen/Qwen2.5-3B-Instruct
X-ray: what actually changed between Qwen2.5-3B base and Instruct (layer map + knowledge probes)
We ran a layer-by-layer functional comparison between Qwen/Qwen2.5-3B and Qwen/Qwen2.5-3B-Instruct, plus a knowledge-delta probe. Sharing the findings here since they might be useful to people working with these checkpoints.
Structure β 80% of the functional difference sits in 14 of 37 stations, concentrated in the last five (stations 32β36, 2.72Γ a uniform spread; 1.41Γ what the probe grid alone would put there). Change is detectable at or before station 4 β that is the instrument's detection floor at this scale, not a finding. In this pair, instruction tuning is a late-concentrated, output-shaping change; early representation is largely preserved.
Knowledge & hallucination probe (corrected scoring, 2026-09-02) β every fact the base model answered correctly survived the fine-tune (19/20 β 20/20, zero broken, one repaired). Known-vs-fabricated separation went 0.9325 β 0.9475 (trajectory AUROC; output-only 0.8950 β 0.9475) β inside the interval at 20-vs-20, so: unchanged to slightly stronger. The model echoes fabricated names less often (13/20 β 18/20, paired 6 improved / 1 regressed, exact p = 0.125), but genuine refusals only went 0 β 2 β most of that shift is echo β confident fabrication, so we do not call it a hallucination win.
Full interactive reports (no login needed):
- structure: https://www.tetracta.ai/llm_tomografi/r/a048cc12934d488aa415d0ee0c1abeca/eGWvi64CrsRQAwFirfqmVg
- knowledge: https://www.tetracta.ai/llm_tomografi/r/d0a0a6ea76f04b59b35307313b7e1cf0/WHH9qVypf4j0Fd6XPjP7Yw
(The scans come from Model X-Ray, our checkpoint-inspection tool β currently in free open beta: https://www.tetracta.ai/xray.html)
Curious what others see in their own fine-tunes of these models β if you scan a checkpoint and find something interesting, we'd love to hear about it.
Correction (2026-09-02): an external review led us to re-audit this scan. The structure numbers above replace an earlier 'starts at layer 4, spreads across 33 of 37 (~89%)' reading (a function of the detection floor); the knowledge numbers replace 0.915 β 0.878 and '18/20 β 18/20', which came from two scoring bugs in the probe (space sub-token as answer target; double final-norm). Raw per-item data and both reports: https://huggingface.co/spaces/tetracta/model-xray-sample-reports
Correction β 6 September 2026
We withdraw both the structural and knowledge conclusions in the opening post. The legacy evidence does not support the published onset, spread, concentration, location, AUROC, internal-readout, factual-change or fabrication-separation interpretations. Any portrait-visualization, lesion-response or legacy simulated-quantization finding linked from the opening post is also withdrawn.
The linked reports are historical and must not be used as current evidence. We are publishing no replacement figures. Validation remains pending. Correction record: https://www.tetracta.ai/model-xray/correction/
β Tetracta