feat: add nix and nixos flake support#456
feat: add nix and nixos flake support#456longregen wants to merge 8 commits intospeaches-ai:masterfrom
Conversation
|
I've tried to test the changes, but I ran into errors with NOTE: I'm using Applying this diff does fix
Hey, I'm happy you're finding this project useful
I'm finding this very interesting. I've always wanted to have I would love to merge these changes in, but I'm concerned that I won't have either the time or the skill to maintain the Nix configuration as dependencies of the project evolve. Do you think you'll be able to help with the maintenance of the Nix files? Otherwise, I worry they might become stale and cause issues for users. Side note: I really like what you've done with nix-hug. I've had a similar idea of declaratively managing HF cache for some time now. Pretty cool to see someone create a project for this. |
|
Hey there! I'm glad you found it useful. I could commit to maintain this; at least checking on it every month or so. Not sure if any other users would be interested though! I guess you won't like to have the PR hanging around, feel free to close it, I guess organically other nixos users might arrive at this thread. I'll run the build on a mac build box I have somewhere and report back to you. |
ccf9c80 to
75c2cba
Compare
ef9b32f to
2e1058b
Compare
3be6270 to
2934204
Compare
ecd3e51 to
9cb2089
Compare
8e330a3 to
752fc98
Compare
d91d609 to
b3eaf1a
Compare
951cba0 to
3634104
Compare
Rework the realtime WebSocket and WebRTC pipelines with improved TTS bridging, input audio buffer handling, and text chunking. Add phrase-level streaming, interrupt support, and conversation state management. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…artup summary Introduce ExecutorRegistry for centralized model management, add Silero VAD v6 executor, configurable GPU memory limits via ORT options, and a startup summary log with loaded models, TTLs, and memory configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap each OpenTelemetry instrumentor import in try/except so the service starts even when individual instrumentation packages have version mismatches (e.g. httpx vs util-http). Relax pyproject.toml otel pins from ==0.50b0 to >=0.55b0 to allow compatible version resolution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Wrap list_remote_models() in try/except for OSError/ValueError so HF_HUB_OFFLINE=1 environments don't crash when iterating executors - Add offline-safe error handling to /v1/registry endpoint - Lazy-import torch and pyannote in wespeaker and diarization modules so they can be imported without torch installed (CPU-only builds) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New test suites: - Realtime WebSocket e2e tests (14 scenarios) - Conversation state, input audio buffer, interruption tests - Phrase chunker, response handler, session config tests - VAD v6, otel imports tests - Performance and allocation benchmarks Test infrastructure: - Add requires_chat_backend and requires_gated_hf_model markers - Require explicit CHAT_COMPLETION_MODEL for chat tests - Skip tests gracefully when HF_TOKEN, torch, or HF_HUB_CACHE unavailable - Update GPU memory limit assertion to match new 1GB default Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add running-tests guide, installation docs, and troubleshooting page. Update usage docs for dynamic loading, model discovery, realtime API, speech embedding, STT, TTS, VAD, and voice chat with improved examples. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Nix packaging: - Add flake.nix with multi-Python (3.12-3.15) and CUDA/CPU variants - Add nix/dependencies.nix with all custom Python packages - Add nix/module.nix for NixOS service integration - Add nix-hug model cache for offline HuggingFace model access - Guard Piper TTS behind availability check for non-Linux systems - Guard NixOS VM checks behind isLinux for macOS compatibility E2e tests (64 assertions per variant): - Health, diagnostics, model management endpoints - TTS in WAV/MP3/FLAC/Opus with multiple voices and model aliases - STT with whisper-base and whisper-tiny.en, all response formats - Translation, VAD (silero v5+v6), model load/unload lifecycle - TTS->STT round-trip pipeline with quality verification - NixOS VM test with 35 assertions matching shell script coverage Dev tooling: - Add speaches-python wrapper with ffmpeg/espeak-ng on PATH - Add test dependencies (srt, webvtt_py, pytest_antilru) - Fix mkdocs-render-swagger-plugin build (pyproject=true) - Update CI workflows for nix integration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hello there!
I love this project! It was exactly what I was looking for!
I don't know what's the appetite for this, but maybe it's useful for someone else. It almost doesn't touch any code -- only two python files to allow offline usage, so I can test that this works really offline.
Please feel free to close this pull request if it's too off-topic! I saw a flakes.nix file and thought that maybe some other nixos users would find this interesting.