Curated, evidence-backed list of runtimes, formats & tools for running AI inference on CPU — start with CPU, justify the GPU.
See the codeTraining needs GPUs. Inference usually doesn't. Start with CPU; justify the GPU.
🌐 Browse as a website: https://ranjithrajv.github.io/awesome-cpu-first-ai/
A curated list of runtimes, formats, tools, and evidence for running AI inference on CPU — the platform you already have everywhere. NPU coverage is also included as a companion on-device alternative where dedicated AI silicon exists (phone NPUs, laptop AI engines), with the caveat that NPUs are vendor-locked while CPU remains the universal fallback.
Most AI practitioners default to GPU for everything because that is where training lives. But once a model is trained, the inference workload often fits comfortably on a modern CPU: smaller batch sizes, modest throughput requirements, and quantized models that slip inside L3 cache. A live crawl of the 2.9M-model Hugging Face Hub bears this out: two-thirds of model downloads go to models ≤1B parameters and ~78% to ≤7B, the 15 most-downloaded models are almost all sub-1B embedding and encoder models, and CPU-native tasks (embeddings, ASR, classification) account for nearly half of all downloads. The vast majority of inference workloads people actually run never needed a GPU — see The CPU-First Case, in Hub Data for every figure with its reproducible query.
This list covers CPU inference as the universal deployment target — the platform you already have on every server, laptop, phone, and edge device. It also covers NPU (Neural Processing Unit) inference as a companion on-device path: modern phones and laptops ship dedicated AI silicon (Apple Neural Engine, Qualcomm Hexagon, Intel NPU, AMD XDNA) that can run quantized models more efficiently than the CPU. NPU coverage is included with the caveat that NPUs are vendor-locked, have immature LLM tooling, and often underperform CPU on generative workloads due to memory-bandwidth limits — the CPU path remains the most portable and frequently the fastest option for LLM inference on mobile today.
And now the agentic wave has made the CPU indispensable: tool calling, deterministic code execution, orchestration loops, and KV-cache management all run on the CPU — even when GPUs handle model inference. No accelerator can replace the CPU as the control plane for AI.
This list is for engineers who want to question that GPU default and reach for the right tool instead of the expensive one. The list is GPU-skeptical, not GPU-hostile; the When You Actually Do Want a GPU section below is load-bearing, not decorative. NPU content is marked with a 🧠 icon where applicable.
See CHANGELOG for the full history.
Want to help shape the next release? There are
good first issuetasks waiting for a contributor.
Three paths from zero to CPU inference — no GPU, no CUDA, no container: llamafile (desktop, zero install), ollama (server / CLI), or WebLLM (browser, WebAssembly). All three are listed with source links under Runtimes and Inference Engines below.
See docs/quickstart.md for the full walkthroughs with copy-paste commands and sample code.
| Dimension | Lean CPU | 🧠 Lean NPU (on-device) | Lean GPU |
|---|---|---|---|
| Workload type | Inference | Inference (small quantized models) | Training, fine-tuning |
| Model size | ≤ 13B params (quantized) — covers ~60% of HF models | ≤ 3B params (INT8/INT4) — NPU memory is limited | 70B+ params, dense/unquantized — covers < 8% of models |
| Throughput need | Low-to-medium (single-digit req/s) | Low (single-stream, real-time) | High (hundreds of req/s, batched) |
| Batch size | Batch = 1 or small ad-hoc bursts | Batch = 1 (NPU designed for single-stream) | Large, sustained batched serving |
| Latency SLA | Relaxed (100 ms–2 s TTFT tolerable) | Low (10–50 ms for small models) | Tight (< 50 ms TTFT on large models) |
| Context length | Short-to-medium (≤ 8 K tokens) | Short (≤ 2 K tokens on most NPUs) | Very long (32 K+ tokens, prefill-heavy) |
| Deployment target | Edge, on-device, serverless, SBC | Phone, laptop, IoT (vendor-specific silicon) | Dedicated inference cluster |
| Cost / availability | CPU instances are ubiquitous; no VRAM cap | Free (already in device); vendor-locked toolchain | GPU instances cost 5–20× more; VRAM is a hard ceiling |
| Modality | Text, embeddings, small audio | Vision (classification, detection), small ASR | Real-time diffusion, video generation, large vision models |
| Portability | Universal — same model runs anywhere | Vendor-locked — Qualcomm QNN, Apple ANE, Intel NPU differ | Cross-vendor (CUDA, ROCm) but hardware-specific |
flowchart TD
A([New inference workload]) --> B{Model size\nafter quantization?}
B -- "≥ 70 B params\nor > 24 GB VRAM needed" --> GPU_SIZE["⛔ GPU\nVRAM requirement alone\nforces the choice"]
B -- "≤ 13 B params\nfits quantized in RAM" --> C{Throughput\nrequirement?}
C -- "Hundreds of req/s\nor large sustained batches" --> GPU_TPUT["⛔ GPU\narithmetic throughput\nis decisive at scale"]
C -- "Single-digit req/s\nor batch = 1" --> D{TTFT latency\nSLA?}
D -- "< 50 ms TTFT required" --> GPU_LAT["⛔ GPU\nmemory bandwidth needed\nfor large-model latency"]
D -- "100 ms – 2 s\nTTFT acceptable" --> E{Context\nlength?}
E -- "> 32 K tokens\nprefill-heavy" --> GPU_CTX["⛔ GPU\nprefill is a large\nmatrix multiply"]
E -- "≤ 8 K tokens" --> F{Deployment\ntarget?}
F -- "Edge / SBC / mobile\nbrowser / offline" --> I{NPU available\non device?}
I -- "Yes (phone / AI PC)" --> NPU["🧠 NPU\nQNN · Core ML ANE\nOpenVINO NPU · ExecuTorch NPU"]
I -- "No / vendor lock-in\nconcerns" --> CPU_EDGE["✅ CPU\nllama.cpp · ncnn\nExecuTorch · TFLite"]
F -- "Cloud / on-prem server" --> G{Traffic\npattern?}
G -- "Sporadic / bursty\n< 10 req/min average" --> CPU_SLS["✅ Serverless CPU\nLambda arm64 · Fly.io\nModal CPU — pay per use"]
G -- "Sustained load" --> H{GPU utilization\nif you provisioned one?}
H -- "Idle > 50 % of the time" --> CPU_IDLE["✅ CPU\nidle CPU instance\ncosts less than idle GPU"]
H -- "Busy > 50 % of the time" --> GPU_ECON["⛔ GPU\n$/token favours GPU\nat high sustained load"]
style NPU fill:#1a237e,color:#fff,stroke:#1a237e
style CPU_EDGE fill:#1b5e20,color:#fff,stroke:#1b5e20
style CPU_SLS fill:#1b5e20,color:#fff,stroke:#1b5e20
style CPU_IDLE fill:#1b5e20,color:#fff,stroke:#1b5e20
style GPU_SIZE fill:#7f1d1d,color:#fff,stroke:#7f1d1d
style GPU_TPUT fill:#7f1d1d,color:#fff,stroke:#7f1d1d
style GPU_LAT fill:#7f1d1d,color:#fff,stroke:#7f1d1d
style GPU_CTX fill:#7f1d1d,color:#fff,stroke:#7f1d1d
style GPU_ECON fill:#7f1d1d,color:#fff,stroke:#7f1d1d
🔍 Missing something? If a CPU-native runtime, benchmark, or deployment guide belongs here, open a suggestion.
First-timer? Issues taggedgood first issueare the quickest way to contribute — low effort, high impact.
Also checkhelp wantedfor bigger gaps.
.tflite models via WebAssembly (CPU, XNNPACK backend) or WebGPU with zero server dependency, supporting INT8 quantized models on the CPU path.coremltools target the ANE for vision and small LLMs. CPU/GPU fallback for unsupported ops. (Core ML ANE deployment)Runtime comparison at a glance
| Runtime | Native Format | CPU Arch | OS |
|---|---|---|---|
| llama.cpp | GGUF | x86, ARM, RISC-V | Linux, macOS, Windows |
| bitnet.cpp | GGUF (I2_S / TL) | x86, ARM | Linux, macOS, Windows |
| Project Zero | BitNet 1.58-bit | x86, ARM (no SIMD) | Linux, macOS, Windows |
| ArcLight | GGUF | x86 (NUMA) | Linux |
| MojoLlama | GGUF | x86, ARM (Mojo MAX) | Linux, macOS |
| cpubrrr | GGUF | ARM (NEON/SME) | macOS (Apple M4) |
| Ferrite | GGUF | x86, ARM | Linux, macOS, Windows |
| Reame | GGUF | x86, ARM | Linux, macOS, Windows |
| ONNX Runtime | ONNX | x86, ARM, WebAssembly | Linux, macOS, Windows |
| OpenVINO | OpenVINO IR | x86 | Linux, Windows |
| ncnn | ncnn | x86, ARM, RISC-V | Linux, Windows, Android |
| MNN | MNN | x86, ARM | Linux, Windows, Android, iOS |
| candle | GGUF, safetensors | x86, ARM | Linux, macOS, Windows |
| colibri | safetensors (custom) | x86, ARM | Linux, macOS, Windows |
| kimi-k3-in-c | mxfp4 (custom) | x86 (AVX2) | Linux |
| midge | custom (packed, mxfp4) | x86, ARM | Linux, macOS |
| hummingbird | GGUF, safetensors | x86, ARM | Linux, macOS |
| distributed-llama | Q40 / Q80 | x86, ARM | Linux, macOS, Windows |
| eLLM | safetensors | x86 (AMX required) | Linux |
| Transformers.js | ONNX | WebAssembly | Browser |
| WebLLM | MLC | WebAssembly, WebGPU | Browser |
| LiteRT.js | TFLite | WebAssembly, WebGPU | Browser |
| ExecuTorch | ExecuTorch | x86, ARM | Linux, Android, iOS |
| TensorFlow Lite (LiteRT) | TFLite | x86, ARM | Linux, Windows, Android, iOS |
| Intel Ext. for Transformers | PyTorch, ONNX | x86 | Linux, Windows |
| TinyChatEngine | AWQ (W4A16) | x86, ARM, CUDA | Linux, macOS, Windows |
| whisper.cpp | GGUF | x86, ARM | Linux, macOS, Windows |
🧠 NPU runtimes at a glance
| Runtime | NPU Target | Format | OS / Platform |
|---|---|---|---|
| Qualcomm QNN | Hexagon NPU | QNN C++ / TFLite | Android (Snapdragon) |
| Qualcomm GenieX | Hexagon NPU / Adreno GPU / CPU | GGUF | Snapdragon: Android, Windows ARM64, Linux IoT |
| Apple Core ML (ANE) | Apple Neural Engine | Core ML (.mlmodel) | iOS, macOS, visionOS |
| OpenVINO NPU plugin | Intel NPU | OpenVINO IR | Windows, Linux (Meteor Lake+) |
| AMD Vitis AI / XDNA | AMD XDNA NPU | ONNX | Windows (Ryzen AI) |
| ExecuTorch (NPU backends) | Qualcomm / MediaTek | ExecuTorch | Android |
| MediaTek NeuroPilot | MediaTek NPU | ONNX / TFLite | Android (Dimensity) |
| Samsung ENN | Samsung NPU | ENN | Android (Exynos) |
optimum[onnxruntime] and optimum-intel paths export and quantize models for CPU inference via ONNX Runtime and OpenVINO respectively.llama-quantize binary converting Hugging Face checkpoints to GGUF; covers k-quants (Q4_K_M, Q5_K_M, Q6_K) and importance-matrix–guided i-quants (IQ3_XS, IQ4_XS) that route more bits to high-impact weights — IQ4_XS saves ~400 MB vs Q4_K_M on a 7B model at comparable accuracy. Pair with --imatrix for any format below Q5_K_M..imatrix file is passed to llama-quantize and significantly improves output quality at aggressive compression ratios (IQ3_XS, IQ4_XS, Q3_K_S).--threads, --threads-batch, CPU affinity masks, and NUMA-aware memory allocation for multi-socket servers.Mixture-of-Experts (MoE) architectures are often assumed to require GPU because of their large total parameter counts, but the sparse routing mechanism — activating only a subset of experts per token — creates a different compute profile that can benefit CPU deployment. The activated parameters are typically 5–10% of total (e.g., 37B activated out of 671B total in DeepSeek-R1), so aggressive quantization brings the working set within reach of CPU instances with sufficient RAM.
A scored assessment of the CPU-first AI tooling landscape across 10 workload categories — grading every major tool on CPU-nativeness, CPU performance, architecture coverage, and adoption — to identify where the ecosystem is mature and where gaps remain. Inspired by the AI Potluck Open Source AI Gap Map (which scores openness), this map scores CPU-nativeness — the degree to which a tool is designed for CPU inference rather than treating it as a secondary fallback.
| # | Category | Stage | Gaps | Mature CPU-native tools | Best CPU-native option |
|---|---|---|---|---|---|
| 1 | LLM inference (decode) | 5 | - | 7 | llama.cpp |
| 2 | LLM prompt processing (prefill) | 4 | Architecture | 3 | ONNX Runtime GenAI |
| 3 | ASR / STT | 5 | - | 4 | whisper.cpp |
| 4 | TTS | 4 | Maturity | 3 | Piper / PocketTTS |
| 5 | Embeddings | 5 | - | 3 | sentence-transformers ONNX |
| 6 | Vision - detection & classification | 5 | - | 4 | YOLOv8 + OpenVINO |
| 7 | Vision - segmentation | 3 | Performance, Coverage | 0 | MobileSAM |
| 8 | OCR | 5 | - | 3 | PaddleOCR |
| 9 | Image generation (diffusion) | 2 | Performance, Architecture | 0 | OpenVINO Stable Diffusion |
| 10 | Fine-tuning (LoRA / QLoRA) | 3 | Performance | 1 | llama.cpp fine-tuning |
At a glance: 5 of 10 categories are at Stage 5 (mature). 2 categories carry performance gaps (segmentation, diffusion). 1 category has a void for non-x86 architectures (diffusion). Fine-tuning on CPU is viable but slow - the ecosystem needs faster CPU LoRA kernels to close the throughput gap.
Maturity stages: 5 = Mature CPU ecosystem, 4 = Competitive, 3 = Viable alternatives, 2 = Emerging, 1 = Experiments, 0 = Void.
Scoring axes: CPU-nativeness (0-5, core axis - only tools scoring >= 4 advance maturity stage), CPU performance (0-5, within-category), Architecture coverage (x86 / ARM / RISC-V / WASM grid), Adoption (1-5, GitHub stars + PyPI downloads).
See the full CPU AI Gap Map for methodology, per-category scorecards, architecture coverage grids, and gap analysis.
Tools that read your actual machine — RAM, CPU cores, and any GPU — and rank which models will realistically run and perform well on it, instead of guessing from parameter count. These are the practical first step before pulling a model: they surface CPU-only and unified-memory scenarios rather than assuming VRAM is the only constraint.
S) to override RAM/VRAM/core count for upgrade planning.See docs/cpu-native-models.md for a full catalogue of models well-suited to CPU inference — including dense ≤ 13B, MoE with high sparsity, ternary/1-bit, embedding, vision, and ASR/TTS models with recommended runtimes and measured performance ranges.
coremltools compilation; CPU/GPU fallback for unsupported ops. (Core ML ANE deployment).npy files on NVMe, keeps an LRU cache of hot experts in RAM, and uses a lightweight shadow model to predict and asynchronously prefetch the next top-K experts; runs 375 GB models (e.g. Kimi-K2.5) in 192 GB RAM. MIT. (Note: executes on Apple's Metal/MLX stack, not the CPU; included for its on-demand expert-loading and learned-prefetch approach on on-device ARM hardware.).tflite format and XNNPACK CPU backend; the browser target LiteRT.js is listed under Runtimes and Inference Engines.)Computer vision inference — object detection, classification, and segmentation — is often cheaper to run on CPU than GPU, especially in video analytics pipelines where multiple camera feeds must be processed concurrently on the same host. Modern runtimes like OpenVINO and ONNX Runtime deliver server-grade throughput for YOLO models on Intel Xeon and commodity x86 hardware.
Speech, audio, text-to-speech, and optical character recognition are among the most common production AI workloads that rarely need a GPU. Modern ASR engines run efficiently on CPU with INT8 quantization, TTS engines synthesize in real time using lightweight ONNX models, and OCR toolchains have been CPU-native for decades — with deep learning models now matching traditional engine accuracy while running on commodity x86 and ARM hardware.
Key tools: faster-whisper, whisper.cpp, transcribe.cpp, Piper, PocketTTS, PaddleOCR, Tesseract, MobileSAM, rembg, InsightFace.
See docs/multimodal-cpu.md for the full catalogue — ASR/STT, audio embeddings, VAD/diarization, TTS, text embeddings, document classification, OCR, image classification, segmentation, generation, background removal, and face analysis with baseline CPU latency and throughput figures.
Cloud instances where Arm CPUs are the primary inference platform. These are not edge devices — they are datacenter-class Arm cores with high core counts, large memory bandwidth, and SVE/NEON acceleration — and they are increasingly competitive with x86 on both throughput and cost.
Modern flagship phones run billion-parameter LLMs on-device — no cloud round-trip, no GPU required. The CPU path is the most portable, vendor-independent option for mobile inference: it works across all devices regardless of NPU vendor lock-in, and for LLMs it often matches or exceeds NPU throughput due to more mature tooling and the memory-bandwidth-bound nature of token generation. 🧠 NPU inference is available on most flagship SoCs (Apple ANE, Qualcomm Hexagon, MediaTek NPU, Samsung ENN) but is vendor-locked: a model compiled for one NPU SDK (QNN, Core ML ANE, NeuroPilot) will not run on another without recompilation. NPU performance varies significantly — Qualcomm's Hexagon NPU achieves 12–25 tok/s for 7B INT4 on Snapdragon 8 Elite via QNN, while Apple's ANE is primarily optimized for vision and small models. For generative LLMs, CPU frequently matches or beats NPU throughput on current hardware. Aggressive ternary/1-bit quantization is pushing this further: PrismML reports its 1-bit Bonsai 27B (~3.9 GB) running a 27B-class model on an iPhone 17 Pro CPU at ~11 tok/s — see Ternary / 1-bit models. (vendor-reported; last verified: 2026-07)
Key platforms (🧠 = NPU present): 🧠 Apple A19 Pro (16-core ANE, ~35 TOPS), 🧠 Snapdragon 8 Elite (Hexagon NPU, ~60 TOPS), 🧠 Exynos 2500 (59 TOPS NPU), 🧠 Dimensity 9500 (NPU 890, ~50 TOPS), 🧠 Tensor G5 (TPU, NPU path experimental).
On-device apps: Off Grid AI (OGAM) — MIT-licensed cross-platform offline AI suite for Android, iOS, and macOS (React Native) running GGUF LLMs via llama.cpp on CPU with optional OpenCL/Metal GPU and experimental Snapdragon NPU acceleration, plus on-device vision (SmolVLM/Qwen3-VL), Whisper STT, Stable Diffusion image generation, tool calling, MCP, and local-network OpenAI-compatible servers; fully offline with per-model RAM management; PocketPal AI — open-source (MIT, 7.6k★) cross-platform chat app running GGUF models on CPU/GPU/NPU with on-device TTS, tool use, and Hugging Face integration; PocketLFM — Android app for Liquid AI's LFM2.5 models on CPU via llama.cpp; PrivateFoundationModels — Swift package unifying Apple FoundationModels, Core ML, and MLX for on-device LLMs on iOS/macOS.
See docs/mobile-cpu-inference.md for the full catalogue — chipsets, runtimes (MLC-LLM, Apple Core AI, llama.cpp Android, Qualcomm AI Hub, Arm SME2/KleidiAI), end-user apps, and benchmarks (State of the Union 2026, Beebom, CraftRigs) with tok/s and thermal measurements.
The short version. At sustained batch=32 load a GPU has a ~40× $/token advantage on Llama-3 8B. The CPU economic case rests on three factors that table does not capture:
A worked production example (1 req/s, 730 hrs/month, 7B Q4) shows CPU saves $5,740/yr on a c7g.2xlarge vs g5.xlarge — the gap closes only after GPU utilization exceeds ~50%.
See docs/cost-calculator.md for the full cost-per-token table, TCO worked example, pricing reference, break-even formula, and a runnable bash calculator script.
This section is load-bearing. The CPU-first default breaks down in the following real scenarios — reaching for a GPU here is the right call, not a failure of discipline.
High-throughput batched serving at scale. When serving hundreds of concurrent requests with large batch sizes, GPU memory bandwidth dominates and arithmetic throughput advantage becomes decisive. CPU cores serialize; GPU SIMT parallelism does not. Self-hosted GPU breakeven requires ≥ 50% utilization for 7B models and ≥ 10% for 13B models — below those thresholds CPU or serverless often wins on total cost; above them GPU $/token falls sharply as batch size grows. (dasroot.net, Feb 2026; methodology: arxiv:2606.11690)
Tight low-latency SLAs on large models. If your SLA requires < 50 ms time-to-first-token on a 34B+ parameter model, no current CPU can match A100/H100 memory bandwidth. The token generation phase is memory-bound; GPUs have 5–10× the off-chip bandwidth of a modern CPU.
Long-context prefill. Prefilling a 32 K+ token prompt is a large matrix multiply. This scales with context length and is exactly the workload GPUs were built for. On a 128 K-context model, CPU prefill latency can be tens of seconds — unacceptable for interactive use cases.
Real-time diffusion and video generation. Stable Diffusion and video generation models require hundreds of TFLOPS per generated frame. CPU throughput is too low for any real-time or near-real-time requirement here; this is not a quantization-fixable problem.
Continuous batching serving infrastructure. Frameworks like vLLM and TGI are purpose-built for GPU-resident KV cache management, paged attention, and continuous batching. These optimizations exist because the GPU memory hierarchy enables them; the tradeoffs do not translate cleanly to CPU.
Large multi-modal models. Vision-language models with large image encoders add substantial FLOPs to the inference path. Running these at interactive speed on models above 34B currently requires GPU for most deployment configurations.
Fine-tuning adapts a pre-trained model to a specific domain or task. While full-parameter training remains GPU territory, parameter-efficient fine-tuning (PEFT) methods — LoRA, QLoRA, DoRA — can run on CPU for small base models (≤ 7B) at moderate batch sizes, especially when the base model is pre-quantized and only adapter weights are updated. This section covers tools and patterns for fine-tuning on CPU.
.lora files loadable by llama-cli at inference time. Suited for small-scale domain adaptation (classification heads, instruction tuning on 1K–10K examples). Runs entirely on CPU with no GPU dependency at any stage.llama.cpp's export-lora for CPU serving.device="cpu" is set, though throughput is 10–50× slower than a single GPU. Practical for models ≤ 3B where training data is small (< 5K examples) and iteration time is not critical.CUDA_VISIBLE_DEVICES="" to force CPU execution.deepspeed ZeRO-3 CPU offload, keeping activations on GPU while optimizer states reside in system RAM — a hybrid approach that reduces GPU VRAM requirements for larger models.CPU fine-tuning economics in practice. Fine-tuning a Llama-3.2 3B model using LoRA on a c7g.2xlarge (8 vCPU, 16 GB RAM) with 1,000 examples for 3 epochs completes in approximately 6–12 hours depending on sequence length. The total compute cost at $0.35/hr is $2–4 per fine-tune run. The same run on a g5.xlarge GPU instance ($1.006/hr) completes in 15–30 minutes at $0.25–0.50 per run. GPU is faster and cheaper for the fine-tuning event, but the fine-tuned adapter then deploys on CPU at the inference costs documented in Cost and Deployment Economics — the overall TCO depends on how many inference queries you serve after fine-tuning.
Rule of thumb. Fine-tune on GPU when you have one (even a rented one); the time savings justify the marginal cost. Fine-tune on CPU when you have no GPU access, are iterating on a tiny dataset, or want a fully offline pipeline with no cloud dependency. The adapter format is interchangeable — LoRA weights trained on GPU load identically on CPU.
Companion documents for planning, converting, deploying, benchmarking, and troubleshooting CPU inference.
uv run streamlit run calculator/cost-calculator.py).uv run streamlit run calculator/power-calculator.py).Contributions welcome. Please read CONTRIBUTING.md first. Every entry must be:
If you are unsure whether a tool belongs, open an issue rather than a PR and describe why you think it qualifies.
To the extent possible under law, the maintainers of awesome-cpu-first-ai have waived all copyright and related or neighboring rights to this work.
Python
76.8%
HTML
23.2%
Curated, evidence-backed list of runtimes, formats & tools for running AI inference on CPU — start with CPU, justify the GPU.
See the codeTraining needs GPUs. Inference usually doesn't. Start with CPU; justify the GPU.
🌐 Browse as a website: https://ranjithrajv.github.io/awesome-cpu-first-ai/
A curated list of runtimes, formats, tools, and evidence for running AI inference on CPU — the platform you already have everywhere. NPU coverage is also included as a companion on-device alternative where dedicated AI silicon exists (phone NPUs, laptop AI engines), with the caveat that NPUs are vendor-locked while CPU remains the universal fallback.
Most AI practitioners default to GPU for everything because that is where training lives. But once a model is trained, the inference workload often fits comfortably on a modern CPU: smaller batch sizes, modest throughput requirements, and quantized models that slip inside L3 cache. A live crawl of the 2.9M-model Hugging Face Hub bears this out: two-thirds of model downloads go to models ≤1B parameters and ~78% to ≤7B, the 15 most-downloaded models are almost all sub-1B embedding and encoder models, and CPU-native tasks (embeddings, ASR, classification) account for nearly half of all downloads. The vast majority of inference workloads people actually run never needed a GPU — see The CPU-First Case, in Hub Data for every figure with its reproducible query.
This list covers CPU inference as the universal deployment target — the platform you already have on every server, laptop, phone, and edge device. It also covers NPU (Neural Processing Unit) inference as a companion on-device path: modern phones and laptops ship dedicated AI silicon (Apple Neural Engine, Qualcomm Hexagon, Intel NPU, AMD XDNA) that can run quantized models more efficiently than the CPU. NPU coverage is included with the caveat that NPUs are vendor-locked, have immature LLM tooling, and often underperform CPU on generative workloads due to memory-bandwidth limits — the CPU path remains the most portable and frequently the fastest option for LLM inference on mobile today.
And now the agentic wave has made the CPU indispensable: tool calling, deterministic code execution, orchestration loops, and KV-cache management all run on the CPU — even when GPUs handle model inference. No accelerator can replace the CPU as the control plane for AI.
This list is for engineers who want to question that GPU default and reach for the right tool instead of the expensive one. The list is GPU-skeptical, not GPU-hostile; the When You Actually Do Want a GPU section below is load-bearing, not decorative. NPU content is marked with a 🧠 icon where applicable.
See CHANGELOG for the full history.
Want to help shape the next release? There are
good first issuetasks waiting for a contributor.
Three paths from zero to CPU inference — no GPU, no CUDA, no container: llamafile (desktop, zero install), ollama (server / CLI), or WebLLM (browser, WebAssembly). All three are listed with source links under Runtimes and Inference Engines below.
See docs/quickstart.md for the full walkthroughs with copy-paste commands and sample code.
| Dimension | Lean CPU | 🧠 Lean NPU (on-device) | Lean GPU |
|---|---|---|---|
| Workload type | Inference | Inference (small quantized models) | Training, fine-tuning |
| Model size | ≤ 13B params (quantized) — covers ~60% of HF models | ≤ 3B params (INT8/INT4) — NPU memory is limited | 70B+ params, dense/unquantized — covers < 8% of models |
| Throughput need | Low-to-medium (single-digit req/s) | Low (single-stream, real-time) | High (hundreds of req/s, batched) |
| Batch size | Batch = 1 or small ad-hoc bursts | Batch = 1 (NPU designed for single-stream) | Large, sustained batched serving |
| Latency SLA | Relaxed (100 ms–2 s TTFT tolerable) | Low (10–50 ms for small models) | Tight (< 50 ms TTFT on large models) |
| Context length | Short-to-medium (≤ 8 K tokens) | Short (≤ 2 K tokens on most NPUs) | Very long (32 K+ tokens, prefill-heavy) |
| Deployment target | Edge, on-device, serverless, SBC | Phone, laptop, IoT (vendor-specific silicon) | Dedicated inference cluster |
| Cost / availability | CPU instances are ubiquitous; no VRAM cap | Free (already in device); vendor-locked toolchain | GPU instances cost 5–20× more; VRAM is a hard ceiling |
| Modality | Text, embeddings, small audio | Vision (classification, detection), small ASR | Real-time diffusion, video generation, large vision models |
| Portability | Universal — same model runs anywhere | Vendor-locked — Qualcomm QNN, Apple ANE, Intel NPU differ | Cross-vendor (CUDA, ROCm) but hardware-specific |
flowchart TD
A([New inference workload]) --> B{Model size\nafter quantization?}
B -- "≥ 70 B params\nor > 24 GB VRAM needed" --> GPU_SIZE["⛔ GPU\nVRAM requirement alone\nforces the choice"]
B -- "≤ 13 B params\nfits quantized in RAM" --> C{Throughput\nrequirement?}
C -- "Hundreds of req/s\nor large sustained batches" --> GPU_TPUT["⛔ GPU\narithmetic throughput\nis decisive at scale"]
C -- "Single-digit req/s\nor batch = 1" --> D{TTFT latency\nSLA?}
D -- "< 50 ms TTFT required" --> GPU_LAT["⛔ GPU\nmemory bandwidth needed\nfor large-model latency"]
D -- "100 ms – 2 s\nTTFT acceptable" --> E{Context\nlength?}
E -- "> 32 K tokens\nprefill-heavy" --> GPU_CTX["⛔ GPU\nprefill is a large\nmatrix multiply"]
E -- "≤ 8 K tokens" --> F{Deployment\ntarget?}
F -- "Edge / SBC / mobile\nbrowser / offline" --> I{NPU available\non device?}
I -- "Yes (phone / AI PC)" --> NPU["🧠 NPU\nQNN · Core ML ANE\nOpenVINO NPU · ExecuTorch NPU"]
I -- "No / vendor lock-in\nconcerns" --> CPU_EDGE["✅ CPU\nllama.cpp · ncnn\nExecuTorch · TFLite"]
F -- "Cloud / on-prem server" --> G{Traffic\npattern?}
G -- "Sporadic / bursty\n< 10 req/min average" --> CPU_SLS["✅ Serverless CPU\nLambda arm64 · Fly.io\nModal CPU — pay per use"]
G -- "Sustained load" --> H{GPU utilization\nif you provisioned one?}
H -- "Idle > 50 % of the time" --> CPU_IDLE["✅ CPU\nidle CPU instance\ncosts less than idle GPU"]
H -- "Busy > 50 % of the time" --> GPU_ECON["⛔ GPU\n$/token favours GPU\nat high sustained load"]
style NPU fill:#1a237e,color:#fff,stroke:#1a237e
style CPU_EDGE fill:#1b5e20,color:#fff,stroke:#1b5e20
style CPU_SLS fill:#1b5e20,color:#fff,stroke:#1b5e20
style CPU_IDLE fill:#1b5e20,color:#fff,stroke:#1b5e20
style GPU_SIZE fill:#7f1d1d,color:#fff,stroke:#7f1d1d
style GPU_TPUT fill:#7f1d1d,color:#fff,stroke:#7f1d1d
style GPU_LAT fill:#7f1d1d,color:#fff,stroke:#7f1d1d
style GPU_CTX fill:#7f1d1d,color:#fff,stroke:#7f1d1d
style GPU_ECON fill:#7f1d1d,color:#fff,stroke:#7f1d1d
🔍 Missing something? If a CPU-native runtime, benchmark, or deployment guide belongs here, open a suggestion.
First-timer? Issues taggedgood first issueare the quickest way to contribute — low effort, high impact.
Also checkhelp wantedfor bigger gaps.
.tflite models via WebAssembly (CPU, XNNPACK backend) or WebGPU with zero server dependency, supporting INT8 quantized models on the CPU path.coremltools target the ANE for vision and small LLMs. CPU/GPU fallback for unsupported ops. (Core ML ANE deployment)Runtime comparison at a glance
| Runtime | Native Format | CPU Arch | OS |
|---|---|---|---|
| llama.cpp | GGUF | x86, ARM, RISC-V | Linux, macOS, Windows |
| bitnet.cpp | GGUF (I2_S / TL) | x86, ARM | Linux, macOS, Windows |
| Project Zero | BitNet 1.58-bit | x86, ARM (no SIMD) | Linux, macOS, Windows |
| ArcLight | GGUF | x86 (NUMA) | Linux |
| MojoLlama | GGUF | x86, ARM (Mojo MAX) | Linux, macOS |
| cpubrrr | GGUF | ARM (NEON/SME) | macOS (Apple M4) |
| Ferrite | GGUF | x86, ARM | Linux, macOS, Windows |
| Reame | GGUF | x86, ARM | Linux, macOS, Windows |
| ONNX Runtime | ONNX | x86, ARM, WebAssembly | Linux, macOS, Windows |
| OpenVINO | OpenVINO IR | x86 | Linux, Windows |
| ncnn | ncnn | x86, ARM, RISC-V | Linux, Windows, Android |
| MNN | MNN | x86, ARM | Linux, Windows, Android, iOS |
| candle | GGUF, safetensors | x86, ARM | Linux, macOS, Windows |
| colibri | safetensors (custom) | x86, ARM | Linux, macOS, Windows |
| kimi-k3-in-c | mxfp4 (custom) | x86 (AVX2) | Linux |
| midge | custom (packed, mxfp4) | x86, ARM | Linux, macOS |
| hummingbird | GGUF, safetensors | x86, ARM | Linux, macOS |
| distributed-llama | Q40 / Q80 | x86, ARM | Linux, macOS, Windows |
| eLLM | safetensors | x86 (AMX required) | Linux |
| Transformers.js | ONNX | WebAssembly | Browser |
| WebLLM | MLC | WebAssembly, WebGPU | Browser |
| LiteRT.js | TFLite | WebAssembly, WebGPU | Browser |
| ExecuTorch | ExecuTorch | x86, ARM | Linux, Android, iOS |
| TensorFlow Lite (LiteRT) | TFLite | x86, ARM | Linux, Windows, Android, iOS |
| Intel Ext. for Transformers | PyTorch, ONNX | x86 | Linux, Windows |
| TinyChatEngine | AWQ (W4A16) | x86, ARM, CUDA | Linux, macOS, Windows |
| whisper.cpp | GGUF | x86, ARM | Linux, macOS, Windows |
🧠 NPU runtimes at a glance
| Runtime | NPU Target | Format | OS / Platform |
|---|---|---|---|
| Qualcomm QNN | Hexagon NPU | QNN C++ / TFLite | Android (Snapdragon) |
| Qualcomm GenieX | Hexagon NPU / Adreno GPU / CPU | GGUF | Snapdragon: Android, Windows ARM64, Linux IoT |
| Apple Core ML (ANE) | Apple Neural Engine | Core ML (.mlmodel) | iOS, macOS, visionOS |
| OpenVINO NPU plugin | Intel NPU | OpenVINO IR | Windows, Linux (Meteor Lake+) |
| AMD Vitis AI / XDNA | AMD XDNA NPU | ONNX | Windows (Ryzen AI) |
| ExecuTorch (NPU backends) | Qualcomm / MediaTek | ExecuTorch | Android |
| MediaTek NeuroPilot | MediaTek NPU | ONNX / TFLite | Android (Dimensity) |
| Samsung ENN | Samsung NPU | ENN | Android (Exynos) |
optimum[onnxruntime] and optimum-intel paths export and quantize models for CPU inference via ONNX Runtime and OpenVINO respectively.llama-quantize binary converting Hugging Face checkpoints to GGUF; covers k-quants (Q4_K_M, Q5_K_M, Q6_K) and importance-matrix–guided i-quants (IQ3_XS, IQ4_XS) that route more bits to high-impact weights — IQ4_XS saves ~400 MB vs Q4_K_M on a 7B model at comparable accuracy. Pair with --imatrix for any format below Q5_K_M..imatrix file is passed to llama-quantize and significantly improves output quality at aggressive compression ratios (IQ3_XS, IQ4_XS, Q3_K_S).--threads, --threads-batch, CPU affinity masks, and NUMA-aware memory allocation for multi-socket servers.Mixture-of-Experts (MoE) architectures are often assumed to require GPU because of their large total parameter counts, but the sparse routing mechanism — activating only a subset of experts per token — creates a different compute profile that can benefit CPU deployment. The activated parameters are typically 5–10% of total (e.g., 37B activated out of 671B total in DeepSeek-R1), so aggressive quantization brings the working set within reach of CPU instances with sufficient RAM.
A scored assessment of the CPU-first AI tooling landscape across 10 workload categories — grading every major tool on CPU-nativeness, CPU performance, architecture coverage, and adoption — to identify where the ecosystem is mature and where gaps remain. Inspired by the AI Potluck Open Source AI Gap Map (which scores openness), this map scores CPU-nativeness — the degree to which a tool is designed for CPU inference rather than treating it as a secondary fallback.
| # | Category | Stage | Gaps | Mature CPU-native tools | Best CPU-native option |
|---|---|---|---|---|---|
| 1 | LLM inference (decode) | 5 | - | 7 | llama.cpp |
| 2 | LLM prompt processing (prefill) | 4 | Architecture | 3 | ONNX Runtime GenAI |
| 3 | ASR / STT | 5 | - | 4 | whisper.cpp |
| 4 | TTS | 4 | Maturity | 3 | Piper / PocketTTS |
| 5 | Embeddings | 5 | - | 3 | sentence-transformers ONNX |
| 6 | Vision - detection & classification | 5 | - | 4 | YOLOv8 + OpenVINO |
| 7 | Vision - segmentation | 3 | Performance, Coverage | 0 | MobileSAM |
| 8 | OCR | 5 | - | 3 | PaddleOCR |
| 9 | Image generation (diffusion) | 2 | Performance, Architecture | 0 | OpenVINO Stable Diffusion |
| 10 | Fine-tuning (LoRA / QLoRA) | 3 | Performance | 1 | llama.cpp fine-tuning |
At a glance: 5 of 10 categories are at Stage 5 (mature). 2 categories carry performance gaps (segmentation, diffusion). 1 category has a void for non-x86 architectures (diffusion). Fine-tuning on CPU is viable but slow - the ecosystem needs faster CPU LoRA kernels to close the throughput gap.
Maturity stages: 5 = Mature CPU ecosystem, 4 = Competitive, 3 = Viable alternatives, 2 = Emerging, 1 = Experiments, 0 = Void.
Scoring axes: CPU-nativeness (0-5, core axis - only tools scoring >= 4 advance maturity stage), CPU performance (0-5, within-category), Architecture coverage (x86 / ARM / RISC-V / WASM grid), Adoption (1-5, GitHub stars + PyPI downloads).
See the full CPU AI Gap Map for methodology, per-category scorecards, architecture coverage grids, and gap analysis.
Tools that read your actual machine — RAM, CPU cores, and any GPU — and rank which models will realistically run and perform well on it, instead of guessing from parameter count. These are the practical first step before pulling a model: they surface CPU-only and unified-memory scenarios rather than assuming VRAM is the only constraint.
S) to override RAM/VRAM/core count for upgrade planning.See docs/cpu-native-models.md for a full catalogue of models well-suited to CPU inference — including dense ≤ 13B, MoE with high sparsity, ternary/1-bit, embedding, vision, and ASR/TTS models with recommended runtimes and measured performance ranges.
coremltools compilation; CPU/GPU fallback for unsupported ops. (Core ML ANE deployment).npy files on NVMe, keeps an LRU cache of hot experts in RAM, and uses a lightweight shadow model to predict and asynchronously prefetch the next top-K experts; runs 375 GB models (e.g. Kimi-K2.5) in 192 GB RAM. MIT. (Note: executes on Apple's Metal/MLX stack, not the CPU; included for its on-demand expert-loading and learned-prefetch approach on on-device ARM hardware.).tflite format and XNNPACK CPU backend; the browser target LiteRT.js is listed under Runtimes and Inference Engines.)Computer vision inference — object detection, classification, and segmentation — is often cheaper to run on CPU than GPU, especially in video analytics pipelines where multiple camera feeds must be processed concurrently on the same host. Modern runtimes like OpenVINO and ONNX Runtime deliver server-grade throughput for YOLO models on Intel Xeon and commodity x86 hardware.
Speech, audio, text-to-speech, and optical character recognition are among the most common production AI workloads that rarely need a GPU. Modern ASR engines run efficiently on CPU with INT8 quantization, TTS engines synthesize in real time using lightweight ONNX models, and OCR toolchains have been CPU-native for decades — with deep learning models now matching traditional engine accuracy while running on commodity x86 and ARM hardware.
Key tools: faster-whisper, whisper.cpp, transcribe.cpp, Piper, PocketTTS, PaddleOCR, Tesseract, MobileSAM, rembg, InsightFace.
See docs/multimodal-cpu.md for the full catalogue — ASR/STT, audio embeddings, VAD/diarization, TTS, text embeddings, document classification, OCR, image classification, segmentation, generation, background removal, and face analysis with baseline CPU latency and throughput figures.
Cloud instances where Arm CPUs are the primary inference platform. These are not edge devices — they are datacenter-class Arm cores with high core counts, large memory bandwidth, and SVE/NEON acceleration — and they are increasingly competitive with x86 on both throughput and cost.
Modern flagship phones run billion-parameter LLMs on-device — no cloud round-trip, no GPU required. The CPU path is the most portable, vendor-independent option for mobile inference: it works across all devices regardless of NPU vendor lock-in, and for LLMs it often matches or exceeds NPU throughput due to more mature tooling and the memory-bandwidth-bound nature of token generation. 🧠 NPU inference is available on most flagship SoCs (Apple ANE, Qualcomm Hexagon, MediaTek NPU, Samsung ENN) but is vendor-locked: a model compiled for one NPU SDK (QNN, Core ML ANE, NeuroPilot) will not run on another without recompilation. NPU performance varies significantly — Qualcomm's Hexagon NPU achieves 12–25 tok/s for 7B INT4 on Snapdragon 8 Elite via QNN, while Apple's ANE is primarily optimized for vision and small models. For generative LLMs, CPU frequently matches or beats NPU throughput on current hardware. Aggressive ternary/1-bit quantization is pushing this further: PrismML reports its 1-bit Bonsai 27B (~3.9 GB) running a 27B-class model on an iPhone 17 Pro CPU at ~11 tok/s — see Ternary / 1-bit models. (vendor-reported; last verified: 2026-07)
Key platforms (🧠 = NPU present): 🧠 Apple A19 Pro (16-core ANE, ~35 TOPS), 🧠 Snapdragon 8 Elite (Hexagon NPU, ~60 TOPS), 🧠 Exynos 2500 (59 TOPS NPU), 🧠 Dimensity 9500 (NPU 890, ~50 TOPS), 🧠 Tensor G5 (TPU, NPU path experimental).
On-device apps: Off Grid AI (OGAM) — MIT-licensed cross-platform offline AI suite for Android, iOS, and macOS (React Native) running GGUF LLMs via llama.cpp on CPU with optional OpenCL/Metal GPU and experimental Snapdragon NPU acceleration, plus on-device vision (SmolVLM/Qwen3-VL), Whisper STT, Stable Diffusion image generation, tool calling, MCP, and local-network OpenAI-compatible servers; fully offline with per-model RAM management; PocketPal AI — open-source (MIT, 7.6k★) cross-platform chat app running GGUF models on CPU/GPU/NPU with on-device TTS, tool use, and Hugging Face integration; PocketLFM — Android app for Liquid AI's LFM2.5 models on CPU via llama.cpp; PrivateFoundationModels — Swift package unifying Apple FoundationModels, Core ML, and MLX for on-device LLMs on iOS/macOS.
See docs/mobile-cpu-inference.md for the full catalogue — chipsets, runtimes (MLC-LLM, Apple Core AI, llama.cpp Android, Qualcomm AI Hub, Arm SME2/KleidiAI), end-user apps, and benchmarks (State of the Union 2026, Beebom, CraftRigs) with tok/s and thermal measurements.
The short version. At sustained batch=32 load a GPU has a ~40× $/token advantage on Llama-3 8B. The CPU economic case rests on three factors that table does not capture:
A worked production example (1 req/s, 730 hrs/month, 7B Q4) shows CPU saves $5,740/yr on a c7g.2xlarge vs g5.xlarge — the gap closes only after GPU utilization exceeds ~50%.
See docs/cost-calculator.md for the full cost-per-token table, TCO worked example, pricing reference, break-even formula, and a runnable bash calculator script.
This section is load-bearing. The CPU-first default breaks down in the following real scenarios — reaching for a GPU here is the right call, not a failure of discipline.
High-throughput batched serving at scale. When serving hundreds of concurrent requests with large batch sizes, GPU memory bandwidth dominates and arithmetic throughput advantage becomes decisive. CPU cores serialize; GPU SIMT parallelism does not. Self-hosted GPU breakeven requires ≥ 50% utilization for 7B models and ≥ 10% for 13B models — below those thresholds CPU or serverless often wins on total cost; above them GPU $/token falls sharply as batch size grows. (dasroot.net, Feb 2026; methodology: arxiv:2606.11690)
Tight low-latency SLAs on large models. If your SLA requires < 50 ms time-to-first-token on a 34B+ parameter model, no current CPU can match A100/H100 memory bandwidth. The token generation phase is memory-bound; GPUs have 5–10× the off-chip bandwidth of a modern CPU.
Long-context prefill. Prefilling a 32 K+ token prompt is a large matrix multiply. This scales with context length and is exactly the workload GPUs were built for. On a 128 K-context model, CPU prefill latency can be tens of seconds — unacceptable for interactive use cases.
Real-time diffusion and video generation. Stable Diffusion and video generation models require hundreds of TFLOPS per generated frame. CPU throughput is too low for any real-time or near-real-time requirement here; this is not a quantization-fixable problem.
Continuous batching serving infrastructure. Frameworks like vLLM and TGI are purpose-built for GPU-resident KV cache management, paged attention, and continuous batching. These optimizations exist because the GPU memory hierarchy enables them; the tradeoffs do not translate cleanly to CPU.
Large multi-modal models. Vision-language models with large image encoders add substantial FLOPs to the inference path. Running these at interactive speed on models above 34B currently requires GPU for most deployment configurations.
Fine-tuning adapts a pre-trained model to a specific domain or task. While full-parameter training remains GPU territory, parameter-efficient fine-tuning (PEFT) methods — LoRA, QLoRA, DoRA — can run on CPU for small base models (≤ 7B) at moderate batch sizes, especially when the base model is pre-quantized and only adapter weights are updated. This section covers tools and patterns for fine-tuning on CPU.
.lora files loadable by llama-cli at inference time. Suited for small-scale domain adaptation (classification heads, instruction tuning on 1K–10K examples). Runs entirely on CPU with no GPU dependency at any stage.llama.cpp's export-lora for CPU serving.device="cpu" is set, though throughput is 10–50× slower than a single GPU. Practical for models ≤ 3B where training data is small (< 5K examples) and iteration time is not critical.CUDA_VISIBLE_DEVICES="" to force CPU execution.deepspeed ZeRO-3 CPU offload, keeping activations on GPU while optimizer states reside in system RAM — a hybrid approach that reduces GPU VRAM requirements for larger models.CPU fine-tuning economics in practice. Fine-tuning a Llama-3.2 3B model using LoRA on a c7g.2xlarge (8 vCPU, 16 GB RAM) with 1,000 examples for 3 epochs completes in approximately 6–12 hours depending on sequence length. The total compute cost at $0.35/hr is $2–4 per fine-tune run. The same run on a g5.xlarge GPU instance ($1.006/hr) completes in 15–30 minutes at $0.25–0.50 per run. GPU is faster and cheaper for the fine-tuning event, but the fine-tuned adapter then deploys on CPU at the inference costs documented in Cost and Deployment Economics — the overall TCO depends on how many inference queries you serve after fine-tuning.
Rule of thumb. Fine-tune on GPU when you have one (even a rented one); the time savings justify the marginal cost. Fine-tune on CPU when you have no GPU access, are iterating on a tiny dataset, or want a fully offline pipeline with no cloud dependency. The adapter format is interchangeable — LoRA weights trained on GPU load identically on CPU.
Companion documents for planning, converting, deploying, benchmarking, and troubleshooting CPU inference.
uv run streamlit run calculator/cost-calculator.py).uv run streamlit run calculator/power-calculator.py).Contributions welcome. Please read CONTRIBUTING.md first. Every entry must be:
If you are unsure whether a tool belongs, open an issue rather than a PR and describe why you think it qualifies.
To the extent possible under law, the maintainers of awesome-cpu-first-ai have waived all copyright and related or neighboring rights to this work.
Python
76.8%
HTML
23.2%