diff --git a/app/store/config.ts b/app/store/config.ts index 96d6d9125..0e7f43ee6 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -116,12 +116,12 @@ export const useAppConfig = createPersistStore( for (const model of oldModels) { model.available = false; - modelMap[`${model.name}@${model?.provider?.name}`] = model; + modelMap[`${model.name}@${model?.provider?.id}`] = model; } for (const model of newModels) { model.available = true; - modelMap[`${model.name}@${model?.provider?.name}`] = model; + modelMap[`${model.name}@${model?.provider?.id}`] = model; } set(() => ({ diff --git a/app/utils/model.ts b/app/utils/model.ts index 9bd6ea673..741971b00 100644 --- a/app/utils/model.ts +++ b/app/utils/model.ts @@ -24,8 +24,8 @@ export function collectModelTable( // default models models.forEach((m) => { - // using @ as fullName - modelTable[`${m.name}@${m?.provider?.name}`] = { + // using @ as fullName + modelTable[`${m.name}@${m?.provider?.id}`] = { ...m, displayName: m.name, // 'provider' is copied over if it exists }; @@ -61,7 +61,7 @@ export function collectModelTable( // 2. if model not exists, create new model with available value if (count === 0) { const provider = customProvider(name); - modelTable[`${name}@${provider.name}`] = { + modelTable[`${name}@${provider?.id}`] = { name, displayName: displayName || name, available,