# LLM Cal > LLM Cal is a planning calculator for local and self-hosted LLM inference: VRAM or unified-memory fit, KV cache, decode tok/s estimates, and a Thai-Baht hardware price. Bilingual field guides explain the planning. The markdown links below are the agent copies of those guides. Calculator tok/s figures are planning estimates, not benchmark results. Cite the HTML guide URL. The linked markdown file is the agent copy of that page. Ignore calculator URLs that contain a hash. Thai Baht figures are planning prices, not quotes. ## Guides (ไทย) - [เลือก Hardware สำหรับ Local LLM จากงาน ไม่ใช่แค่ชื่อ GPU](https://llm-cal.p7z.pw/th/guides/hardware/index.md): คู่มือเลือกฮาร์ดแวร์สำหรับ Local LLM สรุปจุดเด่นและข้อจำกัดระหว่าง Apple Silicon Mac, NVIDIA CUDA และ AMD ROCm วิเคราะห์ VRAM, Memory Bandwidth, สเปก และราคาตลาดในไทยเพื่อการลงทุนที่คุ้มค่า - [เลือก Local LLM ตามงาน: ภาษาไทย, chatbot, agent, coding และ workflow](https://llm-cal.p7z.pw/th/guides/models/index.md): คู่มือเลือกโมเดล Local LLM ให้เหมาะกับประเภทงาน: ภาษาไทย, Chatbot สนทนา, AI Agent เรียกใช้ Tool, งานเขียนโปรแกรม Coding และงานข้อมูลโครงสร้าง JSON พร้อมวิธีประเมินคุณภาพอย่างมีหลักฐาน - [Quantization: ลด VRAM ตรงไหน และแลกคุณภาพอย่างไร](https://llm-cal.p7z.pw/th/guides/quantization/index.md): คู่มือเจาะลึกการเลือก 4-bit และ 8-bit Quantization ทั้งฝั่ง Weights และ KV Cache สรุปเทคนิค QAT, MXFP4, AWQ, GPTQ และ GGUF พร้อมวิธีคำนวณ VRAM ประเมินคุณภาพ และความเสี่ยงหลอนในงานจริง - [ทำไม tok/s ของ LLM มักติด Memory Bandwidth](https://llm-cal.p7z.pw/th/guides/roofline/index.md): เจาะลึก Roofline Model สำหรับ Local LLM: ทำไม Decode ถึงติด Memory Bandwidth ทำไม Prefill ถึงติด Compute (FLOPS) พร้อมวิธีแยกแยะ TTFT, TPOT, ITL และวิธีอ่านผล VRAM Calculator อย่างมืออาชีพ - [Serving Framework: เลือกจาก workload, hardware และไฟล์โมเดล](https://llm-cal.p7z.pw/th/guides/serving/index.md): เปรียบเทียบ Serving Framework ยอดนิยม: vLLM, SGLang, llama.cpp, MLX-LM และ Ollama สรุปจุดเด่น ข้อจำกัด ฮาร์ดแวร์ และรูปแบบไฟล์ Safetensors หรือ GGUF เพื่อเลือกใช้งานได้อย่างถูกต้อง - [Speculative Decoding และ Attention Backend: เร็วขึ้นเมื่อเงื่อนไขตรง](https://llm-cal.p7z.pw/th/guides/spec-attention/index.md): คู่มือเจาะลึก Speculative Decoding, Multi-Token Prediction (MTP) และ Attention Backends เช่น FlashAttention, FlashInfer เพื่อเร่งความเร็ว Local LLM โดยเข้าใจเงื่อนไขที่ทำให้ระบบเร็วขึ้นหรือช้าลง - [EXL3 คือรหัส trellis ของ ExLlamaV3 ที่ตั้งค่าเฉลี่ยบิตต่อน้ำหนัก](https://llm-cal.p7z.pw/th/guides/exl3/index.md): EXL3 เป็นฟอร์แมตน้ำหนักของ ExLlamaV3 ที่ย่อมาจาก QTIP ใช้ trellis หลังการหมุน Hadamard และตั้งค่าเฉลี่ยบิตต่อน้ำหนักได้ คู่มือนี้อธิบาย codebook mul1, ธง hq, และแพ็ก 2.9 bpw ของ DeepSeek บน 2 DGX Spark - [TensorFold คือเซิร์ฟเวอร์ Zig ที่เสิร์ฟโมเดลบน Metal และ CUDA](https://llm-cal.p7z.pw/th/guides/tensorfold/index.md): TensorFold เสิร์ฟโมเดลจากไบนารี Zig บน Apple Silicon และ NVIDIA โดยอ่าน checkpoint และรันเคอร์เนลเอง คู่มือนี้อธิบายสัญญา exact decoding ตารางโมเดลของรีลีส และสูตร DeepSeek ที่ใช้ fork บน 2 DGX Spark ## Guides (English) - [Choose Local LLM Hardware by Workload, Not GPU Names](https://llm-cal.p7z.pw/en/guides/hardware/index.md): Comprehensive guide to choosing hardware for Local LLMs. Summarizing pros and cons across Apple Silicon Mac, NVIDIA CUDA, and AMD ROCm with VRAM, memory bandwidth, specs, and Thailand market planning prices. - [Choose Local LLMs by work: Thai, chatbot, agent, coding, workflow](https://llm-cal.p7z.pw/en/guides/models/index.md): Select local LLMs for Thai, chatbots, agents, coding, and structured workflows by workload profile instead of ungrounded rankings. - [Quantization: Where VRAM is Reduced and What Quality Trades Away](https://llm-cal.p7z.pw/en/guides/quantization/index.md): In-depth guide to 4-bit and 8-bit quantization for weights and KV cache, summarizing QAT, MXFP4, AWQ, GPTQ, and GGUF with VRAM calculations, quality trade-offs, and hallucination risks. - [Why LLM tok/s Hits Memory Bandwidth Bottlenecks](https://llm-cal.p7z.pw/en/guides/roofline/index.md): Deep-dive into the Roofline Model for Local LLMs: why Decode is memory bandwidth bound, why Prefill is compute (FLOPS) bound, distinguishing TTFT, TPOT, ITL, and reading calculator results like a pro. - [Serving frameworks: choose from workload, hardware, and model files](https://llm-cal.p7z.pw/en/guides/serving/index.md): Compare popular LLM serving frameworks: vLLM, SGLang, llama.cpp, MLX-LM, and Ollama by strengths, limits, hardware fit, and supported file artifacts like Safetensors and GGUF. - [Speculative decoding and attention backends: faster only when the conditions fit](https://llm-cal.p7z.pw/en/guides/spec-attention/index.md): Understand speculative decoding, acceptance rate, and attention backends for local LLMs, including when they improve or hurt performance. - [EXL3 is ExLlamaV3's trellis code with a target average bitrate](https://llm-cal.p7z.pw/en/guides/exl3/index.md): EXL3 is ExLlamaV3's weight format, a practical form of QTIP. It uses a trellis after a Hadamard rotation and a target average bitrate. This guide covers the mul1 codebook, the hq flag, and the 2.9 bpw DeepSeek pack on two DGX Sparks. - [TensorFold is the Zig server that serves models on Metal and CUDA](https://llm-cal.p7z.pw/en/guides/tensorfold/index.md): TensorFold serves models from a Zig binary on Apple Silicon and NVIDIA GPUs. The binary reads the checkpoint and runs the kernels itself. This guide covers exact decoding, the release model table, and the forked DeepSeek recipe on two DGX Sparks. ## Optional - [Sitemap](https://llm-cal.p7z.pw/sitemap.xml): indexable HTML URLs, not the markdown twins - [Calculator](https://llm-cal.p7z.pw/): interactive planner, Thai shell - [Calculator (English)](https://llm-cal.p7z.pw/en/calculator/): English shell