Kenshiii/minimax-m3-reasoning-traces
Preview • Updated • 54
How to use thealper2/qwen3-0.6b-reasoning-sft with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="thealper2/qwen3-0.6b-reasoning-sft")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("thealper2/qwen3-0.6b-reasoning-sft")
model = AutoModelForCausalLM.from_pretrained("thealper2/qwen3-0.6b-reasoning-sft", 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]:]))How to use thealper2/qwen3-0.6b-reasoning-sft with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "thealper2/qwen3-0.6b-reasoning-sft"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "thealper2/qwen3-0.6b-reasoning-sft",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/thealper2/qwen3-0.6b-reasoning-sft
How to use thealper2/qwen3-0.6b-reasoning-sft with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "thealper2/qwen3-0.6b-reasoning-sft" \
--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": "thealper2/qwen3-0.6b-reasoning-sft",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "thealper2/qwen3-0.6b-reasoning-sft" \
--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": "thealper2/qwen3-0.6b-reasoning-sft",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use thealper2/qwen3-0.6b-reasoning-sft with Docker Model Runner:
docker model run hf.co/thealper2/qwen3-0.6b-reasoning-sft
Full-parameter supervised fine-tune of Qwen/Qwen3-0.6B on Kenshiii/minimax-m3-reasoning-traces (data/chat.jsonl).
| Base model | Qwen/Qwen3-0.6B @ c1899de289a04d12100db370d81485cdf75e47ca |
| Method | Full fine-tuning (TRL SFTTrainer) |
| Parameters | 596,049,920 total, 596,049,920 trained |
| Precision | fp32 master weights, bfloat16 autocast |
| Training sequence length | 2048 tokens |
| Chat template | Qwen3 template, unchanged |
| Reasoning format | Qwen3 native <think>…</think> block, followed by the final answer |
Kenshiii/minimax-m3-reasoning-traces @ 157ed14aecdb6e0fa0a09ea5981b45048cca2f3d, file data/chat.jsonl (single file; the other files in the repo are re-formattings of the same traces).system + user → assistant turn with the dataset's <thinking> trace mapped to Qwen3's reasoning_content (rendered as <think>), then the final answer. Loss on assistant tokens only.| Hyperparameter | Value |
|---|---|
| Epochs (max) | 3 |
| Learning rate | 2e-05 |
| LR scheduler | cosine, warmup ratio 0.05 |
| Weight decay | 0.01 |
| Max grad norm | 1.0 |
| Effective batch size | 16 (1 × 16 accumulation) |
| Optimizer | adamw_torch_fused |
| Gradient checkpointing | True |
| Checkpoint selection | lowest validation loss |
| Early stopping patience | 3 evaluations (every 10 steps) |
| Seed | 42 |
checkpoint-40); final logged train loss: 0.8242.from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "thealper2/qwen3-0.6b-reasoning-sft"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto")
messages = [
{"role": "system", "content": "You are a careful, step-by-step reasoner. For each problem, think through it methodically, then give a final answer."},
{"role": "user", "content": "Solve x^2 - 7x + 12 = 0 and verify both roots."},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=2048)
print(tokenizer.decode(output[0, inputs.input_ids.shape[1]:], skip_special_tokens=True))
The model writes its trace inside <think>…</think> and the final answer after </think>. It was trained with the system prompt shown above.