Changeset 0.4.3 (#32)

This commit is contained in:
2026-02-18 17:47:21 +00:00
parent 2fc4f6980c
commit c98eb80950
14 changed files with 1134 additions and 17 deletions

View File

@@ -16,13 +16,22 @@ async function fetchModels(showInModal = true) {
let models = [];
if (Backend.isManaged) {
// Managed mode: fetch from backend aggregated models endpoint
const data = await Backend.listAllModels();
// Managed mode: fetch admin-curated enabled models
const data = await Backend.listEnabledModels();
models = (data.models || []).map(m => ({
id: m.id || m.name,
owned_by: m.owned_by || m.provider || null,
id: m.model_id || m.id,
owned_by: m.provider_name || m.provider || null,
config_id: m.config_id || null
}));
// Fallback: if no curated models, try raw aggregation
if (models.length === 0) {
const raw = await Backend.listAllModels();
models = (raw.models || []).map(m => ({
id: m.id || m.name,
owned_by: m.owned_by || m.provider || null,
config_id: m.config_id || null
}));
}
} else {
// Unmanaged mode: direct provider call
const endpoint = showInModal