Instructions to use BryanADA/Qwen2.5-3B-cot-zh-tw with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BryanADA/Qwen2.5-3B-cot-zh-tw with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BryanADA/Qwen2.5-3B-cot-zh-tw") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BryanADA/Qwen2.5-3B-cot-zh-tw", dtype="auto") - llama-cpp-python
How to use BryanADA/Qwen2.5-3B-cot-zh-tw with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="BryanADA/Qwen2.5-3B-cot-zh-tw", filename="Qwen2.5-3B-cot-zh-tw.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use BryanADA/Qwen2.5-3B-cot-zh-tw with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M # Run inference directly in the terminal: llama-cli -hf BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M # Run inference directly in the terminal: llama-cli -hf BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
Use Docker
docker model run hf.co/BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use BryanADA/Qwen2.5-3B-cot-zh-tw with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BryanADA/Qwen2.5-3B-cot-zh-tw" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BryanADA/Qwen2.5-3B-cot-zh-tw", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
- SGLang
How to use BryanADA/Qwen2.5-3B-cot-zh-tw 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 "BryanADA/Qwen2.5-3B-cot-zh-tw" \ --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": "BryanADA/Qwen2.5-3B-cot-zh-tw", "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 "BryanADA/Qwen2.5-3B-cot-zh-tw" \ --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": "BryanADA/Qwen2.5-3B-cot-zh-tw", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use BryanADA/Qwen2.5-3B-cot-zh-tw with Ollama:
ollama run hf.co/BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
- Unsloth Studio
How to use BryanADA/Qwen2.5-3B-cot-zh-tw with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for BryanADA/Qwen2.5-3B-cot-zh-tw to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for BryanADA/Qwen2.5-3B-cot-zh-tw to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for BryanADA/Qwen2.5-3B-cot-zh-tw to start chatting
- Pi
How to use BryanADA/Qwen2.5-3B-cot-zh-tw with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use BryanADA/Qwen2.5-3B-cot-zh-tw with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use BryanADA/Qwen2.5-3B-cot-zh-tw with Docker Model Runner:
docker model run hf.co/BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
- Lemonade
How to use BryanADA/Qwen2.5-3B-cot-zh-tw with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull BryanADA/Qwen2.5-3B-cot-zh-tw:Q4_K_M
Run and chat with the model
lemonade run user.Qwen2.5-3B-cot-zh-tw-Q4_K_M
List all available models
lemonade list
Qwen-2.5-3B-cot-zh-tw (GRPO)
模型簡介 | Model Overview
本模型基於 Qwen-2.5-3B-Instruct,專為繁體中文數學/邏輯推理場景設計,不是單純仿製長鏈推理,而是經由創新 RLHF 訓練流程,讓模型自發產生類似「aha moment」的推理能力。
訓練流程為:
以少量高品質多步推理 SFT 數據冷啟動模型
接著採用 GRPO 策略與自設獎勵函數,在「問題—答案」數據集下強化模型「自發推理」與「步驟合理性」,不依賴 PPO 或大規模 SFT
推理長度經本地測試優化,步驟數落在最佳甜蜜點,適合部署於一般 GPU/邊緣裝置
This model is based on Qwen-2.5-3B-Instruct and optimized for step-by-step reasoning in Traditional Chinese math and logic tasks. Instead of standard CoT SFT or PPO, we use a minimal SFT “cold start” with high-quality reasoning samples, then apply GRPO with a custom reward function to let the model discover its own “aha moments” and multi-step reasoning chains—all while controlling output length for efficient local deployment.
訓練動機 | Motivation
這個專案純粹出於個人興趣與繁體中文圈的實際需求而開發,旨在讓本地端能有更好用的推理模型。 我希望能為繁體中文圈貢獻可以本地部署的推理模型,讓模型在繁中語境下,也能自發產生多步驟、具備頓悟感(aha moment)的解題過程。 整體訓練過程強調實驗精神與實用導向:只用少量優質 SFT 冷啟動,再透過 GRPO 與自定獎勵函數,讓模型自己學會思考與拆解問題,追求可實際落地的推理效果。
This project was developed purely out of personal interest and the practical needs of the Traditional Chinese-speaking community, with the goal of creating a more effective locally deployable reasoning model. I hope to contribute a model that enables multi-step, “aha moment” reasoning in the Traditional Chinese context—one that can be run efficiently on local hardware. The entire training process emphasizes both experimentation and real-world usability: starting with a small amount of high-quality SFT for cold start, then leveraging GRPO and custom reward functions to encourage the model to learn reasoning and problem decomposition on its own, with a focus on truly applicable step-by-step solutions.
模型特性 | Key Features
Aha Moment 自發推理:非模板複製,而是訓練模型「自己發現推理步驟」
步驟最佳化:推理長度經本地實測,控制在「解題效率」與「可讀性」甜蜜點
繁體中文強化:涵蓋台灣、港澳常用語境,數學、邏輯均表現穩定
適用本地端部署:硬體需求親民,適合一般 4GB GPU,步驟控制精簡,不會無限發散
Self-generated Reasoning: Not pattern imitation—model “discovers” solution steps
Optimized Step Count: Output length tuned for real-world efficiency and readability
Traditional Chinese Enhanced: Robust for Taiwan/HK/Macau context and math/logic QA
Local Deployment Friendly: Runs on standard consumer GPUs, with step count sweet spot
訓練細節 | Training Details
基礎模型 / Base:Qwen2.5-3B-Instruct
流程 / Pipeline:少量高品質多步推理 SFT(冷啟動)→ GRPO(自訂獎勵函數,自發推理強化)
數據來源 / Data:DoggiAI/GSM8K_zh_tw + 自建繁體推理 Q&A (From Grok API Distill)
RLHF 核心:獎勵重點放在答案正確率、推理步驟合理性與精簡性,不靠人類標記每步驟
硬體 / Hardware:L4 GPU, 訓練 24 小時
框架 / Framework:Transformers, PEFT, bitsandbytes, Unsloth
使用建議 | Usage Tips
推薦應用:數學解題、邏輯題、逐步問答 適合使用類似:「請自行分步推理,說明每一步的原因。」等提示語 可將 output 步驟數量根據需求進行控制(建議 2~6 步為最佳)
快速上手 | Quickstart
print("Hello, world!")
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("BryanADA/qwen-2.5-3b-cot-zh-tw")
tokenizer = AutoTokenizer.from_pretrained("BryanADA/qwen-2.5-3b-cot-zh-tw")
prompt = "小明有 3 顆蘋果,又拿到 2 顆,一共幾顆?請分步說明推理過程。"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.95,
pad_token_id=tokenizer.eos_token_id
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
參考資料 | References
Qwen 官方
Deepseek R1 論文
DoggiAI/GSM8K_zh_tw
RLHF/GRPO 相關文獻
License
本模型採用 Apache-2.0 授權,允許用於研究、學術及商業用途。請遵循授權條款保留原作者版權及免責聲明。
This model is licensed under Apache-2.0, allowing use for research, academic, and commercial purposes. Please comply with the license terms and retain the original copyright and disclaimers.
- Downloads last month
- 8
4-bit