forked from fishaudio/fish-speech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
83 lines (74 loc) · 3.96 KB
/
Copy path.env.example
File metadata and controls
83 lines (74 loc) · 3.96 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
# ============================================================================
# Fish Speech S2-Pro — OpenAI-compatible API — container config
# Copy to .env and edit, then: docker compose up -d --build
# ============================================================================
# --- Networking ---
# Host port to publish the API on (the container always listens on 8770 inside).
FISH_HOST_PORT=8770
# --- GPU ---
# Physical GPU id on the HOST to give the container (becomes cuda:0 inside).
FISH_GPU_ID=0
# --- Model / performance ---
# DEFAULTS BELOW are the VALIDATED config on NVIDIA RTX 3090 (Ampere): int8
# weight-only quantization (bf16 compute) + torch.compile. int8 is the tested,
# stable path here (~13GB) — plain fp16 is lighter (~9GB) but is UNSTABLE/fails
# Quantization (forces bf16): int4 (~11.1GB @8192, validated default) | int8
# (~12.2GB) | none (fp16, ~9GB but no quant savings). Pair int4 with the
# pre-quantized weights below for fast, low-RAM startup.
FISH_QUANTIZE=int4
# torch.compile: 1 = faster steady state (~2min warmup) | 0 = instant start, slower.
FISH_COMPILE=1
# fp16: keep 0 when quantizing (int8/int4 force bf16). Set 1 only for QUANTIZE=none.
FISH_HALF=0
# Max sequence length: 0 = model default (8192). Lower (e.g. 4096) = less peak VRAM,
# but a 400-500 word multi-speaker scene then trims older turns (voices stay
# consistent; some long-range continuity lost). Keep 8192 for full-scene context.
FISH_MAX_SEQ_LEN=0
# Pre-quantized weights: load these instead of re-quantizing every boot (model
# load ~5s vs minutes; no swap pressure). If set but missing, it's generated once
# on first boot from the bf16 checkpoint and persists in the checkpoints volume.
# Coupled to torch/torchao + GPU arch: copy between same-stack boxes, else let
# each box regenerate. Leave blank to quantize live each boot.
FISH_QUANTIZED_WEIGHTS=checkpoints/s2-pro/model.int4.g128.pt
FISH_QUANT_GROUPSIZE=128
# Incremental decode for streaming requests: emit audio every N generated tokens
# so the first audio arrives in ~1.5s instead of ~12s on long turns. 0 = off
# (decode per batch). Only affects streaming requests; generation is identical.
FISH_STREAM_CHUNK_TOKENS=32
# --- Auth ---
# Require this bearer token on requests (leave blank for an open server).
FISH_API_KEY=
# --- Voices (auto-register) ---
# HOST folder of reference voices to auto-register + watch. Drop <id>.wav
# (+ optional <id>.lab / <id>.txt transcript), or subfolders <id>/ with audio+.lab.
FISH_VOICES_HOST_DIR=./voices
# Seconds between rescans of the voices folder (0 = scan once at startup).
FISH_VOICES_SCAN_INTERVAL=30
# Auto-transcribe voices that are dropped in without a .lab/.txt transcript.
# A transcript is REQUIRED for good cloning + multi-speaker voice_map binding
# (empty transcript -> all speakers collapse to one voice). 1 = on, 0 = off.
FISH_AUTO_TRANSCRIBE=1
# faster-whisper model for auto-transcription. "small" is multilingual (handles
# mixed-language voice folders); use "small.en" if all samples are English.
FISH_ASR_MODEL=small
# Device for ASR: cpu (default, no VRAM contention) or cuda:0 (faster, needs cuDNN).
FISH_ASR_DEVICE=cpu
# HOST folder for the persistent torch.compile (Inductor) + Triton kernel cache.
# Persisting it makes a restart skip the ~4-min CPU kernel recompile. Pre-create
# it owned by FISH_UID:FISH_GID so the non-root container can write:
# mkdir -p ./.torch-cache && chown -R $FISH_UID:$FISH_GID ./.torch-cache
FISH_TORCH_CACHE_HOST_DIR=./.torch-cache
# --- Checkpoints ---
# HOST folder mounted to /app/checkpoints. If it lacks s2-pro/codec.pth, the
# container downloads fishaudio/s2-pro (~11GB) into it on first start.
FISH_CHECKPOINTS_HOST_DIR=./checkpoints
# --- Concurrency ---
FISH_CONCURRENCY=1
FISH_QUEUE_TIMEOUT=300
# --- Build (advanced) ---
# Match your host CUDA / torch wheel. cu128 = torch 2.8 + CUDA 12.8 (default).
FISH_UV_EXTRA=cu128
FISH_CUDA_VER=12.8.1
# uid/gid of the user that owns the mounted folders (so the container can write).
FISH_UID=1000
FISH_GID=1000