llama.cpp
TL;DR Highlight
A 1MB app installs local models and exposes an OpenAI-compatible API in one click
Who Should Read
A backend developer who wants to run existing OpenAI API code on local models with no API keys or usage bills
Core Mechanics
- Llama is a local model runner app
- Built by the llama.cpp team and Hugging Face for Mac and Windows.
- Free, open source, works offline, and is a 1 MB download.
- Linux users get a command-line version via a curl install script.
- It exposes an OpenAI-compatible local API
- It listens at localhost:9931/v1, and changing the base URL is said to be enough for existing code.
- It offers OpenAI- and Anthropic-compatible endpoints.
- Streaming, tool calling, structured output, and vision are supported.
- Settings are picked automatically
- Quantization (compressing model weights) uses the highest precision that fits in memory.
- Context size, image input, and speculative decoding (using cheap guesses to speed up generation) are also automatic.
- Batch size is larger on Macs with 32 GB or more.
- Every llama.cpp setting can still be edited in one plain-text file.
- Each model is stored once and shared
- Models live in the Hugging Face cache, shared with llama.cpp and other tools.
- Three apps with their own copies take 57 GB, versus 19 GB with Llama.
- Models load on request and unload after 5 minutes idle.
- Model suggestions are based on memory
- Macs with 16 GB or more get Gemma 4.
- 24 GB or more gets GPT-OSS, and 32 GB or more gets Qwen 3.8.
- The app installs a fitting model in one click.
Community Reactions
- llama-server already supports multiple models
- One commenter writes an ini file with per-model tuned parameters so clients just pick a model.
- They also suggest enabling ngram-mod (spec-default), calling it nearly free.
- Install tips for llama.app
- A commenter says it used to be called LlamaBarn.
- They suggest installing llama.cpp with brew first, since llama.app releases more slowly.
- Models downloaded with the hf CLI are picked up automatically.
- Stability complaints about llama.cpp
- One user on a Framework 13 says a code change broke ROCm support for the AMD GPU and stayed unfixed for nearly a month.
- They worked around it by switching to Vulkan.
- Setup experiences
- One user found llama.cpp easier to install than vLLM on an RTX 3070.
- Some are wary of curl | sh and prefer building from source.
- One user's Qwen3-4B Q4_0 server terminated while Llama-3.2-1B worked.
How to Apply
- Swap the base URL in your OpenAI code
- Install Llama today and download one model.
- Change the OpenAI SDK base URL to http://localhost:9931/v1 and use any placeholder API key.
- Check that your existing prompts return responses.
- Route only dev and test traffic to the local API
- Move the base URL into an environment variable.
- Send costly repeated test runs to a local model.
- First confirm tool calling and structured output work with your chosen model.
- Pick a model for your memory and compare quality
- Download one recommended model (Gemma 4, GPT-OSS, Qwen 3.8) that fits your Mac.
- Run 10 real prompts from your service on both your current API and the local model.
- Record the differences in a table.
Try It
# Paste into a terminal (after installing Llama and a model)
curl http://localhost:9931/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "ggml-org/gpt-oss-20b-GGUF:MXFP4",
"messages": [{"role": "user", "content": "{{question}}"}]
}'
# Next: point your existing OpenAI SDK code at http://localhost:9931/v1 by changing only the base URL.Terminology
Related Papers
A Beginner's Guide to Local AI with Inkling, Qwen, and Unsloth
Install Unsloth Desktop, load a quantized Qwen model, and share a private ChatGPT-like AI on your home LAN.
Muru – AI-assisted Rust server for Python apps by mod_WSGI's creator
mod_wsgi's creator is building Muru, an AI-assisted Rust ASGI/WSGI server, documenting it in public
87% of the Anthropic power will come from gas and 11% from coal in 2028
Analysis of Anthropic's contracted data centers: 87% gas, 11% coal power in 2028
Anthropic’s Nasdaq debut
Anthropic listed on Nasdaq and closed its first day below its opening price.
OpenAI still has a WebRTC Problem
WebRTC drops late audio, hurting voice AI; MoQ retransmits and buffers instead
Gemini 4 Neon
Gemini 4 Neon cuts cost per task 32% versus Carbon, at $3 input and $15 output per million tokens
AI is killing All About Berlin
After Google AI Overviews, a Berlin guide site lost 70-75% of its traffic.
Not Everything Needs an LLM
PostHog used small decision models to skip 98.7% of expensive LLM calls