forked from fishaudio/fish-speech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
93 lines (90 loc) · 3.77 KB
/
Copy pathcompose.yml
File metadata and controls
93 lines (90 loc) · 3.77 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
name: fish-speech
services:
# OpenAI-compatible TTS API (streaming, emotion tags, voice cloning,
# multi-speaker via voice_map). This is the DEFAULT service:
# cp .env.example .env && docker compose up -d --build
# Configure everything in .env (port, GPU id, quant level, voices folder, …).
# Requires the NVIDIA Container Toolkit on the host.
fish-openai:
build:
context: .
dockerfile: docker/Dockerfile
target: openai
args:
BACKEND: cuda
UV_EXTRA: "${FISH_UV_EXTRA:-cu128}" # cu128 = torch 2.8 + CUDA 12.8
CUDA_VER: "${FISH_CUDA_VER:-12.8.1}"
UV_VERSION: "${UV_VERSION:-0.8.15}"
USER_UID: "${FISH_UID:-1000}"
USER_GID: "${FISH_GID:-1000}"
image: fish-speech-openai:cu128
container_name: fish-openai
restart: unless-stopped
ports:
- "${FISH_HOST_PORT:-8770}:8770"
environment:
FISH_DEVICE: "cuda:0" # in-container the chosen GPU is cuda:0
FISH_LISTEN: "0.0.0.0:8770"
FISH_QUANTIZE: "${FISH_QUANTIZE:-none}" # none | int8 | int4
# Load pre-quantized weights (tools/quantize_save.py) to skip per-boot
# re-quant. Path is inside the container (checkpoints is mounted). Empty
# = quantize live each boot.
FISH_QUANTIZED_WEIGHTS: "${FISH_QUANTIZED_WEIGHTS:-}"
FISH_QUANT_GROUPSIZE: "${FISH_QUANT_GROUPSIZE:-128}"
FISH_COMPILE: "${FISH_COMPILE:-1}"
FISH_HALF: "${FISH_HALF:-1}"
FISH_MAX_SEQ_LEN: "${FISH_MAX_SEQ_LEN:-0}"
FISH_API_KEY: "${FISH_API_KEY:-}"
VOICES_DIR: "/app/voices" # auto-register + watch (mounted below)
FISH_VOICES_SCAN_INTERVAL: "${FISH_VOICES_SCAN_INTERVAL:-30}"
FISH_AUTO_TRANSCRIBE: "${FISH_AUTO_TRANSCRIBE:-1}" # ASR a transcript for voices that lack one
FISH_ASR_MODEL: "${FISH_ASR_MODEL:-small}" # faster-whisper model (small=multilingual)
FISH_ASR_DEVICE: "${FISH_ASR_DEVICE:-cpu}" # cpu | cuda:0 (cpu avoids VRAM contention)
FISH_CONCURRENCY: "${FISH_CONCURRENCY:-1}"
FISH_QUEUE_TIMEOUT: "${FISH_QUEUE_TIMEOUT:-300}"
# Persist torch.compile/Triton kernels to the mounted cache (below) so a
# restart skips the ~4-min CPU kernel recompile.
TORCHINDUCTOR_CACHE_DIR: "/app/.torch-cache/inductor"
TRITON_CACHE_DIR: "/app/.torch-cache/triton"
TORCHINDUCTOR_FX_GRAPH_CACHE: "1"
# Incremental decode for streaming: first audio in ~1.5s vs ~12s on long
# turns (0 = off). Only affects streaming requests; generation unchanged.
FISH_STREAM_CHUNK_TOKENS: "${FISH_STREAM_CHUNK_TOKENS:-32}"
volumes:
- "${FISH_CHECKPOINTS_HOST_DIR:-./checkpoints}:/app/checkpoints"
- "${FISH_VOICES_HOST_DIR:-./voices}:/app/voices"
- "${FISH_REFERENCES_HOST_DIR:-./references}:/app/references"
# Persist torch.compile (Inductor) + Triton kernel caches so a restart
# skips the ~4-min CPU recompile. Pre-create the host dir owned by
# FISH_UID:FISH_GID so the container (non-root) can write it.
- "${FISH_TORCH_CACHE_HOST_DIR:-./.torch-cache}:/app/.torch-cache"
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ["${FISH_GPU_ID:-0}"] # physical GPU id on the host
capabilities: [gpu]
# --- Upstream fishaudio services (opt-in via profiles) ---
webui:
extends:
file: compose.base.yml
service: app-base
build:
target: webui
environment:
COMPILE: ${COMPILE:-0}
profiles: ["webui"]
ports:
- "${GRADIO_PORT:-7860}:7860"
server:
extends:
file: compose.base.yml
service: app-base
build:
target: server
environment:
COMPILE: ${COMPILE:-0}
profiles: ["server"]
ports:
- "${API_PORT:-8080}:8080"