-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·96 lines (86 loc) · 4.14 KB
/
start.sh
File metadata and controls
executable file
·96 lines (86 loc) · 4.14 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
#!/bin/bash
echo "Starting The Library of Auri Amarin..."
cd "$(dirname "$0")"
# Determine which TTS profile to activate from settings.json
TTS_PROVIDER=$(python3 -c "import json; print(json.load(open('backend/data/settings.json')).get('tts_provider', 'kokoro'))" 2>/dev/null || echo "kokoro")
TTS_PROFILE="kokoro"
if [ "$TTS_PROVIDER" = "orpheus" ]; then
TTS_PROFILE="orpheus"
echo "TTS provider: Orpheus (expressive)"
# Clone Orpheus-FastAPI if not present (needed for Docker build)
if [ ! -d "orpheus-tts" ]; then
echo "Cloning Orpheus-FastAPI..."
git clone https://github.com/Lex-au/Orpheus-FastAPI.git orpheus-tts
fi
elif [ "$TTS_PROVIDER" = "qwen3" ]; then
TTS_PROFILE="qwen3"
echo "TTS provider: Qwen3 (expressive + voice design)"
# Clone Qwen3-TTS-Openai-Fastapi if not present (needed for Docker build)
if [ ! -d "qwen3-tts" ]; then
echo "Cloning Qwen3-TTS-Openai-Fastapi..."
git clone https://github.com/groxaxo/Qwen3-TTS-Openai-Fastapi.git qwen3-tts
fi
elif [ "$TTS_PROVIDER" = "moss" ]; then
TTS_PROFILE="moss"
echo "TTS provider: MOSS (Auri's voice — custom voice cloning)"
else
echo "TTS provider: Kokoro (fast)"
fi
# Stop GPU-heavy containers from other TTS profiles to free VRAM.
# docker compose up only manages containers in the specified profiles — it won't
# stop containers from a previously-active profile automatically.
if [ "$TTS_PROFILE" != "kokoro" ]; then
docker stop amarin-kokoro-tts 2>/dev/null && echo "Stopped Kokoro (freeing VRAM)"
fi
if [ "$TTS_PROFILE" != "orpheus" ]; then
docker stop amarin-orpheus-tts-1 amarin-orpheus-tts-2 amarin-orpheus-tts-3 2>/dev/null && echo "Stopped Orpheus (freeing VRAM)"
fi
if [ "$TTS_PROFILE" != "qwen3" ]; then
docker stop amarin-qwen3-tts 2>/dev/null && echo "Stopped Qwen3 (freeing VRAM)"
fi
if [ "$TTS_PROFILE" != "moss" ]; then
docker stop amarin-moss-tts 2>/dev/null && echo "Stopped MOSS (freeing VRAM)"
fi
# MOSS needs extra VRAM — stop Perception (emotion detection) to free ~3.5 GB.
# Kokoro is also stopped above (it's replaced by MOSS when moss is active).
if [ "$TTS_PROFILE" = "moss" ]; then
docker stop amarin-perception 2>/dev/null && echo "Stopped Perception (MOSS needs VRAM)"
fi
# Stop local inner-llm — Gardener now uses VPS Ollama over Tailscale.
# To run locally (bunker mode): INNER_LIFE_MODE=local ./start.sh
docker stop amarin-inner-llm 2>/dev/null && echo "Stopped local Dreamer (using VPS Ollama)"
# Build and start Docker services
# --build ensures code changes are picked up (cached layers keep it fast when unchanged)
# VRAM constraint: Orpheus/Qwen3 + Dreamer exceed 12GB GPU.
# Only start local-llm (Dreamer) when using Kokoro (lightweight TTS).
if [ "$TTS_PROFILE" = "orpheus" ] || [ "$TTS_PROFILE" = "qwen3" ] || [ "$TTS_PROFILE" = "moss" ]; then
docker stop amarin-local-llm 2>/dev/null && echo "Stopped Dreamer (VRAM constraint)"
echo "${TTS_PROFILE} active — Dreamer disabled (VRAM constraint)"
echo "Building and starting Docker services..."
if [ "${INNER_LIFE_MODE:-vps}" = "local" ]; then
docker compose --profile "$TTS_PROFILE" --profile inner-life up -d --build
else
echo "Inner life: VPS Ollama (Tailscale)"
docker compose --profile "$TTS_PROFILE" up -d --build
fi
else
echo "Building and starting Docker services..."
# Dreams now run on VPS Qwen3-14B — local-llm profile no longer needed.
# To re-enable local dreaming: add --profile local-llm below.
if [ "${INNER_LIFE_MODE:-vps}" = "local" ]; then
docker compose --profile "$TTS_PROFILE" --profile inner-life up -d --build
else
echo "Inner life: VPS Ollama (Tailscale)"
docker compose --profile "$TTS_PROFILE" up -d --build
fi
fi
# Install frontend dependencies if needed
if [ ! -d "frontend/node_modules" ]; then
echo "Installing frontend dependencies..."
cd frontend && npm install && cd ..
fi
# Fix permissions (needed after migrating from Windows)
chmod +x frontend/node_modules/.bin/* 2>/dev/null
# Start Vite dev server (frontend on port 3000)
echo "Launching frontend on http://localhost:3000 ..."
cd frontend && npm run dev -- --host