Instructions to use jackcai1206/qwen3-4b-longcot-sft-vanilla with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jackcai1206/qwen3-4b-longcot-sft-vanilla with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jackcai1206/qwen3-4b-longcot-sft-vanilla") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jackcai1206/qwen3-4b-longcot-sft-vanilla") model = AutoModelForCausalLM.from_pretrained("jackcai1206/qwen3-4b-longcot-sft-vanilla", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jackcai1206/qwen3-4b-longcot-sft-vanilla with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jackcai1206/qwen3-4b-longcot-sft-vanilla" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jackcai1206/qwen3-4b-longcot-sft-vanilla", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jackcai1206/qwen3-4b-longcot-sft-vanilla
- SGLang
How to use jackcai1206/qwen3-4b-longcot-sft-vanilla 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 "jackcai1206/qwen3-4b-longcot-sft-vanilla" \ --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": "jackcai1206/qwen3-4b-longcot-sft-vanilla", "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 "jackcai1206/qwen3-4b-longcot-sft-vanilla" \ --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": "jackcai1206/qwen3-4b-longcot-sft-vanilla", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jackcai1206/qwen3-4b-longcot-sft-vanilla with Docker Model Runner:
docker model run hf.co/jackcai1206/qwen3-4b-longcot-sft-vanilla
Qwen3-4B long-CoT SFT
A vanilla supervised fine-tune of Qwen/Qwen3-4B-Base on long chain-of-thought math data.
No architectural changes โ a standard Qwen3 model, loadable with from_pretrained.
We release it as a full-context reference baseline: a plain SFT of this base model at this data scale, useful as a control to measure other fine-tunes against, and as a frozen teacher for distillation.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
REPO = "jackcai1206/qwen3-4b-longcot-sft-vanilla"
model = AutoModelForCausalLM.from_pretrained(REPO, dtype="bfloat16", device_map="auto")
tok = AutoTokenizer.from_pretrained(REPO)
Precision
Training kept fp32 master weights (16.1 GB). Downstream use constructs the model in bf16, so those weights are
truncated to bf16 on load โ this export is bf16 and therefore bit-identical to what training and inference
actually consume, at half the size. Verified tensor by tensor against the fp32 checkpoint. lm_head is tied to
embed_tokens in the source checkpoint (same storage), so it is reconstructed by from_pretrained rather than
stored separately.
Evaluation
MATH-500 (strict): 87.4.
- Downloads last month
- 49
Model tree for jackcai1206/qwen3-4b-longcot-sft-vanilla
Base model
Qwen/Qwen3-4B-Base