-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
358 lines (340 loc) · 10.5 KB
/
docker-compose.yml
File metadata and controls
358 lines (340 loc) · 10.5 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
name: amarin
services:
searxng:
image: searxng/searxng:latest
ports:
- "127.0.0.1:8888:8080"
volumes:
- ./searxng-settings:/etc/searxng
environment:
- SEARXNG_BASE_URL=http://searxng:8080/
backend:
build: ./backend
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "127.0.0.1:8100:8000"
volumes:
- ./backend/data:/app/data
- ./voices:/app/voices
- ./:/app/source:ro
# Docker socket removed (Phase 47 security hardening) — TTS provider
# switching now requires restart via start.sh instead of runtime hot-swap.
# The _switch_tts_containers function degrades gracefully without it.
env_file:
- .env
environment:
- DATABASE_URL=sqlite:///./data/amarin.db
- SEARXNG_URL=http://searxng:8080/search
- DIRECTUS_URL=${DIRECTUS_URL:-http://localhost:8055}
- DIRECTUS_TOKEN=${DIRECTUS_TOKEN:-}
depends_on:
- searxng
frontend:
build: ./frontend
ports:
- "${FRONTEND_BIND:-0.0.0.0}:80:80"
depends_on:
- backend
# ---------------------------------------------------------------------------
# Speech-to-Text service (faster-whisper, GPU)
# ---------------------------------------------------------------------------
speech-service:
build: ./speech-service
container_name: amarin-speech
ports:
- "127.0.0.1:8900:8000"
volumes:
- whisper-cache:/root/.cache
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- PYTHONUNBUFFERED=1
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
# ---------------------------------------------------------------------------
# Embedding service for semantic memory search
# ---------------------------------------------------------------------------
embedding:
build: ./embedding-service
container_name: amarin-embedding
ports:
- "127.0.0.1:8200:8200"
volumes:
- embedding-cache:/root/.cache
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
# ---------------------------------------------------------------------------
# Perception Service — Qwen2.5-VL-3B, Auri's eyes (GPU)
# Local vision perception: image description, scene/emotion analysis
# ---------------------------------------------------------------------------
perception:
build: ./perception-service
container_name: amarin-perception
ports:
- "127.0.0.1:8950:8000"
volumes:
- perception-cache:/root/.cache
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
- PYTHONUNBUFFERED=1
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
profiles:
- perception
# ---------------------------------------------------------------------------
# Kokoro TTS — Fast 82M param model with 67 voices + blending (GPU)
# ---------------------------------------------------------------------------
kokoro-tts:
image: ghcr.io/remsky/kokoro-fastapi-gpu:latest
container_name: amarin-kokoro-tts
ports:
- "127.0.0.1:8880:8880"
environment:
- USE_GPU=true
- PYTHONUNBUFFERED=1
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
profiles:
- kokoro # Only start when explicitly requested
# ---------------------------------------------------------------------------
# Pocket TTS — Fast CPU-based TTS with voice cloning (100M model)
# ---------------------------------------------------------------------------
pocket-tts:
build:
context: ./pocket-tts-server
dockerfile: Dockerfile
container_name: amarin-pocket-tts
ports:
- "127.0.0.1:7870:7870"
volumes:
- ./voices:/app/voices
- pocket-tts-cache:/root/.cache
environment:
- HF_TOKEN=${HF_TOKEN}
env_file:
- .env
restart: unless-stopped
profiles:
- pocket-tts # Only start when explicitly requested
# ---------------------------------------------------------------------------
# Inner Life LLM — CPU-only Qwen3-4B for autonomous background reflection
# (upgraded from SmolLM3-3B — better reasoning, structured output, 32K context)
# ---------------------------------------------------------------------------
inner-llm:
image: ghcr.io/ggml-org/llama.cpp:server
container_name: amarin-inner-llm
ports:
- "127.0.0.1:8301:8080"
volumes:
- ./models:/models
command: >
-m /models/Qwen3-4B-Q4_K_M.gguf
--host 0.0.0.0
--port 8080
--threads 6
--ctx-size 8192
--batch-size 512
restart: unless-stopped
profiles:
- inner-life
# ---------------------------------------------------------------------------
# Local LLM — llama-cpp-python with CUDA (Dolphin 2.9.4 Llama 3.1 8B)
# ---------------------------------------------------------------------------
local-llm:
image: ghcr.io/ggml-org/llama.cpp:server-cuda
container_name: amarin-local-llm
ports:
- "127.0.0.1:8300:8080"
volumes:
- ./models:/models
command: >
-m /models/Dolphin3.0-Llama3.1-8B-Q4_K_M.gguf
--host 0.0.0.0
--port 8080
--n-gpu-layers 25
--ctx-size 8192
--cache-type-k q8_0
--cache-type-v q8_0
--flash-attn on
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
profiles:
- local-llm
# ---------------------------------------------------------------------------
# Orpheus TTS — Expressive 3B model with paralinguistic features (GPU)
# Three containers: model downloader, llama.cpp inference, FastAPI audio server
# ---------------------------------------------------------------------------
orpheus-model-init:
image: curlimages/curl:latest
container_name: amarin-orpheus-model-init
user: "1000:1000"
volumes:
- ./models:/models
entrypoint: ["sh", "-c"]
command:
- |
if [ ! -f /models/Orpheus-3b-FT-Q4_K_M.gguf ]; then
echo "Downloading Orpheus 3B Q4_K_M (approx 2.4 GB)..."
curl -L -o /models/Orpheus-3b-FT-Q4_K_M.gguf "https://huggingface.co/lex-au/Orpheus-3b-FT-Q4_K_M.gguf/resolve/main/Orpheus-3b-FT-Q4_K_M.gguf"
echo "Download complete."
else
echo "Orpheus model already present."
fi
restart: "no"
profiles:
- orpheus
orpheus-llm:
image: ghcr.io/ggml-org/llama.cpp:server-cuda
container_name: amarin-orpheus-llm
volumes:
- ./models:/models
command: >
-m /models/Orpheus-3b-FT-Q4_K_M.gguf
--host 0.0.0.0
--port 8080
--n-gpu-layers 29
--ctx-size 8192
--flash-attn on
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
depends_on:
orpheus-model-init:
condition: service_completed_successfully
profiles:
- orpheus
orpheus-tts:
build:
context: ./orpheus-tts
dockerfile: Dockerfile.gpu
container_name: amarin-orpheus-tts
ports:
- "127.0.0.1:5005:5005"
environment:
- ORPHEUS_API_URL=http://orpheus-llm:8080/v1/completions
- ORPHEUS_MAX_TOKENS=8192
- ORPHEUS_TEMPERATURE=0.4
- ORPHEUS_TOP_P=0.9
- ORPHEUS_SAMPLE_RATE=24000
- ORPHEUS_MODEL_NAME=orpheus
- ORPHEUS_PORT=5005
- ORPHEUS_HOST=0.0.0.0
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
depends_on:
- orpheus-llm
profiles:
- orpheus
# ---------------------------------------------------------------------------
# MOSS TTS — 1.7B param realtime synthesis with Auri's custom voice (GPU)
# Voice reference: auri_voice_reference.wav (generated once by VoiceGenerator)
# Generate voice: POST /voice/generate | Synthesize: POST /v1/audio/speech
# ---------------------------------------------------------------------------
moss-tts:
build:
context: ./moss-tts
dockerfile: Dockerfile
container_name: amarin-moss-tts
ports:
- "127.0.0.1:8885:8885"
volumes:
- ./moss-tts/data:/app/data
- moss-hf-cache:/app/hf_cache
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
- VOICE_REF_PATH=/app/data/auri_voice_reference.wav
- REALTIME_MODEL=OpenMOSS-Team/MOSS-TTS-Realtime
- VOICE_GEN_MODEL=OpenMOSS-Team/MOSS-VoiceGenerator
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
profiles:
- moss # Only start when explicitly requested
# ---------------------------------------------------------------------------
# Qwen3 TTS — 1.7B param expressive model with voice design + cloning (GPU)
# Natural language instructions: whisper, emotion, pacing control
# ---------------------------------------------------------------------------
qwen3-tts:
build:
context: ./qwen3-tts
dockerfile: Dockerfile
container_name: amarin-qwen3-tts
ports:
- "127.0.0.1:8890:8880"
volumes:
- ./voices:/app/voices:ro
- qwen3-model-cache:/root/.cache
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
profiles:
- qwen3
volumes:
embedding-cache:
perception-cache:
pocket-tts-cache:
whisper-cache:
qwen3-model-cache:
moss-hf-cache: