| Tag | Description | Size delta vs :latest |
|---|---|---|
:latest |
Standard image, full feature set | baseline |
:slim |
CPU-only, no PyTorch/CUDA | ~90% smaller |
:quality-cpu |
Slim + pre-exported ONNX quality models, no runtime PyTorch | ~600 MB larger than :slim (deberta classifier quantized to fp16/int8 at build) |
Pull this tag to get local ONNX quality scoring (ms-marco-MiniLM-L-6-v2 and
nvidia-quality-classifier-deberta) out-of-the-box, without managing the ONNX
export yourself and without shipping torch/transformers in your deployment
container.
docker pull doobidoo/mcp-memory-service:quality-cpu
# Verify both quality models load from baked cache (no export triggered):
docker run --rm doobidoo/mcp-memory-service:quality-cpu \
python -c "
from mcp_memory_service.quality.onnx_ranker import get_onnx_ranker_model
print(get_onnx_ranker_model('ms-marco-MiniLM-L-6-v2'))
print(get_onnx_ranker_model('nvidia-quality-classifier-deberta'))
print('Both quality models loaded from baked ONNX cache')
"The image sets HF_HUB_OFFLINE=1 and TRANSFORMERS_OFFLINE=1 at runtime, so
no live model download can occur. Quality scoring uses only the pre-baked
artifacts at /root/.cache/mcp_memory/onnx_models/.
Homelab use case: ideal for Raspberry Pi, NAS, or any always-on box where you want quality scoring without pulling a 2 GB PyTorch wheel every restart.
The nvidia-quality-classifier-deberta ONNX model ships ~702 MB of fp32 external
weights, which dominates the image size. The build pipeline runs
tools/docker/scripts/quantize_quality_models.py after export to:
- Convert fp32 → fp16 (via
onnxconverter-common) - Apply dynamic int8 to MatMul + Gather (via
onnxruntime.quantization) - Benchmark each variant: file size, mean inference latency, and Pearson correlation against the fp32 baseline on 100 sample texts
- Replace fp32 with the smallest variant whose correlation is ≥ 0.98
- Fall back to fp32 (no failure) if no variant meets the threshold
Override the strategy at build time:
# Force fp16 only (safer on ARM)
docker build --build-arg QUANTIZE_MODE=fp16 -f tools/docker/Dockerfile.quality-cpu .
# Tighten the correlation gate
docker build --build-arg QUANTIZE_MIN_CORR=0.99 -f tools/docker/Dockerfile.quality-cpu .
# Skip quantization entirely (set mode to fp16 with an unreachable corr; falls back to fp32)
docker build --build-arg QUANTIZE_MIN_CORR=1.01 -f tools/docker/Dockerfile.quality-cpu .ms-marco-MiniLM-L-6-v2 is intentionally not quantized — it's already ~80 MB
and not worth the engineering risk.
Choose your mode:
docker-compose up -ddocker-compose -f docker-compose.http.yml up -dThanks to feedback from Joe Esposito, we've completely simplified the Docker setup:
- PYTHONPATH now correctly set to
/app/src - run_server.py properly copied for HTTP mode
- Embedding models pre-downloaded during build (no runtime failures)
- 2 clear modes instead of 4 confusing variants
- Unified entrypoint that auto-detects mode
- Single Dockerfile for all configurations
| Variable | Description | Default |
|---|---|---|
MCP_MODE |
Operation mode: mcp or http |
mcp |
MCP_API_KEY |
API key for HTTP mode | your-secure-api-key-here |
HTTP_PORT |
Host port for HTTP mode | 8000 |
LOG_LEVEL |
Logging level | INFO |
All data is stored in a single ./data directory:
- SQLite database:
./data/sqlite_vec.db - Backups:
./data/backups/
Run the test script to verify both modes work:
./test-docker-modes.shWhen running in HTTP mode:
- Dashboard: http://localhost:8000/
- API Docs: http://localhost:8000/api/docs
- Health Check: http://localhost:8000/api/health
If you were using the old Docker files:
| Old File | New Alternative |
|---|---|
docker-compose.standalone.yml |
Use docker-compose.http.yml |
docker-compose.uv.yml |
UV is now built-in |
docker-compose.pythonpath.yml |
Fixed in main Dockerfile |
See DEPRECATED.md for details.
- For HTTP mode: Check logs with
docker-compose -f docker-compose.http.yml logs - Ensure
MCP_MODE=httpis set in environment
- Verify container is running:
docker ps - Check port mapping:
docker port <container_name> - Test health:
curl http://localhost:8000/api/health
- Models are pre-downloaded during build
- If issues persist, rebuild:
docker-compose build --no-cache
Special thanks to Joe Esposito for identifying and helping fix the Docker setup issues!