fix: use static provider catalogs for model listing

This commit is contained in:
Shakker
2026-04-22 02:36:18 +01:00
committed by Shakker
parent 651d5e0022
commit 04ecf284fc
16 changed files with 219 additions and 25 deletions

View File

@@ -13,7 +13,7 @@ import {
applyChutesApiKeyConfig,
applyChutesProviderConfig,
} from "./onboard.js";
import { buildChutesProvider } from "./provider-catalog.js";
import { buildChutesProvider, buildStaticChutesProvider } from "./provider-catalog.js";
const PROVIDER_ID = "chutes";
@@ -180,6 +180,12 @@ export default definePluginEntry({
};
},
},
staticCatalog: {
order: "profile",
run: async () => ({
provider: buildStaticChutesProvider(),
}),
},
});
},
});

View File

@@ -6,6 +6,14 @@ import {
discoverChutesModels,
} from "./models.js";
export function buildStaticChutesProvider(): ModelProviderConfig {
return {
baseUrl: CHUTES_BASE_URL,
api: "openai-completions",
models: CHUTES_MODEL_CATALOG.map(buildChutesModelDefinition),
};
}
/**
* Build the Chutes provider with dynamic model discovery.
* Falls back to the static catalog on failure.