From 70a83104292c4e1fe5f43dd5f50e5214928c8dd6 Mon Sep 17 00:00:00 2001 From: soryu Date: Sat, 2 May 2026 15:26:39 +0100 Subject: build(server): split Dockerfiles, make ML model paths optional (#120) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Existing Dockerfile (with LLM/STT/TTS model download) is now `Dockerfile.full`. The new top-level `Dockerfile` builds a slim image without python, without huggingface_hub, without the model download step. The slim image is the new default for users who only want the orchestration surface — the directive folder UI, the mesh/task system, the API. ## Slim Dockerfile * No python / huggingface_hub / model downloads. * Same runtime tooling as `k8s/daemon/Dockerfile` (git, gh CLI, ssh, jq, curl, ca-certs, libssl3). * Embeds the daemon binary at /app/daemon-binaries/makima-linux-x86_64 for the in-server download endpoint. * PARAKEET_MODEL_DIR / SORTFORMER_MODEL_PATH / CHATTERBOX_MODEL_DIR are intentionally NOT set — Listen and Speak return "ML models not configured" if a client tries to use them. ## ML model paths now optional `ServerArgs.parakeet_model_dir`, `parakeet_eou_dir`, `sortformer_model_path`, `chatterbox_model_dir` are now `Option` (no defaults). The bin constructor inspects them: if all four are present, configures `AppState::new`; if all four are absent, uses the new `AppState::new_slim()` which leaves `model_config = None`. The lazy load path in `get_ml_models` already returned a clean error for None. Speak (TTS) was already optional via `model_config.as_ref()` — still works. Mixed configurations log a warning and degrade to slim mode. ## Ops note The old `Dockerfile.full` retains the original behaviour for anyone who needs STT/diarization/TTS in production. CI still builds the daemon image from `k8s/daemon/Dockerfile` (untouched). Co-authored-by: Claude Opus 4.7 (1M context) --- makima/src/daemon/cli/server.rs | 49 ++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 27 deletions(-) (limited to 'makima/src/daemon/cli/server.rs') diff --git a/makima/src/daemon/cli/server.rs b/makima/src/daemon/cli/server.rs index adb765d..667f9ea 100644 --- a/makima/src/daemon/cli/server.rs +++ b/makima/src/daemon/cli/server.rs @@ -3,39 +3,34 @@ use clap::Args; /// Run the makima server. +/// +/// ML model paths (parakeet / sortformer / chatterbox) are optional. When +/// none are provided the server still starts; the Listen and Speak websocket +/// endpoints just return a "not configured" error if a client tries to use +/// them. This is the supported way to run a slim deployment of makima +/// without the LLM/STT/TTS dependencies — see `Dockerfile` (slim) vs +/// `Dockerfile.full` (with models). #[derive(Args, Debug)] pub struct ServerArgs { /// Server port #[arg(long, env = "PORT", default_value = "8080")] pub port: u16, - /// Path to parakeet model directory - #[arg( - long, - env = "PARAKEET_MODEL_DIR", - default_value = "models/parakeet-tdt-0.6b-v3" - )] - pub parakeet_model_dir: String, - - /// Path to parakeet EOU model directory - #[arg( - long, - env = "PARAKEET_EOU_DIR", - default_value = "models/realtime_eou_120m-v1-onnx" - )] - pub parakeet_eou_dir: String, - - /// Path to sortformer model - #[arg( - long, - env = "SORTFORMER_MODEL_PATH", - default_value = "models/diarization/diar_streaming_sortformer_4spk-v2.1.onnx" - )] - pub sortformer_model_path: String, - - /// Path to Chatterbox TTS model directory - #[arg(long, env = "CHATTERBOX_MODEL_DIR", default_value = "models/chatterbox-turbo")] - pub chatterbox_model_dir: String, + /// Path to parakeet model directory (optional; STT disabled when unset). + #[arg(long, env = "PARAKEET_MODEL_DIR")] + pub parakeet_model_dir: Option, + + /// Path to parakeet EOU model directory (optional). + #[arg(long, env = "PARAKEET_EOU_DIR")] + pub parakeet_eou_dir: Option, + + /// Path to sortformer model (optional; diarization disabled when unset). + #[arg(long, env = "SORTFORMER_MODEL_PATH")] + pub sortformer_model_path: Option, + + /// Path to Chatterbox TTS model directory (optional; TTS disabled when unset). + #[arg(long, env = "CHATTERBOX_MODEL_DIR")] + pub chatterbox_model_dir: Option, /// PostgreSQL connection URI #[arg(long, env = "POSTGRES_CONNECTION_URI")] -- cgit v1.2.3