llama-cpp-python
Python bindings for the llama.cpp library
Decision gist · record as of 2026-08-14
Yes, with conditions. Install if you need local language model inference with hardware acceleration and can handle a non-trivial build process. The package is actively maintained, has no known vulnerabilities, and integrates well with popular frameworks. However, expect high install friction due to C compilation requirements—use pre-built wheels where available to reduce setup complexity. Not recommended if you need a quick, zero-configuration solution.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a C compiler (gcc/clang on Linux, Visual Studio/MinGW on Windows, Xcode on macOS) and a compatible GGUF-format model file; build may fail without proper toolchain configuration.
- Installation requires a C compiler and builds llama.cpp from source, which is computationally intensive and may fail without proper toolchain setup.
- Pre-built wheels are available for multiple backends to reduce build friction.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial use, modification, and distribution with minimal restrictions, making it suitable for proprietary projects.
last release 2026-07-12 (33 days) · last repo commit 2026-08-10 · 10,551 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 732,904 downloads/mo, #5,200 on PyPI
Alternatives
Verify before relying
pip install llama-cpp-python
from llama_cpp_python import Llama
llm = Llama(model_path="/path/to/model.gguf")
response = llm("Hello, how are you?")- Whether pre-built wheels significantly reduce installation time compared to source builds
- Performance characteristics across different hardware backends (CPU vs CUDA vs Metal vs ROCm)
- Memory requirements for running models of different sizes
- Latency and throughput benchmarks for typical inference workloads
What it is and what it does
llama-cpp-python wraps the llama.cpp C library to bring efficient local language model inference to Python. It provides both a low-level ctypes interface to the C API and a high-level Python API that mimics OpenAI's completion endpoints, making it easy to integrate into existing workflows. The package supports multiple hardware acceleration backends including CUDA, Metal, ROCm, Vulkan, and CPU-only inference, with pre-built wheels available to avoid compilation overhead.
The library is designed for developers who want to run large language models on their own hardware without cloud dependencies. It includes an OpenAI-compatible web server for local API access, function calling support, vision model capabilities, and multi-model serving. Installation requires a C compiler and can be complex depending on your target hardware backend, but active maintenance and comprehensive documentation help mitigate setup friction.
Use it for
- Run private language models locally without sending data to cloud APIs
- Build OpenAI-compatible applications that work offline or on restricted networks
- Integrate local inference into existing application frameworks for RAG or agent workflows
- Deploy a local code completion server for development environments
- Serve multiple models simultaneously via the built-in web server for multi-tenant inference
- Accelerate inference on specific hardware (GPU, Apple Silicon) for production workloads
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Install if you need local language model inference with hardware acceleration and can handle a non-trivial build process. The package is actively maintained, has no known vulnerabilities, and integrates well with popular frameworks. However, expect high install friction due to C compilation requirements—use pre-built wheels where available to reduce setup complexity. Not recommended if you need a quick, zero-configuration solution.
Install
llama-cpp-python on PyPI
Before you install
Installation requires a C compiler and builds llama.cpp from source, which is computationally intensive and may fail without proper toolchain setup. Pre-built wheels are available for multiple backends to reduce build friction. The package is actively maintained with recent releases.
Requires a C compiler (gcc/clang on Linux, Visual Studio/MinGW on Windows, Xcode on macOS) and a compatible GGUF-format model file; build may fail without proper toolchain configuration.
License in practice
MIT license permits commercial use, modification, and distribution with minimal restrictions, making it suitable for proprietary projects.
Quickstart
pip install llama-cpp-python
from llama_cpp_python import Llama
llm = Llama(model_path="/path/to/model.gguf")
response = llm("Hello, how are you?")
Verify before relying
- Whether pre-built wheels significantly reduce installation time compared to source builds
- Performance characteristics across different hardware backends (CPU vs CUDA vs Metal vs ROCm)
- Memory requirements for running models of different sizes
- Latency and throughput benchmarks for typical inference workloads
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | High. Source build required |
| Runtime dependencies | 4 packagestyping-extensionsnumpydiskcachejinja2 |
| Maintenance | Actively maintained 33 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 732,904 / month, #5,200 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: llama_cpp_python-0.3.34.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “llama.cpp python bindings”
- llama-cpp-pythonPython bindings for llama.cpp that enable running large language…
- ggufReads and writes binary files in the GGUF (GGML Universal File)…
- ipex-llmAccelerates large language model inference on Intel hardware (GPU,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also gguf · llama-index-llms-openai-like · abstract-hugpy-dev · llama-index-llms-langchain · ipex-llm · llama-index-program-openai · sgl-kernel · sglang-kernel · llama-index-agent-openai · llama-index-multi-modal-llms-openai