| title | llama.cpp ctypes Bindings |
|---|---|
| module_name | llama_cpp.llama_cpp |
| source_file | llama_cpp/llama_cpp.py |
| last_updated | 2026-10-13 |
| version_target | latest |
The low-level Python bindings for llama.cpp and ggml are maintained directly
in the source tree. Because this interface follows the bundled native code, the
source files are the authoritative and most current reference.
Refer to the following files according to the level of API you need:
llama_cpp/llama_cpp.pyfor the direct Python bindings corresponding to thellama.cppC API.llama_cpp/_ggml.pyfor the direct Python bindings and shared definitions corresponding to ggml.llama_cpp/_internals.pyfor the managed internal Python wrappers built on top of those bindings.llama_cpp/llama.pyfor the high-level publicLlamainterface used by applications.
For the native declarations against which these bindings are maintained, refer
to the headers under vendor/llama.cpp. General
application usage is documented in Llama.
For managed internal batch builders and their native conversion paths, see
Llama Batch.