สำหรับคนที่กำลังคิดจะเอา model มารันไว้ใช้เองในเครื่อง คำถามแรกที่ต้องตอบให้ได้ก่อนเลยคือ “เครื่องเรามี memory พอไหม” และเอาจริงๆ มันมีตัวคำนวณที่บอกตัวเลขนี้ได้ค่อนข้างตรงครับ
ลองยกตัวอย่าง coding model ตัวหนึ่งขนาด 27B ที่ถ้าเรากดเลือก weight แบบ Q8, KV cache แบบ Q8, context window 256K, batch 1 แล้วรันบน vLLM ตัวเลข memory ที่ต้องใช้จะอยู่ราวๆ 58 GB ครับ ซึ่งบนฮาร์ดแวร์ระดับ workstation ที่มี memory 128 GB และ bandwidth ราวๆ 273 GB/s ก็พอจะรันไหว แล้วได้ความเร็วราวๆ 13 tok/s
จุดที่ผมว่าน่าสนใจที่สุดคือเรื่อง Mixture-of-Experts ครับ model สาย MoE อย่างพวก 122B total params จะ active แค่ราวๆ 10B params ต่อ token เท่านั้น แปลว่าเราได้คุณภาพของ model ตัวใหญ่ แต่ต้นทุนการ compute ต่อ token ใกล้เคียงกับ model ตัวเล็กกว่ามาก นี่คือเหตุผลที่ทำให้การ deploy ไว้ใช้เองในเครื่องเป็นไปได้จริงขึ้นเยอะ
ยาวไปไม่อ่าน สรุปก็คือ:
- ก่อนจะรัน model เองในเครื่อง ให้เช็ค memory ที่ต้องใช้จริงก่อนด้วยตัวคำนวณ
- ตัวเลขขึ้นกับขนาด model, ระดับ quantization ของ weight และ KV cache, ขนาด context, batch และ framework
- MoE คือกุญแจสำคัญ — total params ใหญ่ แต่ active params ต่อ token น้อย ทำให้รันในเครื่องไหวขึ้นมาก
If you’re thinking about running a model locally on your own machine, the first question to answer is simple: does the machine have enough memory? And there’s a calculator that gives you a fairly honest number for it.
Take a 27B coding model as an example. Pick Q8 weights, a Q8 KV cache, a 256K context window, batch size 1, and run it on vLLM — the memory footprint lands around 58 GB. On a workstation-class box with 128 GB of memory and roughly 273 GB/s of bandwidth, that’s runnable, and you’d see something like 13 tokens per second.
The part I find most interesting is Mixture-of-Experts. An MoE model with, say, 122B total parameters only activates around 10B per token. So you get the quality of a large model while the compute cost per token stays close to a much smaller one. That’s exactly what makes local deployment realistic instead of a fantasy.
TL;DR:
- Before running a model locally, check the real memory requirement with a calculator.
- The number depends on model size, quantization of weights and KV cache, context length, batch size, and framework.
- MoE is the key — large total params, few active params per token, which makes running it at home far more feasible.



