# ggml

> Tensor library for machine learning

- Type: agent or tool
- Field: ML & AI
- Repository: https://github.com/ggml-org/ggml
- GitHub stars: 16189
- Licence: MIT
- Language: C++
- Last push: 2026-11-23
- Page: https://imutechz.in/agents/ggml

## What it is
ggml is a tensor library for machine learning written in plain C/C++. It aims to be simple, portable and efficient with minimal setup, and runs across x86, ARM, RISC-V, LoongArch, PowerPC, s390x and WebAssembly. It provides SIMD-optimized kernels and broad backend support for CPU, GPU, NPU and browser, with integer quantization formats and zero memory allocations during runtime.

## Features
- Plain C/C++ implementation without dependencies
- Cross-platform: x86, ARM, RISC-V, LoongArch, PowerPC, s390x, WebAssembly
- SIMD-optimized kernels for x86, ARM and RISC-V
- Backends for CPU, GPU, NPU and browser
- 2- to 8-bit integer quantization plus MXFP4 and NVFP4 formats
- Zero memory allocations during runtime

## Best for
- Running tensor operations in C/C++ projects
- Building ML inference on many hardware platforms
- Working with quantized model weights
- Embedding tensor compute in browser or GPU backends

## Pros
- No external dependencies
- Portable across many CPU architectures and WebAssembly
- Quantization down to 2-bit plus microscaling formats
- No runtime memory allocations

## Cons
- Built from source with CMake; no package install command given
- Core library changes are directed to the llama.cpp repository rather than this repo

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

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

Tags: ggml, tensor-library, machine-learning, cpp, quantization, cross-platform, inference
