Conversation
|
Hi, thanks a lot for the work here! Before we go further I'd like to change the shape of this API, so let me explain what I have in mind. What I need is one endpoint that any logged-in user can call (not admin only). For each model it should return:
So it should cover all the models we show in the setup wizard (MusiCNN, DCLAP, Lyrics, Neural Fingerprint), not only the neural fingerprint one. At the moment the PR covers one model out of four, and nothing in the frontend calls the new route yet, so a normal user still doesn't see anything new. Good news: most of the logic already exists. One more thing: please remove the version and the recording limits from this response. If the client really needs the server version, let's not put it here. Let's create a The rest is good and I'd like to keep it: the Thanks again! |
|
I've made the changes. Version is very useful when you want to integrate into an app. Now I can put a message up: In order to use you have to update to version |
|
after merging main tests now fail, i'll fix |
|



AS-IS
Ordinary clients cannot read numeric coverage for all models. The setup wizard exposes admin-only visual bands, and application version reporting is not available through a dedicated authenticated route.
TO-BE
Adds two endpoints available to ordinary authenticated users and bearer-token clients:
GET /api/models: effective enablement and global coverage for MusiCNN (musicnn), DCLAP (clap), Lyrics (lyrics), and Neural Fingerprint (neural-fingerprint). Each coverage object containscount,total, andpercentage.GET /api/models?server_id=<id-or-name>(alsoserver=): keeps global coverage and adds local coverage for the resolved server. Without a server parameter, local coverage andserver_idare omitted.GET /api/versioninapp.py: returns only the effectiveapp_version, including release suffixes.Model coverage contains no API/application version or recording-limit fields. MusiCNN is always enabled, matching the wizard. Percentages use the whole relevant catalogue for every model, including Lyrics. Unknown index counts remain null, empty catalogues have zero percent, and percentages are bounded to 0-100 without masking stale raw counts.
Shares the existing wizard count sources through
tasks/model_coverage.py; the wizard's bands and lyrics-eligible denominator remain unchanged. Reuses source-scoped neural counting and adds cached paged-IVF directory/mapping counts. Local queries never substitute global coverage. The enablement/model-file-availability split remains intact.The endpoints preserve the existing auth/setup policy, return sanitized errors and
Cache-Control: no-store, and do not load encoders/search indexes, infer, analyze, or renew recording warmup. A cold local paged-IVF check reads compact directory IDs and source mappings, not cells/embeddings; scalar counts are cached for up to 30 seconds and invalidated on mapping/index replacement.Includes API schemas and
docs/model-coverage-api.md. No migration, dependency or Lumae frontend change.Test
Local Windows x64 / Python 3.14.2 validation:
git diff --checkpassed.Reproduce the relevant unit checks:
New real-PostgreSQL integration regression:
It verifies persisted directory/header counts, default legacy IDs, scoped canonical mappings, lyrics percentages and an emptied secondary source using an isolated schema in the disposable test database. It skips locally because no disposable PostgreSQL fixture is installed; review CI for the full unit/integration results. No live provider, ARM/NVIDIA or 150k-song deployment was tested locally.
Other useful information
Follows the maintainer's requested all-model API shape: #906 (comment)
Implementation and this description were prepared with Codex assistance.
Checklist
Type of change:
Tested on media server:
Updated:
Other: