#2525th of 37 in Model serving

llama-cpp-python

Python bindings and OpenAI-compatible server for llama.cpp

Stars
10.7k
License
MIT
Last commit
Oct 2026
Last release
Oct 2026
Language
Python
Stars, last 29 weeks+644
31 Mar 2026: 10,006 stars7 Apr 2026: 10,049 stars14 Apr 2026: 10,082 stars21 Apr 2026: 10,119 stars28 Apr 2026: 10,149 stars5 May 2026: 10,181 stars12 May 2026: 10,207 stars19 May 2026: 10,235 stars26 May 2026: 10,267 stars2 Jun 2026: 10,289 stars9 Jun 2026: 10,318 stars16 Jun 2026: 10,344 stars23 Jun 2026: 10,365 stars30 Jun 2026: 10,389 stars7 Jul 2026: 10,405 stars14 Jul 2026: 10,433 stars21 Jul 2026: 10,452 stars28 Jul 2026: 10,470 stars4 Aug 2026: 10,485 stars11 Aug 2026: 10,507 stars18 Aug 2026: 10,528 stars25 Aug 2026: 10,552 stars1 Sept 2026: 10,568 stars8 Sept 2026: 10,581 stars15 Sept 2026: 10,599 stars22 Sept 2026: 10,609 stars29 Sept 2026: 10,621 stars6 Oct 2026: 10,630 stars13 Oct 2026: 10,643 stars20 Oct 2026: 10,650 stars

10,006 on 31 Mar 202610,650 on 20 Oct 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

Python package that wraps llama.cpp through ctypes, with a high-level Llama class for completion and chat on GGUF models. It also ships an OpenAI-compatible web server supporting function calling, vision models and multiple models. Installation builds llama.cpp from source via pip, with CMAKE_ARGS selecting backends such as CUDA, Metal, ROCm, Vulkan, SYCL, BLAS and RPC; pre-built wheels exist for some.

Who it is for: Python developers running GGUF models locally behind an OpenAI-style API

Strengths

  • Low-level ctypes access to the C API plus a high-level Llama class
  • OpenAI-compatible server with function calling, vision and multi-model config
  • JSON and JSON Schema constrained output via response_format
  • Pre-built wheels for CPU, CUDA, Metal, ROCm and Vulkan avoid local compilation

Weaknesses

  • Default pip install compiles llama.cpp and needs a C compiler
  • Only GGUF models are supported
  • Pre-built GPU wheels cover limited Python versions (3.10 to 3.12) and CUDA versions
  • Function calling needs a specific chat format such as chatml-function-calling or functionary

What it needs

  • GPU optional
  • Docker
  • Needs Python 3.8+, C compiler, CMake
  • Models: GGUF, llava, moondream2, minicpm-v-2.6, qwen2.5-vl

Also in Model serving

See all 37
Also in Model serving
RankProjectScore
1LocalAISelf-hosted inference server with OpenAI-compatible API and pluggable backends49.8k starsMIT83 out of 100
2llama.cppC/C++ inference engine serving GGUF models over an OpenAI-compatible API131.9k starsMIT81 out of 100
3OllamaLocal model runner with CLI and REST API for open-weight LLMs184.1k starsMIT80 out of 100
#4vLLMInference engine for Hugging Face LLMs with PagedAttention and continuous batching94.6k starsApache-2.077 out of 100
#5strataRuns a 125B-parameter MoE model on one consumer GPU plus system RAM29.5k starsMIT77 out of 100