localllm
โอเพนซอร์ส · Windows, Linux, macOS

รัน AI ในเครื่องตัวเอง ด้วยโมเดลที่ดีที่สุดเท่าที่การ์ดจอรับไหว ในคำสั่งเดียว

localllm ดูการ์ดจอกับ RAM ของคุณ แล้วเลือกโมเดลที่ได้คะแนนสูงสุดในภาษาไทยจากที่เราวัดไว้ ซึ่งใส่การ์ดได้พอดี จากนั้นดาวน์โหลดและเปิดใช้ด้วย llama.cpp ที่ตั้งค่าไว้แล้ว ฟรี ใช้ออฟไลน์ได้หลังดาวน์โหลดครั้งแรก ข้อมูลไม่ออกจากเครื่อง

install and run
$ pip install make-localllm-easier
$ localllm

ต้องมี Python 3.9 ขึ้นไป โมเดลที่มีตอนนี้ต้องใช้การ์ดจอ VRAM 10 GB ขึ้นไป ถ้าไม่แน่ใจ ให้รัน localllm doctor ก่อน จะบอกว่าการ์ดของคุณรันอะไรได้บ้าง

localllm doctor, RX 9070 XT 16 GB
$ localllm doctor
GPU AMD Radeon RX 9070 XT  15.9 GB  (640 GB/s)    RAM 32 GB    language: th
Tested: Windows/AMD: tested by maintainers

Model sizes for this PC (whole model on the GPU = fast):
  [OK  ] 4B                       Q8 4.2 GB  ~90 tok/s (est.)
  [OK  ] 8B                       Q8 8.5 GB  ~45 tok/s (est.)
  [OK  ] 14B                      Q6 11.5 GB  ~33 tok/s (est.)
  [OK  ] 24-32B                   Q3 13.2 GB  ~29 tok/s (est.)
  [SLOW] 30B MoE (3B active)      Q4 18.0 GB with experts in RAM - works, ~10-25 tok/s
  [NO  ] 70B                      needs ~42.0 GB - too big for this PC
  [NO  ] 120B MoE (10B active)    needs ~72.0 GB - too big for this PC

Best measured model for you: gemma4-26b-a4b-qat  (MoE with ~4B active params: fastest)
What it can do here:
  EN  translated world-knowledge exam   82.2% correct
  EN  grade-school math word problems   96.8% correct
  TH  grade-school math word problems   89.6% correct  <- your language
  TH  real local school/licence exams   65.7% correct  <- your language
  TH  translation to/from English       55.6 chrF++ (0-100)  <- your language
  also measured in ar, es, hi, ja, zh (`localllm list`)
  holds ~78k tokens at once (~130 pages of text) next to the model
  uses ~2.2 GB of system RAM: ~0.3 GB embeddings/CPU-mapped + ~1.0 GB prompt cache + ~0.4 GB ctx checkpoints + ~0.5 GB host (est.)
  leaves ~15 GB of RAM free for other apps (est.)
  with --embeddings: + ~0.2 GB RAM for multilingual-e5-small on the CPU, no VRAM (est.)
  answers at ~90 tok/s
  speed settings not tuned for this PC yet: `localllm tune` measures them once (a few minutes)

Profiles (--profile):
  lean (default)    8k context  ~ 2.2 GB RAM  least memory
  max              78k context  ~ 9.6 GB RAM  long documents, agent sessions

ทำไมต้องเรื่องภาษา

โมเดลที่เก่งภาษาอังกฤษไม่ได้แปลว่าจะเก่งภาษาไทยเท่ากัน และการบีบไฟล์ (quantization) ทำให้ภาษาไทยเสียคะแนนมากกว่า จากที่เราวัด Qwen3.8-27B ตอนบีบเหลือ 2 บิต ภาษาอังกฤษตก 8 คะแนน แต่ภาษาไทยตก 13 คะแนน localllm จึงเก็บคะแนนแยกตามภาษา และเลือกให้ตามภาษาของคุณ

วัดบน RX 9070 XT 16 GBQwen3.8-27B Q3gemma-4-26B-A4B QAT
ข้อสอบจริงของไทย (ThaiExam)67.1%65.7%
โจทย์คณิตศาสตร์ภาษาไทย (MGSM)87.2%89.6%
แปลไทย-อังกฤษ (chrF++)54.155.6
ความเร็ว~50 tok/s~90 tok/s

คะแนนต่างกันไม่ถึง 2 คะแนนถือว่าเสมอ (ค่าคลาดเคลื่อนของข้อสอบประมาณ ±5) ถ้าเสมอจะเลือกตัวที่เร็วกว่า

ทำอะไรให้บ้าง

เลือกโมเดลจากผลวัดจริง

ทุกโมเดลผ่านข้อสอบหลายภาษาบนเครื่องทดสอบเดียวกัน ไม่ต้องไล่อ่านกระทู้หรือเดาเอง

ใช้ RAM น้อยลงประมาณ 4 เท่า

คุยต่อเนื่อง 30 รอบ ใช้ RAM ราว 2.2 GB แทน 9.2 GB ของค่าเริ่มต้น llama.cpp ความเร็วเท่าเดิม

การ์ด AMD และ Intel

ใช้ Vulkan และแก้ปัญหาช้าบน Windows ที่ไม่ได้เปิด Resizable BAR ให้เฉพาะโมเดลที่วัดแล้วเร็วขึ้นจริง

ต่อกับแอปที่มีอยู่

API ที่ 127.0.0.1:8080 รองรับรูปแบบ OpenAI, Anthropic, Ollama และ Gemini

ช่วยวัดผลบนเครื่องของคุณ

เรามีเครื่องทดสอบเครื่องเดียว (Windows + RX 9070 XT) ถ้าคุณใช้ NVIDIA, Mac หรือการ์ดรุ่นอื่น ใช้เวลา 10-30 นาที:

แชร์ผลวัด
$ localllm tune
$ localllm eval --langs en,th
$ localllm report

report จะเปิด issue บน GitHub ที่กรอกข้อมูลไว้ให้ ไม่มีชื่อผู้ใช้ path หรือ key อ่านทวนได้ก่อนส่ง ผลจะขึ้นใน ตารางคะแนน