# ggml-easy

A header-only C++ wrapper around GGML that simplifies loading GGUF or safetensors models, building computation graphs, and running them on CPU or GPU.

ggml-easy is a header-only C++ library that wraps GGML, the tensor library behind projects such as llama.cpp, to reduce the boilerplate needed to load a model and run it. It handles GPU scheduler and buffer setup automatically, with GPU support enabled by default and a fallback to CPU for operations the GPU cannot run.

It can load `.safetensors` files directly, without first converting them to GGUF, currently for F32, F16 and BF16 tensors, and lets tensors be renamed on load to fit GGML's 64-character name limit. Building a computation graph is done by declaring input and output nodes in a single line each.

It ships with example programs covering basic usage and loading GGUF alongside safetensors for comparison, and it includes helpers for printing intermediate tensor values while debugging a graph.

Website: https://github.com/ngxson/ggml-easy
