This document explains how to build, run, and publish Wiki-LLM as a container. Wiki-LLM is a multi-format knowledge base that exposes a REST API and an MCP server over two transports (stdio and HTTP/SSE) from a single process.
lordraw/llmwiki| Artifact | Purpose |
|---|---|
Dockerfile | Multi-stage image (Python 3.12 slim), runs as a non-root user, ships a /health HEALTHCHECK. |
.dockerignore | Keeps the build context small (excludes .env, data/, venv, tests, VCS). |
docker-compose.yml | One-command stack: the app plus an optional Qdrant server behind a profile. |
Makefile | Shortcuts for build / run / compose / publish (make help). |
scripts/publish.sh | Multi-arch build & push to Docker Hub via docker buildx. |
The image runs python run_http.py by default, serving:
http://<host>:8000http://<host>:8000/mcp/ssePersistent vector-store data lives on the /data volume.
The default embedding provider in .env.example is local
(sentence-transformers), which pulls in torch and produces a multi-GB
image. The Docker image therefore omits local embeddings by default and is
intended to be used with a remote EMBEDDING_PROVIDER
(mistral, openrouter, groq, gemini, cloudflare, cerebras, nvidia,
puter, or any openai_compatible endpoint).
Two ways to proceed:
.env set, e.g.:
EMBEDDING_PROVIDER=mistral
EMBEDDING_MODEL=mistral-embed
EMBEDDING_API_KEY=your-key
docker build --build-arg WITH_LOCAL_EMBEDDINGS=true -t wikillm:local .
# or: make build WITH_LOCAL_EMBEDDINGS=true
cp .env.example .env
# edit .env — at minimum pick an embedding provider (see above)
Note: the compose file forces
DATA_DIR,CHROMA_PATH, andQDRANT_PATHonto the/datavolume regardless of.env, so storage always persists.
docker compose up -d --build # or: make up
docker compose logs -f wikillm # or: make logs
The server is now on http://localhost:8000 — try http://localhost:8000/health and the interactive docs at http://localhost:8000/docs.
To include a standalone Qdrant server (then set VECTOR_BACKEND=qdrant and
QDRANT_URL=http://qdrant:6333 in .env):
docker compose --profile qdrant up -d --build # or: make up-qdrant
make build # builds lordraw/llmwiki:<version> and :latest
docker run --rm -it \
-p 8000:8000 \
--env-file .env \
-v wikillm-data:/data \
lordraw/llmwiki:latest # or: make run
The default command runs the HTTP server. For an MCP stdio client (e.g. Claude Desktop) that launches the server as a subprocess, override the command:
docker run --rm -i \
--env-file .env \
-v wikillm-data:/data \
lordraw/llmwiki:latest python run_stdio.py
Example claude_desktop_config.json entry:
{
"mcpServers": {
"wikillm": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"--env-file", "/absolute/path/to/.env",
"-v", "wikillm-data:/data",
"lordraw/llmwiki:latest",
"python", "run_stdio.py"
]
}
}
}
stdout is reserved for JSON-RPC framing (logs go to stderr), so the stdio
transport works cleanly through the container.
With the server up, run the integration test scripts from the host:
python3.12 test_http.py --base-url http://localhost:8000
# add --api-key <key> if API_KEY is set in .env
scripts/publish.sh builds a multi-arch image (linux/amd64,linux/arm64) and
pushes it to lordraw/llmwiki, tagging both the version (from the latest git
tag, e.g. v0.1.0 → 0.1.0, falling back to pyproject.toml) and latest.
# Interactive login first (or set DOCKERHUB_TOKEN for non-interactive login):
docker login
# Publish to lordraw/llmwiki using the defaults:
make publish
# equivalently:
./scripts/publish.sh
The version tag comes from
git describe --tags. Tag a release first, e.g.git tag v0.1.0(the leadingvis stripped for the Docker tag).
Useful overrides:
| Variable | Default | Meaning |
|---|---|---|
DOCKER_USER | lordraw | Docker Hub namespace (user or org). |
IMAGE_NAME | llmwiki | Repository name. |
VERSION | latest git tag → pyproject.toml | Image version tag. |
PLATFORMS | linux/amd64,linux/arm64 | Target architectures. |
WITH_LOCAL_EMBEDDINGS | false | Bake in sentence-transformers. |
PUSH_LATEST | true | Also push the :latest tag. |
DOCKERHUB_TOKEN | — | If set, performs a non-interactive docker login. |
Example — single arch, pinned version, no latest:
VERSION=0.1.0 PLATFORMS=linux/amd64 PUSH_LATEST=false \
./scripts/publish.sh
All runtime configuration is via environment variables (see
.env.example for the full list). The image sets container-
friendly defaults:
| Variable | Image default | Notes |
|---|---|---|
APP_HOST | 0.0.0.0 | Bind address inside the container. |
APP_PORT | 8000 | Exposed port. |
DATA_DIR | /data | Persisted via the /data volume. |
CHROMA_PATH | /data/chroma | ChromaDB storage. |
QDRANT_PATH | /data/qdrant | Qdrant embedded storage. |
API_KEY | (unset) | Auth disabled unless you set it. |
WITH_LOCAL_EMBEDDINGS=true.
Use a remote embedding provider and rebuild without the flag./health is failing / container unhealthy: check docker compose logs -f wikillm. A misconfigured embedding provider (missing API key) surfaces at
startup because the knowledge base is initialised eagerly.docker volume rm wikillm-data) or change COLLECTION_NAME.API_KEY is set; send Authorization: Bearer <key> or
X-API-Key: <key>.Content type
Image
Digest
sha256:69d8c2ca3…
Size
2.9 GB
Last updated
3 months ago
docker pull lordraw/llmwiki