Files
desklock/gateway/src/desklock_gateway/config.py
T
jpmschweitzerandClaude Fable 5 f5df5049db
Test, Build and Push / test-gateway (push) Successful in 1m2s
Test, Build and Push / release (push) Skipped
Test, Build and Push / build-gateway (push) Skipped
Add rage table-flip state; wire gateway to live Speaches; add CI pipeline
- Face: new 'rage' state — 3-frame kaomoji loop (stare, flip the table,
  put it back) for in-flight request failures; 'error' stays the quiet
  persistent face for a dead link. Sim + artifact + design doc updated.
- Gateway: stt.py/tts.py are now pluggable backends. Default 'speaches'
  talks OpenAI-format HTTP to the live container on :8601
  (faster-whisper-small STT, Kokoro bm_george TTS with 24->16 kHz
  audioop resample); 'embedded' fallback kept behind the [speech] extra.
  Verified with a live TTS->STT round trip (warm: STT 0.27s, TTS 1.9s).
  Docker image is now slim (no CUDA/ML deps). Python pinned to 3.12
  (system 3.8 too old, audioop gone in 3.13).
- CI: .gitea/workflows/build.yml — lint+test on main pushes; on v* tags
  test, build gateway image, push to registry, release, and trigger
  Watchtower (tatlock pattern; needs REGISTRY_USER/REGISTRY_PASSWORD/
  WATCHTOWER_TOKEN secrets). Runtime stack in deploy/desklock-gateway.yml.
- architecture.md: measured speech latencies, deployed-Speaches status,
  CI & deployment section.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 17:54:30 +02:00

31 lines
962 B
Python

from pydantic_settings import BaseSettings
class Settings(BaseSettings):
"""Gateway configuration, overridable via DESKLOCK_* environment variables."""
tatlock_base_url: str = "http://tatlock.schweitz.internal:8000"
tatlock_model: str = "Tatlock"
# PCM rate of the device WebSocket contract (docs/architecture.md)
sample_rate: int = 16000
# "speaches" (shared speech container) or "embedded" (in-process models)
stt_backend: str = "speaches"
tts_backend: str = "speaches"
speaches_base_url: str = "http://localhost:8601"
stt_model: str = "Systran/faster-whisper-small"
tts_model: str = "speaches-ai/Kokoro-82M-v1.0-ONNX"
tts_voice: str = "bm_george"
# embedded fallback only (requires the [speech] extra)
embedded_stt_model: str = "small"
embedded_stt_device: str = "cuda"
embedded_tts_voice: str = "en_GB-alan-medium"
model_config = {"env_prefix": "DESKLOCK_"}
settings = Settings()