Configurable LLM model/provider + multi-library support (supersedes #2, #3, #4)#5
Merged
Conversation
Consolidates and reimplements the good ideas from PRs #2, #3, and #4 into a single cohesive change, plus adds runtime-configurable model/provider/key. Multiple music libraries (supersedes #2, by @othyn): - Discover every "artist"-type library section instead of assuming one named "Music"; cache artists across all of them (de-duplicated). - Search across all libraries for artists and tracks. LLM selection + metadata (supersedes #3, by @othyn): - Playlist summary now records provenance (prompt + model). - Fix min/max track bounds never being interpolated into the system prompt. - UI model selector is driven by server config instead of hardcoded models. Robust API key handling (supersedes #4, by @quinneydavid): - Validate the required provider key before every call, treating empty or whitespace-only *_API_KEY values as missing (litellm.validate_environment alone reports empty keys as present). - Fail fast with a clear error naming the env var to set; no silent, hardcoded provider fallback. - Centralized in one _complete() helper, removing the duplicated completion() calls from the original PR. Configurable at Docker launch: - PLEXMUSE_MODEL sets the default model (any LiteLLM string -> any provider). - PLEXMUSE_MODELS offers a UI dropdown of choices. - New /config endpoint and injected window config expose these to the UI. Tests: 21 -> 32 passing; pylint 10.00/10; flake8/black/isort clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates and reimplements the good ideas from the three open PRs into one cohesive change, and adds the runtime-configurable model/provider/API key that ties them together. The originals overlapped heavily (#3 contained all of #2) and had quality issues, so this reimplements them cleanly with credit to the original authors.
Closes #2, #3, #4 (superseded).
What's included
🎵 Multiple music libraries — supersedes #2 (@othyn)
artist-type library section instead of assuming one named"Music".🤖 Model selection + playlist metadata — supersedes #3 (@othyn)
Generated by Plexmuse+ prompt + model.min_tracks/max_trackswere never interpolated into the track-recommendation system prompt (missing f-string) — now they are.gpt-4/gpt-3.5-turbo.🔑 Robust API key handling — supersedes #4 (@quinneydavid)
*_API_KEYvalues are treated as missing —litellm.validate_environmentalone reports an emptyOPENAI_API_KEY=as present, which is the exact bug Fix handling of empty OpenAI API key #4 was chasing._complete()helper, eliminating the duplicatedcompletion()calls from the original PR.⚙️ Configurable at Docker launch (new)
PLEXMUSE_MODEL— default model; any LiteLLM string, so any provider (OpenAI, Anthropic, Gemini, …).PLEXMUSE_MODELS— optional comma-separated list offered in the UI dropdown.GET /configendpoint + injectedwindowconfig expose these to the frontend.README.mdand.env.example.Notes / deviations from the originals
ci-cd.yml) edits — they conflict with the currentmasterlatest-tagging approach.app.js/index.html; kept changes minimal and in the existing style.Testing
/config.pylint10.00/10;flake8,black --check,isort --checkall clean.🤖 Generated with Claude Code