Text & LLMsOpen source codeggml-org/llama.cpp

llama.cpp: Open Source AI Repository & Self-Hosting Guide

Foundational C/C++ local LLM inference engine powering GGUF quantized models across Apple Silicon Metal, NVIDIA CUDA, Vulkan, AMD ROCm, and CPU.

GitHub Stars
137,229 stars
Repository License
MIT
Last Push (UTC)
Dec 4, 2026
Check the repo's license. Model weights may have a different license.
git clone https://github.com/ggml-org/llama.cpp.git
View on GitHub
Installbrew install llama.cpp && llama-server -hf Qwen/Qwen2.5-7B-Instruct-GGUF:Q4_K_M

llama.cpp: Architecture & Practical Workflow

llama.cpp implements dependency-free C/C++ tensor kernels (ggml) and GGUF quantization (Q4_K_M, Q8_0, IQ4_XS), bundling `llama-server` (OpenAI-compatible REST API), `llama-cli`, speculative decoding, and hybrid CPU+GPU layer offloading.

Recommended End-to-End Pipeline

Run `llama-server` with a Q4_K_M GGUF checkpoint on MacBook unified memory or modest consumer GPUs and connect LibreChat, Tabby, or Cline via localhost.

Runtime Target
Self-Hosted / C++ (GitHub)
Primary Users
Developers, Privacy-minded users
Code License
MIT
Focus Topics
open-source, github, local-llm, inference, self-hosted

Quick Setup & Installation Steps

Platform target: Self-Hosted / C++ (GitHub). Always verify environment variables and dependencies in the upstream repository README.

  1. 1Clone the repository from GitHub: `git clone https://github.com/ggml-org/llama.cpp.git && cd llama.cpp`.
  2. 2Review the MIT license (Check the repo's license. Model weights may have a different license.) and note any separate terms on external model weights.
  3. 3Install or launch the project directly: `brew install llama.cpp && llama-server -hf Qwen/Qwen2.5-7B-Instruct-GGUF:Q4_K_M` (use an isolated Python virtualenv, Node workspace, or Docker volume so dependencies remain clean).
  4. 4Validate end-to-end behavior with a small sample input (Run `llama-server` with a Q4_K_M GGUF checkpoint on MacBook unified memory or modest consumer GPUs and connect LibreChat, Tabby, or Cline via localhost.)

Hardware & VRAM Notes

Designed primarily for local or cloud GPU acceleration. Model weight size and batch resolution directly determine memory usage.

GPU & VRAM

CUDA-capable GPU or Apple Silicon (MPS) recommended for fast inference; smaller quantized checkpoints reduce VRAM pressure.

System RAM & Storage

16 GB–32 GB system RAM recommended plus 10 GB–40 GB free SSD space for container images, Python dependencies, and model weights.

Runtime Target

Self-Hosted / C++ (GitHub)

Strengths & Best For

  • Runs on CPU and GPU
  • Quantised model support
  • Command line and server mode
  • Best suited for: Developers, Privacy-minded users

Limitations & Caveats

  • Technical setup
  • Model licenses are separate from the code license
  • Check the repo's license. Model weights may have a different license.

3 Similar Tools on /tools (Text)

Prefer a hosted web app instead of managing local weights or Docker containers? Explore these cloud alternatives.

Browse all tools
Self-Hosted llama.cpp vs. Hosted Alternatives (Open WebUI & Jan)
Factorllama.cpp (Self-Hosted)Open WebUIJan
Execution & PrivacyRuns locally via Self-Hosted / C++ (GitHub); data stays on your disk or private server.Hosted cloud web interface; zero local dependency setup required.Hosted cloud web interface; zero local dependency setup required.
Cost & QuotaMIT code; bound only by local CPU/GPU hardware.Open Source; subject to vendor free-tier limits or paid plans.Open Source; subject to vendor free-tier limits or paid plans.
Primary FitRuns on CPU and GPU; Quantised model supportExtensible self-hosted ChatGPT-style web interface for Ollama and OpenAI-compatible local or cloud LLMs with built-in RAG.100% offline, open-source desktop AI assistant that runs local GGUF models cleanly on Mac, Windows, and Linux.
Key Trade-offTechnical setupRequires internet access and vendor account/quota limits.Requires internet access and vendor account/quota limits.

Matching Ready-Made Prompts

All Prompts →

Customize variables in Live Prompt Studio for llama.cpp workflows.

High-Open B2B Cold Email SequenceCopywriting · Sales, Cold Email, Outreach, B2B
Open in Studio
B2B Cold Email That Gets 40%+ RepliesCopywriting · Low-Friction B2B Outreach
Open in Studio
LinkedIn Thought Leadership: Why We Killed Data Entry OutsourcingCopywriting · LinkedIn, Thought Leadership, Founder, B2B
Open in Studio

Compare Alternatives

Compare Engine →

Compare llama.cpp side-by-side on setup ease, privacy, and role scorecards.

More Open Source Text & LLMs Repositories

Frequently Asked Questions

What does llama.cpp do and how does it work?

llama.cpp (ggml-org/llama.cpp) is an open-source text & llms project with 137,229 stars on GitHub. Foundational C/C++ local LLM inference engine powering GGUF quantized models across Apple Silicon Metal, NVIDIA CUDA, Vulkan, AMD ROCm, and CPU. llama.cpp implements dependency-free C/C++ tensor kernels (ggml) and GGUF quantization (Q4_K_M, Q8_0, IQ4_XS), bundling `llama-server` (OpenAI-compatible REST API), `llama-cli`, speculative decoding, and hybrid CPU+GPU layer offloading.

Is llama.cpp free to self-host and use commercially?

llama.cpp provides open source code licensed under MIT. Check the repo's license. Model weights may have a different license. Always verify both source code and model weight licenses in the GitHub repository before commercial deployment.

What hardware, runtime, or VRAM does llama.cpp require?

llama.cpp targets Self-Hosted / C++ (GitHub). Typical installation runs via `brew install llama.cpp && llama-server -hf Qwen/Qwen2.5-7B-Instruct-GGUF:Q4_K_M`. Technical setup

How does self-hosting llama.cpp compare to hosted tools like Open WebUI?

Self-hosting llama.cpp gives you full local data control, zero per-usage vendor fees, and customizable Self-Hosted / C++ (GitHub) pipelines—at the cost of managing your own setup and compute. By contrast, Open WebUI (Open Source) runs in the browser with no local installation, though usage quotas and cloud privacy policies apply.

Is llama.cpp actively maintained and what workflow fits it best?

Repository metadata records 137,229 stars on GitHub with the latest recorded push on Dec 4, 2026. Run `llama-server` with a Q4_K_M GGUF checkpoint on MacBook unified memory or modest consumer GPUs and connect LibreChat, Tabby, or Cline via localhost.