Local RAG pipeline for running models with coding and research aid.
1.2K
Official Docker image for running Tensor-Truth RAG application with GPU acceleration.
Pull and run the latest image:
docker run -d \
--name tensor-truth \
--gpus all \
-p 8501:8501 \
-v ~/.tensortruth:/root/.tensortruth \
-e OLLAMA_HOST=http://host.docker.internal:11434 \
ljubobratovicrelja/tensor-truth:latest
Access the application at http://localhost:8501
This Docker image provides a complete, minimal environment for running Tensor-Truth:
The image excludes optional development and documentation tools to keep it minimal:
[docs] extras (BeautifulSoup, arxiv, sphobjinv) - only needed for tensor-truth-docs CLI[dev] extras (pytest, black, mypy) - development dependenciesRun with default settings (connects to Ollama on host machine):
docker run -d \
--name tensor-truth \
--gpus all \
-p 8501:8501 \
-v ~/.tensortruth:/root/.tensortruth \
ljubobratovicrelja/tensor-truth:latest
If Ollama runs on a different machine or port:
docker run -d \
--name tensor-truth \
--gpus all \
-p 8501:8501 \
-v ~/.tensortruth:/root/.tensortruth \
-e OLLAMA_HOST=http://192.168.1.100:11434 \
ljubobratovicrelja/tensor-truth:latest
On Linux, use host networking for easier Ollama connectivity:
docker run -d \
--name tensor-truth \
--gpus all \
--network host \
-v ~/.tensortruth:/root/.tensortruth \
-e OLLAMA_HOST=http://localhost:11434 \
ljubobratovicrelja/tensor-truth:latest
Access at http://localhost:8501 (no port mapping needed with --network host)
Serve on a different host port (e.g., 8080):
docker run -d \
--name tensor-truth \
--gpus all \
-p 8080:8501 \
-v ~/.tensortruth:/root/.tensortruth \
ljubobratovicrelja/tensor-truth:latest
Access at http://localhost:8080
The image uses a volume mount at /root/.tensortruth for persistent data storage.
# Backup
docker cp tensor-truth:/root/.tensortruth ./tensortruth-backup
# Restore
docker cp ./tensortruth-backup/. tensor-truth:/root/.tensortruth
To share data between Docker and local installation:
-v ~/.tensortruth:/root/.tensortruth
This allows you to switch between Docker and pip-installed versions seamlessly.
On the first launch, the application will:
This process takes 2-5 minutes depending on network speed. Subsequent runs are instant since data persists in the volume.
| Variable | Default | Description |
|---|---|---|
OLLAMA_HOST | http://host.docker.internal:11434 | URL for Ollama API endpoint |
Via command line:
-e OLLAMA_HOST=http://192.168.1.100:11434
Via environment file:
# Create .env file
echo "OLLAMA_HOST=http://192.168.1.100:11434" > .env
# Run with env file
docker run -d --name tensor-truth --gpus all -p 8501:8501 \
-v ~/.tensortruth:/root/.tensortruth \
--env-file .env \
ljubobratovicrelja/tensor-truth:latest
Check if container can see your GPU:
docker run --rm --gpus all pytorch/pytorch:2.9.0-cuda12.8-cudnn9-runtime nvidia-smi
You should see your GPU listed.
Error: "could not select device driver"
Install NVIDIA Container Toolkit:
# Ubuntu/Debian
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker
Error: "Unknown runtime specified nvidia"
On newer Docker versions, use --gpus all instead of --runtime=nvidia.
While not recommended (significantly slower), you can run without GPU:
docker run -d \
--name tensor-truth \
-p 8501:8501 \
-v ~/.tensortruth:/root/.tensortruth \
ljubobratovicrelja/tensor-truth:latest
Note: Embeddings and reranking will be much slower on CPU.
Docker Desktop (Mac/Windows):
http://host.docker.internal:11434 (default)Linux:
--network host and http://localhost:11434ip addr show and use http://HOST_IP:11434# Start Ollama container
docker run -d \
--name ollama \
--gpus all \
-p 11434:11434 \
-v ollama:/root/.ollama \
ollama/ollama
# Pull a model
docker exec -it ollama ollama pull deepseek-r1:8b
# Connect Tensor-Truth to Ollama container
docker run -d \
--name tensor-truth \
--gpus all \
-p 8501:8501 \
-v ~/.tensortruth:/root/.tensortruth \
--link ollama:ollama \
-e OLLAMA_HOST=http://ollama:11434 \
ljubobratovicrelja/tensor-truth:latest
If port 8501 is occupied:
# Use different host port
-p 8080:8501 # Access at localhost:8080
Check Ollama is accessible:
# From your host
curl http://localhost:11434/api/tags
# From inside container
docker exec tensor-truth curl http://host.docker.internal:11434/api/tags
If connection fails, verify firewall settings and OLLAMA_HOST configuration.
If Google Drive download fails on first run:
~/.tensortruth/indexes/If embeddings or reranking fail with OOM:
bge-reranker-base instead of bge-reranker-v2-m3)Top N parameter in the UI (fewer documents retrieved/reranked)Content type
Image
Digest
sha256:b7b903a29…
Size
4.5 GB
Last updated
8 months ago
docker pull ljubobratovicrelja/tensor-truth