ggml README

The project's README from github.com/ggml-org/ggml. As one markdown file: README.md.

ggml

ggml logo

Tensor library for machine learning

License: MIT Release CI

Quick start

Build from source:

git clone https://github.com/ggml-org/ggml
cd ggml

mkdir build && cd build
cmake ..
cmake --build . --config Release -j 8

For a minimal, fully commented example (matrix multiplication), see examples/simple.

Description

The main goal of ggml is to be a simple, portable, and efficient tensor library for machine learning with minimal setup.

Documentation

Contributing

ggml (ggml-org/ggml)

simd
Searching Database…

15.5K ·GitHub
What is this?ggml is a plain C/C++ tensor library built for running machine learning models with minimal setup, no external dependencies, and support for CPU, GPU, NPU, and browser backends. It's the core engine that powers projects like llama.cpp.
Is this a standalone app or a library I build on top of?It's a low-level C/C++ tensor library, not an application — you link it into your own project or use it through tools like llama.cpp that embed it.
How do I build it?You build ggml from source; the repo includes a minimal, fully commented matrix-multiplication example in examples/simple to get started.
Do I need any external libraries to use it?No — ggml is implemented in plain C/C++ with zero external dependencies.
Can I submit changes directly to this repo?Yes, but changes to the core ggml library (including the CMake build system) are expected to go through the llama.cpp repo instead, since that gets more visibility, testing, and review.
What hardware and platforms does it run on?ggml runs across x86, ARM, RISC-V, LoongArch, PowerPC, and s390x CPUs plus WebAssembly, with backend support for CPU, GPU, NPU, and even inside the browser.
What quantization formats does ggml support?It supports 2- to 8-bit integer quantization plus the newer MXFP4 and NVFP4 microscaling formats, letting models run in much less memory.
Does ggml allocate memory while running?No — it's designed for zero memory allocations during runtime, which keeps inference predictable and fast.
What is GGUF and where can I learn the internals?GGUF is ggml's model file format; the docs also cover an 'Introduction to ggml' overview and a 'GGML tips & tricks' guide for working with the library.
Why is ggml often mentioned alongside llama.cpp?llama.cpp is built on top of ggml as its tensor backend, and ggml's own maintainers route core-library contributions back into the llama.cpp repo for review.
Creator
ggml-org
Size
34.9 MB
Stars
15.5K
Age
4y
Commits · 90 Days