-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
53 lines (52 loc) · 2.29 KB
/
Copy pathdocker-compose.yml
File metadata and controls
53 lines (52 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Project-local Ollama for the retail feedback demo.
#
# FULLY ISOLATED from the mikkonumminendev RAG stack: own model volume, models
# pulled into it once (~10 GB). Nothing this demo does may touch the live RAG's
# model store. The GPU is still shared with that stack:
# - Run inference ONLY while the RAG stack is down (announce first — see CLAUDE.md).
# - No restart policy on purpose: must never auto-start and contend for the GPU.
#
# One-time model pull (network + disk only, no GPU):
# docker compose up -d ollama
# docker compose exec ollama ollama pull hf.co/mradermacher/Llama-Poro-2-8B-Instruct-GGUF:Q4_K_M
# docker compose exec ollama ollama pull qwen3:8b
# docker compose stop ollama
services:
ollama:
image: ollama/ollama:latest
container_name: retail-rag-ollama
environment:
# Served context window — a SERVER-side knob (per-request num_ctx is not
# set anywhere). 4096 fits Phase 0 structuring prompts; revisit for the
# Phase 4 synthesis window. Larger costs VRAM per loaded model.
OLLAMA_CONTEXT_LENGTH: ${OLLAMA_CONTEXT_LENGTH:-4096}
# Concurrency MUST agree with the app-side LlmGate (Ingest:LlmMaxConcurrency
# = 2, shed-not-queue), or the two layers fight: the gate fast-sheds at 2
# while Ollama silently deep-queues under it (default OLLAMA_MAX_QUEUE=512),
# so a call the gate admits can still stall for minutes in a hidden backlog
# bounded only by Ingest:LlmCallTimeoutMs. NUM_PARALLEL=2 lets both admitted
# slots actually run in parallel instead of being serialized; a SHALLOW
# queue makes Ollama shed too rather than hide a deep one (ADR-0040). Safe
# on VRAM because this container runs only while the shared RAG is down, so
# the whole GPU is ours. Tunable via env if a future GPU is tighter.
OLLAMA_NUM_PARALLEL: ${OLLAMA_NUM_PARALLEL:-2}
OLLAMA_MAX_QUEUE: ${OLLAMA_MAX_QUEUE:-8}
ports:
- "11434:11434"
healthcheck:
test: ["CMD", "ollama", "list"]
interval: 10s
timeout: 5s
retries: 12
volumes:
- ollama-models:/root/.ollama
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
volumes:
ollama-models:
name: retail-rag-ollama-models