@@ -5,7 +5,10 @@ import {
55 getCachedLiveProviderModelRows ,
66 type LiveModelCatalogFetchGuard ,
77} from "openclaw/plugin-sdk/provider-catalog-live-runtime" ;
8- import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared" ;
8+ import {
9+ buildManifestModelDefinition ,
10+ readManifestProviderDefaultModelRef ,
11+ } from "openclaw/plugin-sdk/provider-catalog-shared" ;
912import type {
1013 ModelCompatConfig ,
1114 ModelDefinitionConfig ,
@@ -49,9 +52,9 @@ const BASE_COMPAT: ModelCompatConfig = {
4952/** Base URL for Baseten's OpenAI-compatible Model APIs. */
5053export const BASETEN_BASE_URL = BASETEN_MANIFEST_CATALOG . baseUrl ;
5154/** Default Baseten model id used for onboarding. */
52- export const BASETEN_DEFAULT_MODEL_ID = "thinkingmachines/inkling" ;
55+ export const BASETEN_DEFAULT_MODEL_ID = BASETEN_MANIFEST_CATALOG . defaultModel ;
5356/** Default Baseten model ref used for onboarding. */
54- export const BASETEN_DEFAULT_MODEL_REF = ` baseten/ ${ BASETEN_DEFAULT_MODEL_ID } ` ;
57+ export const BASETEN_DEFAULT_MODEL_REF = readManifestProviderDefaultModelRef ( manifest , " baseten" ) ! ;
5558/** Bundled fallback rows for all Baseten Model APIs available at release time. */
5659export const BASETEN_MODEL_CATALOG = BASETEN_MANIFEST_CATALOG . models ;
5760
@@ -110,27 +113,18 @@ export function buildBasetenModelCompat(modelId: string): ModelCompatConfig {
110113 } ;
111114}
112115
113- /** Builds one normalized Baseten model definition from a manifest entry. */
114- export function buildBasetenModelDefinition (
115- model : ( typeof BASETEN_MODEL_CATALOG ) [ number ] ,
116- ) : ModelDefinitionConfig {
117- const provider = buildManifestModelProviderConfig ( {
118- providerId : "baseten" ,
119- catalog : { ...BASETEN_MANIFEST_CATALOG , models : [ model ] } ,
120- } ) ;
121- const normalized = provider . models [ 0 ] ;
122- if ( ! normalized ) {
123- throw new Error ( `Missing normalized Baseten model ${ model . id } ` ) ;
124- }
125- return {
126- ...normalized ,
127- compat : buildBasetenModelCompat ( normalized . id ) ,
128- } ;
129- }
130-
131116/** Builds the network-free fallback catalog. */
132117export function buildStaticBasetenModels ( ) : ModelDefinitionConfig [ ] {
133- return BASETEN_MODEL_CATALOG . map ( buildBasetenModelDefinition ) ;
118+ return BASETEN_MODEL_CATALOG . map (
119+ buildManifestModelDefinition ( {
120+ providerId : "baseten" ,
121+ catalog : BASETEN_MANIFEST_CATALOG ,
122+ decorate : ( normalized ) => ( {
123+ ...normalized ,
124+ compat : buildBasetenModelCompat ( normalized . id ) ,
125+ } ) ,
126+ } ) ,
127+ ) ;
134128}
135129
136130type BasetenLiveModelRow = {
0 commit comments