Skip to content

Repository files navigation

DLocker Cache

Collective memory for Ollama. The first person who asks waits. Everyone else gets the answer instantly. The more people use it, the faster it gets.

How It Works

DLocker sits between your agents and Ollama. Every response gets stored in a vector database. When someone asks something similar (>=95% match), DLocker returns the cached response instantly without touching Ollama.

First request: 30 seconds (goes to Ollama) Second request: instant (from cache) 1000th request: instant (from cache)

The cache grows with every user. The system gets faster over time.

Quick Start

Install

Linux / macOS:

curl -fsSL https://dlocker.app/install.sh | sh

Windows (PowerShell):

powershell -c "irm dlocker.app/install.ps1 | iex"

Note: if you get a 503 error, wait 10 seconds and run the command again. The server may be cold-starting.

Then point your OpenAI-compatible client at http://localhost:8000/v1 instead of http://localhost:11434/v1.

# Before
client = OpenAI(base_url="http://localhost:11434/v1")

# After -- that's it.
client = OpenAI(base_url="http://localhost:8000/v1")

Why DLocker

Other libraries DLocker
Installation pip install + rewrite code One command
Code changes Import + modify LLM calls Zero
Gets faster over time No Yes

Endpoints

Method Path Description
GET / Dashboard UI
GET /health Health check
GET /stats Cache statistics
POST /v1/chat/completions OpenAI-compatible chat endpoint
POST /admin/cache/clear Clear the cache

Development

pip install -r requirements.txt
uvicorn app.main:app --port 8000 --reload

# Run tests
pytest tests/

DLocker is not affiliated with Ollama.

License

MIT

About

Smart proxy with semantic cache for Ollama. 10x faster, 70% less computing power.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages