Initial haunt-fm implementation
Full music recommendation pipeline: listening history capture via webhook,
Last.fm candidate discovery, iTunes preview download, CLAP audio embeddings
(512-dim), pgvector cosine similarity recommendations, playlist generation
with known/new track interleaving, and Music Assistant playback via HA.
Includes: FastAPI app, SQLAlchemy models, Alembic migrations, Docker Compose
with pgvector/pg17, status dashboard, and all API endpoints.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 08:36:36 -06:00
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
|
|
|
model_config = {"env_prefix": "HAUNTFM_"}
|
|
|
|
|
|
|
|
|
|
# Database
|
|
|
|
|
database_url: str = "postgresql+asyncpg://hauntfm:changeme@localhost:5432/hauntfm"
|
|
|
|
|
|
|
|
|
|
# Last.fm
|
|
|
|
|
lastfm_api_key: str = ""
|
|
|
|
|
|
|
|
|
|
# Home Assistant
|
|
|
|
|
ha_url: str = "http://192.168.86.51:8123"
|
|
|
|
|
ha_token: str = ""
|
|
|
|
|
|
|
|
|
|
# CLAP model
|
|
|
|
|
model_cache_dir: str = "/app/model-cache"
|
|
|
|
|
audio_cache_dir: str = "/app/audio-cache"
|
|
|
|
|
|
|
|
|
|
# Embedding worker
|
|
|
|
|
embedding_worker_enabled: bool = True
|
|
|
|
|
embedding_batch_size: int = 10
|
|
|
|
|
embedding_interval_seconds: int = 30
|
|
|
|
|
|
2026-02-23 07:34:00 -06:00
|
|
|
# Feedback
|
|
|
|
|
feedback_overlap_threshold: float = 0.85
|
|
|
|
|
feedback_signal_weights: dict = {"up": 1.0, "down": -1.0, "skip": -0.3}
|
|
|
|
|
|
Initial haunt-fm implementation
Full music recommendation pipeline: listening history capture via webhook,
Last.fm candidate discovery, iTunes preview download, CLAP audio embeddings
(512-dim), pgvector cosine similarity recommendations, playlist generation
with known/new track interleaving, and Music Assistant playback via HA.
Includes: FastAPI app, SQLAlchemy models, Alembic migrations, Docker Compose
with pgvector/pg17, status dashboard, and all API endpoints.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 08:36:36 -06:00
|
|
|
|
|
|
|
|
settings = Settings()
|