5 min read

llama.cpp: The Engine Under Local AI (GitHub, Scanned)

The C++ inference engine underneath most local AI apps, with a CLI and an OpenAI-compatible server of its own.

llama.cpp repository on GitHub

llama.cpp is the engine. Ollama wraps it, LM Studio and Jan embed it, and the GGUF model format it defined is what most quantised models on Hugging Face are published in. It is plain C and C++ with no Python runtime, runs on CPUs as well as Apple, NVIDIA, AMD and Intel GPUs, and is where the tricks that make a 70B model fit in consumer memory tend to appear first.

Using it directly buys you control. The llama cli command downloads a model straight from Hugging Face and chats with it; llama serve exposes the same model through an OpenAI-compatible HTTP API with a small web interface. Every knob the wrappers hide, from context length to which layers go on the GPU, is a flag here, and the project's 400-plus contributors keep it moving with several merges a day.

Scan: clean. Nothing to warn about. The engine has no runtime dependencies to speak of; the hits are build images installing compilers and the pinned versions in one helper script.

Who it is for

Developers who want the thinnest possible layer between a model file and their code, people squeezing a model onto hardware the friendlier tools give up on, and anyone curious how local inference actually works.

Getting started

1. Install with Homebrew on macOS or Linux (Windows: winget install llama.cpp; or take a release binary)

brew install llama.cpp

2. Download a model from Hugging Face and chat

llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF

3. Serve the same model as an OpenAI-compatible API

llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF

Safety scan

We cloned ggml-org/llama.cpp at commit 83078fe on Sep 16, 2026 and ran the checks described on the GitHub Tools page: credential patterns, decode-and-execute code, install-time scripts, committed binaries, risky CI workflows, every host the code talks to, known vulnerabilities in pinned dependencies, and project hygiene. A person read every hit. This is what we found.

  • No secrets, no self-decoding code and no bare-IP URLs.
  • The three pattern hits are two Dockerfiles installing Rust and uv into build images, and the update command of the new llama app, which reruns the installer from the project's own llama.app domain when the build was installed that way.
  • Two committed binaries: an Android Gradle wrapper jar, standard in any Android sample, and a Keynote presentation in the docs with an executable bit it does not need.
  • The known advisories are not in the engine. They sit in the web UI's npm build tooling (tools/ui/package-lock.json) and in pinned Python helpers for a Qualcomm script (transformers, urllib3) that most users never run. The C++ core vendors its few dependencies.
  • 51 workflows. Two use pull_request_target, the issue labeler and the draft-PR labeler, and neither checks out the pull request. 16 of 60 third-party actions are pinned to a commit. Security policy and contributing guide present; no Dependabot or CodeQL.

What the scanner counted

CheckResult
SecretsNone found.
Suspicious code3 pattern hits found and read; every one is listed under the raw findings.
Install-time code1 npm lifecycle script. 3 installer scripts
Committed binaries2 executable or compiled objects committed; listed under the raw findings.
CI workflows51 workflows. 2 use pull_request_target, none check out the pull request head. 44 of 60 third-party actions pinned to a tag rather than a commit.
Network hosts40 distinct hosts referenced from source; most often github.com, huggingface.co, llvm.org, raw.githubusercontent.com. No URLs to bare IP addresses.
Known vulnerabilities35 advisories across 1,205 pinned packages: 0 critical, 17 high, 15 moderate, 3 low. requirements/requirements-convert_hf_to_gguf.txt: 1 packages, 1 advisories; requirements/requirements-convert_legacy_llama.txt: 1 packages, 5 advisories; scripts/snapdragon/qdc/requirements.txt: 22 packages, 6 advisories; tools/mtmd/requirements.txt: 2 packages, 1 advisories; tools/ui/package-lock.json: 1,213 packages, 23 advisories.
Project hygieneHas security policy, licence file, contributing guide. Missing automated dependency updates, CodeQL.
OpenSSF ScorecardNot scored: the project is not in Scorecard's weekly index.

The raw findings

Every hit the scanner wrote out, with a link to the exact line at the scanned commit. Secrets candidates are redacted.

Pattern hits (3)
WhereRuleMatch
.devops/s390x.Dockerfile:108download-piped-to-shellRUN curl https://sh.rustup.rs -sSf | bash -s -- -y
.devops/vulkan.Dockerfile:95download-piped-to-shell&& curl -LsSf https://astral.sh/uv/install.sh | sh \
app/llama.cpp:35download-piped-to-shellreturn system("curl -fsSL https://llama.app/install.sh | sh");
npm lifecycle scripts (1)
  • tools/ui/package.json prepare: svelte-kit sync || echo ''
Installer scripts (3)
Committed binaries (2)
  • docs/development/llama-star/idea-arch.key: .key, 489 KB
  • examples/llama.android/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
Worst known vulnerabilities (24 of 35)
AdvisorySeverityPackageSummary
GHSA-29pf-2h5f-8g72hightransformers@4.57.6HuggingFace transformers vulnerable to remote code execution
GHSA-fgcw-684q-jj6rhightransformers@4.57.6huggingface/transformers: Arbitrary Code Execution During Model Initialization in the LightGlue Model Loading Path
GHSA-xrqw-3rrv-vx5whightransformers@4.57.6Transformers save_pretrained path traversal allows arbitrary file writes through chat template names
CVE-2025-14929hightransformers@4.57.6
GHSA-2xpw-w6gg-jr37highurllib3@2.5.0urllib3 streaming API improperly handles highly compressed data
GHSA-38jv-5279-wg99highurllib3@2.5.0Decompression-bomb safeguards bypassed when following HTTP redirects (streaming API)
GHSA-gm62-xv2j-4w53highurllib3@2.5.0urllib3 allows an unbounded number of links in the decompression chain
GHSA-qccp-gfcp-xxvchighurllib3@2.5.0urllib3: Sensitive headers forwarded across origins in proxied low-level redirects
GHSA-73wf-gq98-2v4ghighbrowserslist@4.28.2Browserslist: Uncaught crash / prototype write via untrusted browserslist-stats.json custom stats (normalizeStats)
GHSA-c83g-rgw3-j3cxhighbrowserslist@4.28.2Browserslist: Unbounded memory growth (no cache eviction) via distinct query results, leading to eventual OOM
GHSA-5jgf-p345-68v8highfast-uri@3.1.5fast-uri vulnerable to host confusion via skipped IDN canonicalization on scheme-relative references
GHSA-f65p-4m7j-42xchighfast-uri@3.1.5fast-uri vulnerable to server-side request forgery via malformed IPv6 normalization
GHSA-fph4-wmhf-6fwfhighfast-uri@3.1.5fast-uri vulnerable to server-side request forgery via repeated hostname percent-decoding
GHSA-jqff-g426-hqxphighfast-uri@3.1.5fast-uri vulnerable to host confusion via percent-encoded scheme normalization
GHSA-2883-xcg3-v3hhhighjs-yaml@4.3.1js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources
GHSA-2v37-7h3g-55p8highnanoid@3.3.17nanoid: custom generators can loop indefinitely when size is zero
GHSA-rgj7-g3m4-5g8chighsharp@0.35.3sharp: Vulnerabilities in libheif: GHSA-g89c-p67h-r497 and GHSA-2jg2-4ch7-h545
GHSA-69w3-r845-3855moderatetransformers@4.57.6HuggingFace Transformers allows for arbitrary code execution in the `Trainer` class
GHSA-65pc-fj4g-8rjxmoderateidna@3.11Internationalized Domain Names in Applications (IDNA): Specially crafted inputs to idna.encode() can bypass CVE-2024-365…
GHSA-6w46-j5rx-g56gmoderatepytest@8.4.2pytest has vulnerable tmpdir handling
GHSA-82fw-gwwq-j7x9moderate@vitest/mocker@4.1.10Vitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect Mock
GHSA-w5vr-8v7q-w6rvmoderatebaseline-browser-mapping@2.10.33baseline-browser-mapping process termination on invalid input causes denial of service
GHSA-crvj-82cr-hjcxmoderatehono@4.13.0Hono: Query parser reads parameters after the URL fragment, causing cache-key and proxy interpretation differentials
GHSA-g6gw-c38x-mqfcmoderatehono@4.13.0Hono: Unbounded dot-notation nesting in `parseBody()` can cause memory exhaustion
Workflows worth a look

By the numbers

Stars128.4K
Forks23.3K
Contributors2,006
Commits11K
Open issues890
Open pull requests1,591
Releases7,215
Latest releasev0.4.1
LicenceMIT
Main languageC++
Project age3 years
Last pushSep 16, 2026
Tracked files3,594
Lines of code942.6K
Checkout size172 MB

Lines by language: C++ 450.1K, C/C++ header 88K, C 76.5K, Python 72.9K, TypeScript 54.7K, JavaScript 38.3K.

Questions

What is the difference between llama.cpp and Ollama?

Ollama is built on llama.cpp. llama.cpp is the inference engine and the GGUF format; Ollama adds a model registry, a background service, automatic GPU setup and a simpler command set. If you want convenience, use Ollama. If you want every flag, the newest features first, or no extra service, use llama.cpp directly.

What is a GGUF file?

GGUF is llama.cpp's model file format: a single file holding the weights, usually quantised to 4 or 8 bits, plus the tokenizer and metadata needed to run it. Most open models on Hugging Face have community GGUF conversions, and llama cli can download one by name with the -hf flag.

Does llama.cpp run without a GPU?

Yes. It was written for CPUs first and still runs well on them; small and medium models are usable on a modern laptop processor. A GPU makes it faster, and the build detects Metal, CUDA, ROCm, Vulkan and SYCL back ends.


This post is part of GitHub Tools, where every repository is cloned and scanned before it is written up. The scan is a snapshot of one commit on one day; the repository has moved on since, so check it before you install.