Kapri
Run AI locally. Beautifully.
Why Kapri?
Kapri is a complete drop-in replacement for Ollama. Built on llama.cpp's native router mode, it gives you full control with zero cloud dependency.
Key Features
- Full GPU Support — Vulkan (AMD), CUDA (NVIDIA), ROCm (AMD Linux), SYCL (Intel), Metal (Apple Silicon), CPU
- Any GGUF Model — Pull directly from HuggingFace, not limited to Ollama's registry
- Transparent Config — Plain INI you can read and edit, no hidden internals
- Multi-Model Router — native llama.cpp router with model auto-switching
- Universal Install —
pip install kapri-ai, works everywhere Python exists
Kapri vs Ollama
| Feature | Kapri | Ollama |
|---|---|---|
| Vulkan Support | Native | Blocked |
| Any HuggingFace Model | Yes | Registry only |
| Full llama-server Flags | Complete | Abstracted |
| Transparent Config | INI | Hidden |
| Multi-model Router | Yes | Partial |
| Universal Install | pip | Platform-specific |
Quick Start
Step 1: Install
pip install kapri-ai
Step 2: Setup
kapri install
This downloads the llama-server binary (auto-detects your GPU backend).
Or specify a backend:
kapri install --backend vulkan # AMD GPUs
kapri install --backend cuda # NVIDIA GPUs
kapri install --backend cpu # CPU only
Using an existing llama-server: If you have a working llama-server build (e.g., custom Vulkan build):
kapri install --llama-server /path/to/llama-server.exe
Step 3: Start Server
kapri serve
Step 4: Chat
# Opens web UI (default)
kapri run qwen3.5-0.8b
# Or terminal chat
kapri run qwen3.5-0.8b --tui
The server is also available at http://localhost:11434 for any OpenAI-compatible client.
Then use with any OpenAI-compatible client:
curl http://localhost:11434/v1/models
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "qwen2.5-coder", "messages": [{"role": "user", "content": "Hello!"}]}'
Pulling Models
Kapri supports multiple ways to pull models:
1. From Built-in Registry
# Default Q4_K_M quantization
kapri pull llama3.2-3b
# Specify quantization
kapri pull llama3.2-3b:Q5_K_M
# List available models
kapri search llama
2. Direct from HuggingFace
Pull any GGUF model directly from HuggingFace:
# Unsloth models
kapri pull unsloth/Qwen3.5-0.8B-GGUF
kapri pull unsloth/Qwen3.5-0.8B-GGUF:Q4_K_M
# Bartowski quantized models
kapri pull bartowski/Llama-3.2-3B-Instruct-GGUF
kapri pull bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M
# ggml-org TinyLlama
kapri pull ggml-org/TinyLlama-1.1B-Chat-v1.0-GGUF
# Any other GGUF repo
kapri pull <hf-repo>/<model-name>-GGUF
kapri pull <hf-repo>/<model-name>-GGUF:Q4_K_M
Examples of GGUF repos on HuggingFace:
- unsloth/Qwen3.5-0.8B-GGUF
- bartowski/Llama-3.2-3B-Instruct-GGUF
- bartowski/Qwen2.5-Coder-7B-Instruct-GGUF
- ggml-org/TinyLlama-1.1B-Chat-v1.0-GGUF
Supported Backends
| Backend | Description | GPU Brands |
|---|---|---|
| CUDA | NVIDIA GPUs | NVIDIA |
| Vulkan | AMD GPUs (full speed) | AMD |
| ROCm | AMD GPUs (Linux) | AMD |
| SYCL | Intel GPUs | Intel |
| Metal | Apple Silicon | Apple |
| CPU | Fallback | Any |
Forcing a Backend
kapri install --backend cuda # Force CUDA
kapri install --backend vulkan # Force Vulkan
kapri install --backend cpu # Force CPU
CLI Reference
| Command | Description |
|---|---|
kapri install |
Install binaries (interactive wizard) |
kapri install --backend vulkan |
Install specific backend |
kapri backend vulkan |
Switch GPU backend |
kapri update |
Update binaries |
kapri update --all |
Update kapri and binaries |
kapri pull <model> |
Download a model |
kapri serve |
Start the server |
kapri stop |
Stop the server |
kapri status |
Show server status |
kapri list |
List downloaded models |
kapri search <query> |
Search registry |
kapri remove <model> |
Remove a model |
kapri run <model> |
Open web UI chat (default) |
kapri run <model> --tui |
Open terminal chat |
kapri config |
Show full config INI |
kapri config show-all |
Show full config INI |
kapri config show <model> |
Show specific model config |
kapri config edit <model> |
Edit model config in editor |
kapri config search <query> |
Search models in config |
kapri config show --path |
Show config file path |
kapri config show --reset |
Regenerate config |
kapri logs |
View logs |
Backend Options
kapri backend auto # Auto-detect (recommended)
kapri backend vulkan # AMD GPUs
kapri backend cuda # NVIDIA GPUs
kapri backend rocm # AMD Linux
kapri backend sycl # Intel GPUs
kapri backend metal # Apple Silicon
kapri backend cpu # CPU only
API Endpoints
The server exposes OpenAI-compatible endpoints:
GET /v1/models— List modelsPOST /v1/chat/completions— Chat completionsPOST /v1/completions— Text completions
Python Example
import httpx
client = httpx.Client(base_url="http://localhost:11434")
response = client.post("/v1/chat/completions", json={
"model": "qwen2.5-coder",
"messages": [{"role": "user", "content": "Write a Python hello world"}]
})
print(response.json())
OpenAI Python SDK
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:11434/v1",
api_key="not-needed"
)
chat = client.chat.completions.create(
model="qwen2.5-coder",
messages=[{"role": "user", "content": "Hello!"}]
)
print(chat.choices[0].message.content)
Architecture
~/.kapri/ # Base directory
├── bin/ # llama-server binary
├── models/ # Downloaded GGUF files
├── models.ini # llama.cpp router preset
├── server.pid # Server process ID
└── server.log # Server logs
Troubleshooting
No GPU detected
kapri install --backend cuda # Force CUDA
kapri install --backend vulkan # Force Vulkan (AMD)
Port in use
kapri serve --port 11435 # Different port
Model not found
Make sure the GGUF file exists on HuggingFace. Try:
# Use full repo path
kapri pull unsloth/Qwen3.5-0.8B-GGUF
Requirements
- Python 3.10+
- No root/sudo required
- GPU optional (CPU fallback works)
Links
- GitHub: https://github.com/ai-joe-git/kapri
- PyPI: https://pypi.org/project/kapri-ai/
- Website: https://kapri-ai.vercel.app
- Registry API: https://kapri-registry.vercel.app/models.json
Built on llama.cpp
Metadata
Release files for kapri-ai 0.3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kapri_ai-0.3.8.tar.gz | 29.2 kB | Without provenance | Details for kapri_ai-0.3.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kapri_ai-0.3.8-py3-none-any.whl | Python 3 | none | any | Details for kapri_ai-0.3.8-py3-none-any.whl |
Total release size: 58.6 kB
Release files / kapri_ai-0.3.8.tar.gz
| Download URL | kapri_ai-0.3.8.tar.gz |
|---|---|
| Size | 29.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8915129fd179f8f92ac5a87296dbbf143d5621e51378cabfa796a9a5cdabd68
|
|
BLAKE2b-256 checksum How to use checksums |
b5a1944542eb6ead991f28b3fd1dde1d08e581f846c7d87079d1f33d134d299a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / kapri_ai-0.3.8-py3-none-any.whl
| Download URL | kapri_ai-0.3.8-py3-none-any.whl |
|---|---|
| Size | 29.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18ce855c131b2b343f1a5c540b473f0c28a385ec449c143c37895d756cedbf01
|
|
BLAKE2b-256 checksum How to use checksums |
be02cef640be7dcb39ba2cf1a08d5b510ea4e09522d7645d975cff43c0acc595
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for kapri-ai 0.3.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.