Virtual Models บน LiteLLM Proxy: 1 โมเดล 10 profiles ใช้ให้เหมาะกับงาน
สารบัญ
- TL;DR
- ตาราง 10 Virtual Profiles
- ทำไมต้องแยกเป็น 10 profiles
- รายละเอียดแต่ละ Profile
qwen-chat-think⭐ Defaultqwen-reasoningqwen-debugqwen-coderqwen-agentqwen-agent-creativeqwen-chatqwen-longctxqwen-miniqwen-trading- หมายเหตุสำหรับ
Qwen3.6-35B-A3B - ทำไมถึงตัด
qwen-reasoning-lowและqwen-agent-thinkออก qwen-reasoningqwen-debugqwen-agent-creative- Profile ที่จะถูกเรียกใช้จริงบ่อยสุด
- Routing คร่าว ๆ
- Conclusion
- References
ผมใช้ Qwen3.6-35B-A3B-NVFP4 เป็น backend model ตัวเดียว แล้วสร้าง Virtual Models ผ่าน LiteLLM Proxy เป็น 10 profiles ตามลักษณะงาน
ทุก profile ชี้ไปที่โมเดลเดียวกัน แต่ override sampling parameters ต่างกัน — ทำให้โมเดลเดียวกันตอบออกมา "คนละคน" ตาม use case
TL;DR
- ใช้
Qwen3.6-35B-A3B-NVFP41 ตัว backend สร้าง 10 profiles ผ่าน LiteLLM Proxy - แต่ละ profile ตั้งค่า
temperature,top_p,presence_penalty,max_tokens,thinkingต่างกันตามงาน qwen-chat-thinkเป็น default ใช้บ่อยสุด 60% รองด้วยqwen-coder15%,qwen-agent10%,qwen-longctx10% และอื่น ๆ 5%- ตัด
qwen-reasoning-lowและqwen-agent-thinkออก เพราะ overlap กันเกินไป แยกเป็นqwen-debugและqwen-agent-creativeที่เห็นความต่างชัดกว่า - Routing ใน Hermes ตั้ง
default_model: qwen-chat-thinkแล้ว override ตาม task
ตาราง 10 Virtual Profiles
| Profile | Top-P | Temperature | Presence Penalty | Max Tokens | Thinking | Special | Use Case |
|---|---|---|---|---|---|---|---|
qwen-chat-think ⭐ Default | 0.95 | 0.6 | 0.0 | 8,192 | on | parallel_tool_calls, preserve_thinking | General Assistant, Web Search, News Summary, Daily Chat, Tool Calling |
qwen-reasoning | 0.95 | 0.7 | 0.2 | 16,384 | on | parallel_tool_calls, preserve_thinking | Architecture Review, Research, Planning, System Design |
qwen-debug | 0.95 | 0.3 | 0.0 | 16,384 | on | parallel_tool_calls, preserve_thinking | Debugging, RCA, Log Analysis, Incident Investigation |
qwen-coder | 0.95 | 0.2 | 0.0 | 8,192 | on | parallel_tool_calls, preserve_thinking | Python, TypeScript, SQL, Docker, MCP, DevOps |
qwen-agent | 0.90 | 0.1 | 0.0 | 8,192 | on | parallel_tool_calls, preserve_thinking | Deterministic Tool Calling, Workflow Execution, Multi-Step Tasks |
qwen-agent-creative | 0.95 | 0.8 | 0.3 | 12,288 | on | parallel_tool_calls, preserve_thinking | Research Agent, Brainstorming Agent, Content Agent |
qwen-chat | 0.95 | 0.8 | 0.2 | 4,096 | off | — | Fast Chatbot, FAQ, Casual Conversation |
qwen-longctx | 0.95 | 0.2 | 0.0 | 16,384 | on | parallel_tool_calls, preserve_thinking | RAG, Codebase Analysis, Documentation, Long Reports |
qwen-mini | 0.2 | 0.1 | 0.0 | 4,096 | off | — | Classification, Extraction, Formatting, Commit Message |
qwen-trading | 1.0 | 0.0 | 0.0 | 4,096 | on* | seed=42 | Market Analysis, Signal Evaluation, Structured Financial Output |
ทำไมต้องแยกเป็น 10 profiles
โมเดลตัวเดียวกัน แต่ sampling ต่างกัน ทำให้พฤติกรรมต่างกันอย่างเห็นได้ชัด
- งานแชททั่วไปต้องการความเป็นธรรมชาติ →
temperatureสูงหน่อย - งาน coding ต้องการความแม่นยำ →
temperatureต่ำ - งาน agent ต้องการ deterministic สูงสุด →
temperatureต่ำมาก +top_pแคบ - งาน creative ต้องการแตกไอเดีย →
temperatureสูง +presence_penaltyมีค่า
การแยก profile ช่วยให้ client เรียกง่าย เปลี่ยน backend ได้ภายหลัง และ debug ชัดเจนเพราะเห็นชื่อ profile ใน log
รายละเอียดแต่ละ Profile
qwen-chat-think ⭐ Default
- Use Case: General Assistant, Web Search, News Summary, Daily Chat, Tool Calling
- เหตุผล: เป็น Primary Model / Router ที่ตัดสินใจว่าจะตอบเองหรือส่งต่อให้ profile อื่น
temperature: 0.6สมดุลระหว่างความเป็นธรรมชาติกับความแม่นยำpresence_penalty: 0.0ป้องกัน JSON ของ tool call พังmax_tokens: 8192เผื่อพื้นที่ thinking + คำตอบ
{
"min_p": 0,
"top_k": 20,
"top_p": 0.95,
"extra_body": {
"chat_template_kwargs": {
"enable_thinking": true,
"preserve_thinking": true
}
},
"guardrails": [],
"max_tokens": 8192,
"temperature": 0.6,
"presence_penalty": 0.0,
"repetition_penalty": 1,
"parallel_tool_calls": true
}
qwen-reasoning
- Use Case: Architecture Review, Research, Planning, System Design
- เหตุผล: เน้นคิดเชิงระบบ วางแผน ออกแบบ วิเคราะห์เชิงกลยุทธ์
{
"min_p": 0,
"top_k": 20,
"top_p": 0.95,
"extra_body": {
"chat_template_kwargs": {
"enable_thinking": true,
"preserve_thinking": true
}
},
"guardrails": [],
"max_tokens": 16384,
"temperature": 0.7,
"presence_penalty": 0.2,
"repetition_penalty": 1,
"parallel_tool_calls": true
}
qwen-debug
- Use Case: Debugging, RCA, Log Analysis, Incident Investigation
- เหตุผล: เน้นหาสาเหตุ ตรวจ log อ่าน stacktrace แก้ bug
{
"min_p": 0,
"top_k": 20,
"top_p": 0.95,
"extra_body": {
"chat_template_kwargs": {
"enable_thinking": true,
"preserve_thinking": true
}
},
"guardrails": [],
"max_tokens": 16384,
"temperature": 0.3,
"presence_penalty": 0.0,
"repetition_penalty": 1,
"parallel_tool_calls": true
}
qwen-coder
- Use Case: Python, TypeScript, SQL, Docker, MCP, DevOps
- เหตุผล: Coding ต้องการความถูกต้องสูง กด
temperatureต่ำเพื่อลด hallucination
{
"min_p": 0,
"top_k": 20,
"top_p": 0.95,
"extra_body": {
"chat_template_kwargs": {
"enable_thinking": true,
"preserve_thinking": true
}
},
"guardrails": [],
"max_tokens": 8192,
"temperature": 0.2,
"presence_penalty": 0.0,
"repetition_penalty": 1,
"parallel_tool_calls": true
}
qwen-agent
- Use Case: Deterministic Tool Calling, Workflow Execution, Multi-Step Tasks
- เหตุผล: Agent ต้องการ deterministic สูงสุด เพื่อให้ parser อ่านได้แม่นยำ 100%
{
"min_p": 0,
"top_k": 20,
"top_p": 0.90,
"extra_body": {
"chat_template_kwargs": {
"enable_thinking": true,
"preserve_thinking": true
}
},
"guardrails": [],
"max_tokens": 8192,
"temperature": 0.1,
"presence_penalty": 0.0,
"repetition_penalty": 1,
"parallel_tool_calls": true
}
qwen-agent-creative
- Use Case: Research Agent, Brainstorming Agent, Content Agent
- เหตุผล: เน้นแตกไอเดีย ค้นคว้า สร้างเนื้อหา
{
"min_p": 0,
"top_k": 20,
"top_p": 0.95,
"extra_body": {
"chat_template_kwargs": {
"enable_thinking": true,
"preserve_thinking": true
}
},
"guardrails": [],
"max_tokens": 12288,
"temperature": 0.8,
"presence_penalty": 0.3,
"repetition_penalty": 1,
"parallel_tool_calls": true
}
qwen-chat
- Use Case: Fast Chatbot, FAQ, Casual Conversation
- เหตุผล: แชทธรรมดา ไม่ต้อง thinking ตอบเร็ว
{
"min_p": 0,
"top_k": 20,
"top_p": 0.95,
"extra_body": {
"chat_template_kwargs": {
"enable_thinking": false,
"preserve_thinking": false
}
},
"guardrails": [],
"max_tokens": 4096,
"temperature": 0.8,
"presence_penalty": 0.2,
"repetition_penalty": 1,
"parallel_tool_calls": false
}
qwen-longctx
- Use Case: RAG, Codebase Analysis, Documentation, Long Reports
- เหตุผล: ต้องการ faithfulness สูงสุดกับ context ยาว
{
"min_p": 0,
"top_k": 20,
"top_p": 0.95,
"extra_body": {
"chat_template_kwargs": {
"enable_thinking": true,
"preserve_thinking": true
}
},
"guardrails": [],
"max_tokens": 16384,
"temperature": 0.2,
"presence_penalty": 0.0,
"repetition_penalty": 1,
"parallel_tool_calls": true
}
qwen-mini
- Use Case: Classification, Extraction, Formatting, Commit Message
- เหตุผล: งานเล็ก ๆ ต้องการ output คงที่ deterministic สูงสุด
{
"min_p": 0,
"top_k": 20,
"top_p": 0.20,
"extra_body": {
"chat_template_kwargs": {
"enable_thinking": false,
"preserve_thinking": false
}
},
"guardrails": [],
"max_tokens": 4096,
"temperature": 0.1,
"presence_penalty": 0.0,
"repetition_penalty": 1,
"parallel_tool_calls": false
}
qwen-trading
- Use Case: Market Analysis, Signal Evaluation, Structured Financial Output
- เหตุผล: ต้องการ output แบบ reproducible สูงสุด
{
"min_p": 0,
"top_k": 20,
"top_p": 1.0,
"extra_body": {
"chat_template_kwargs": {
"enable_thinking": true,
"preserve_thinking": true
}
},
"guardrails": [],
"max_tokens": 4096,
"temperature": 0.0,
"presence_penalty": 0.0,
"repetition_penalty": 1,
"seed": 42,
"parallel_tool_calls": true
}
Note:
qwen-tradingใช้thinking: on*บางกรณีอาจ override จาก client ได้
หมายเหตุสำหรับ Qwen3.6-35B-A3B
จากประสบการณ์กับ Qwen รุ่น reasoning/thinking:
presence_penaltyเกิน0.5มักเริ่มมีผลข้างเคียงมากกว่าประโยชน์temperatureช่วง0.5-0.7เป็น sweet spot สำหรับงานทั่วไป- งาน Agent ควรใช้
temperature <= 0.2 - งาน RAG/Codebase Analysis ควรใช้
temperature <= 0.3 - งานเขียนคอนเทนต์หรือ brainstorming ควรใช้
temperature 0.8-1.0 repetition_penaltyควรคงไว้ที่1.0เว้นแต่จะเจอปัญหาคำซ้ำจริง เพราะ Qwen รุ่นใหม่จัดการเรื่องนี้ได้ค่อนข้างดีอยู่แล้ว
ทำไมถึงตัด qwen-reasoning-low และ qwen-agent-think ออก
ชุดเดิมมี
qwen-reasoning
qwen-reasoning-low
qwen-agent-think
สามตัวนี้ overlap กันเยอะ — พฤติกรรมใกล้กันเกินไป ไม่เห็นความต่างชัดพอ
ผมแยกใหม่เป็น
qwen-reasoning
qwen-debug
qwen-agent-creative
ซึ่งเห็นความต่างชัดกว่า
qwen-reasoning
เน้น
คิดเชิงระบบ
วางแผน
ออกแบบ
วิเคราะห์เชิงกลยุทธ์
qwen-debug
เน้น
หาสาเหตุ
ตรวจ log
อ่าน stacktrace
แก้ bug
qwen-agent-creative
เน้น
แตกไอเดีย
ค้นคว้า
สร้างเนื้อหา
Profile ที่จะถูกเรียกใช้จริงบ่อยสุด
จากลักษณะงานที่ใช้งานจริงในช่วงที่ผ่านมา
| Profile | สัดส่วนการใช้งาน |
|---|---|
qwen-chat-think | 60% |
qwen-coder | 15% |
qwen-agent | 10% |
qwen-longctx | 10% |
| อื่น ๆ | 5% |
ดังนั้นถ้าจะทำ routing ใน Hermes ผมจะตั้ง
default_model: qwen-chat-think
แล้วค่อย override ตาม task
Routing คร่าว ๆ
Docker / Linux / SQL
→ qwen-coder
MCP / Agent Workflow
→ qwen-agent
อ่าน repo ใหญ่
→ qwen-longctx
อ่านข่าว + web search
→ qwen-chat-think
Architecture Review
→ qwen-reasoning
Debug Log
→ qwen-debug
Brainstorm Blog / Content
→ qwen-agent-creative
ชุดนี้จะครอบคลุมงานสาย DevOps, Agent, RAG, MCP และงานวิเคราะห์เชิงเทคนิคได้ค่อนข้างสมดุล โดยไม่ต้องมี profile ที่พฤติกรรมใกล้กันเกินไป
Conclusion
การใช้โมเดลตัวเดียวกันแล้วสร้าง Virtual Models ผ่าน LiteLLM Proxy ช่วยให้แต่ละ profile ตอบสนองงานได้ตรงกับลักษณะงานมากขึ้น โดยไม่ต้องเพิ่มต้นทุน infrastructure
ชุด 10 profiles บน Qwen3.6-35B-A3B-NVFP4 นี้ครอบคลุมงานสาย DevOps, Agent, RAG, MCP และงานวิเคราะห์เชิงเทคนิคได้ค่อนข้างสมดุล โดยไม่ต้องมี profile ที่พฤติกรรมใกล้กันเกินไป
References
- Qwen3.6-35B-A3B Model Card (Hugging Face)
- RedHatAI/Qwen3.6-35B-A3B-NVFP4 (Hugging Face)
- LiteLLM Proxy Documentation
เนื้อหานี้มีประโยชน์ไหม? ช่วยสนับสนุนค่ากาแฟให้ผู้เขียนสักแก้ว
Buy Me a Coffee