Text Generation
Transformers
Safetensors
qwen3
conversational
Eval Results
text-generation-inference
Instructions to use Qwen/Qwen3-4B-Instruct-2507 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3-4B-Instruct-2507 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Qwen/Qwen3-4B-Instruct-2507") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B-Instruct-2507") model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507") 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
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/Qwen3-4B-Instruct-2507 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen3-4B-Instruct-2507" # 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/Qwen3-4B-Instruct-2507", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Qwen/Qwen3-4B-Instruct-2507
- SGLang
How to use Qwen/Qwen3-4B-Instruct-2507 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/Qwen3-4B-Instruct-2507" \ --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/Qwen3-4B-Instruct-2507", "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/Qwen3-4B-Instruct-2507" \ --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/Qwen3-4B-Instruct-2507", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Qwen/Qwen3-4B-Instruct-2507 with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3-4B-Instruct-2507
Install & run this model easily using llmpm
1
#25 opened 3 months ago
by
sarthak-saxena
Add MMLU-Pro evaluation result
β€οΈ 1
#24 opened 4 months ago
by
burtenshaw
Add GPQA evaluation result
β€οΈ 1
#22 opened 4 months ago
by
burtenshaw
注ζοΌζ€ζ¨‘εδ» ζ―ζιζθ樑εΌοΌδΈδΌε¨ε ΆθΎεΊδΈηζ <think></think> εγ
1
#21 opened 4 months ago
by
Jay-v2
Safety Audit: GAE Score 40.13% (FAIL)
#20 opened 6 months ago
by
GAE-Auditor
Discrepancy in benchmark score (BFCL-v3)
1
#18 opened 7 months ago
by
mmrbulbul
The model doesn't know about itself
2
#17 opened 7 months ago
by
sakazakiMGJ
vRAM needed ?
1
#15 opened 8 months ago
by
Ashish18110
Please support vietnamese more and more in the models.
π 1
#14 opened 8 months ago
by
DuongLeVan
Adding mention of Tinker and TRL support
π₯ 2
#13 opened 8 months ago
by
clem
<tool_call> generated even with no tools or asked for
π 4
6
#12 opened 8 months ago
by
dipta007
Release training token stats
#11 opened 8 months ago
by
jquessada
Remove `<think></think>` blocks from chat template
#10 opened 9 months ago
by
mamousavi
No other 2507 models
π 3
#9 opened 10 months ago
by
SipOfSpike
Sampling parameters to tau2-bench?
#8 opened 10 months ago
by
lewtun
1.7b 2507?
π 7
#7 opened 10 months ago
by
CHNtentes
Why is <think></think> required in history messages?
#4 opened 10 months ago
by
giangndm
Terrible instruction following
π 1
4
#3 opened 10 months ago
by
denisalpino
4b model with an 84.2 MMLU-Redux score?
π€ 3
1
#2 opened 10 months ago
by
phil111
when 32B?
π 8
2
#1 opened 10 months ago
by
AaronFeng753