Text Generation
Transformers
Safetensors
English
qwen3
math
reasoning
long-cot
thinking
sft
distillation
conversational
text-generation-inference
Instructions to use 96kevinli29/Qwen3-4B-R1-Distill with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 96kevinli29/Qwen3-4B-R1-Distill with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="96kevinli29/Qwen3-4B-R1-Distill") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("96kevinli29/Qwen3-4B-R1-Distill") model = AutoModelForCausalLM.from_pretrained("96kevinli29/Qwen3-4B-R1-Distill", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use 96kevinli29/Qwen3-4B-R1-Distill with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "96kevinli29/Qwen3-4B-R1-Distill" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "96kevinli29/Qwen3-4B-R1-Distill", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/96kevinli29/Qwen3-4B-R1-Distill
- SGLang
How to use 96kevinli29/Qwen3-4B-R1-Distill 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 "96kevinli29/Qwen3-4B-R1-Distill" \ --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": "96kevinli29/Qwen3-4B-R1-Distill", "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 "96kevinli29/Qwen3-4B-R1-Distill" \ --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": "96kevinli29/Qwen3-4B-R1-Distill", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use 96kevinli29/Qwen3-4B-R1-Distill with Docker Model Runner:
docker model run hf.co/96kevinli29/Qwen3-4B-R1-Distill
Commit History
Yesterday
-
weights variants/e/intermediate/epoch4_step696
Verified signature86c2289 -
weights variants/e/intermediate/epoch3_step522
Verified signature053ef14 -
weights variants/e/intermediate/epoch2_step348
Verified signaturef764832 -
weights variants/e/intermediate/epoch1_step174
Verified signaturef9bb517 -
weights variants/e
Verified signatureb460be6 -
weights variants/d/intermediate/epoch4_step696
Verified signaturebc64fbc -
weights variants/d/intermediate/epoch3_step522
Verified signature90785be -
weights variants/d/intermediate/epoch2_step348
Verified signature762df17 -
weights variants/d/intermediate/epoch1_step174
Verified signaturef319e80 -
weights variants/d
Verified signaturefc52fa4 -
weights variants/c/intermediate/epoch4_step696
Verified signaturee89ce9a -
weights variants/c/intermediate/epoch3_step522
Verified signature3d583a7 -
weights variants/c/intermediate/epoch2_step348
Verified signatureda0c336 -
weights variants/c/intermediate/epoch1_step174
Verified signature558350d -
weights variants/c
Verified signature923c65a -
weights variants/b/intermediate/epoch4_step696
Verified signatureb26a6f9 -
weights variants/b/intermediate/epoch3_step522
Verified signature99a518c -
weights variants/b/intermediate/epoch2_step348
Verified signature5675ae3 -
weights variants/b/intermediate/epoch1_step174
Verified signature59f5388 -
weights variants/b
Verified signatureedebec8 -
Upload README.md with huggingface_hub
Verified signaturecb568b6 -
weights intermediate/epoch4_step696
Verified signature5a32f15 -
weights intermediate/epoch3_step522
Verified signaturef365148 -
weights intermediate/epoch2_step348
Verified signature71d6eca -
weights intermediate/epoch1_step174
Verified signature1a76029 -
weights final
Verified signaturef2b0e22 -
Upload README.md with huggingface_hub
Verified signature8282da6 -
initial commit
Verified signature8beb8b7