diff --git a/src/renderer/src/store/llm.ts b/src/renderer/src/store/llm.ts index 253e569562..390563882d 100644 --- a/src/renderer/src/store/llm.ts +++ b/src/renderer/src/store/llm.ts @@ -386,6 +386,26 @@ const initialState: LlmState = { models: SYSTEM_MODELS.infini, isSystem: true, enabled: false + }, + { + id: 'lmstudio', + name: 'LM Studio', + type: 'openai', + apiKey: '', + apiHost: 'http://localhost:1234', + models: SYSTEM_MODELS.lmstudio, + isSystem: true, + enabled: true + }, + { + id: 'modelscope', + name: 'ModelScope', + type: 'openai', + apiKey: '', + apiHost: 'https://api-inference.modelscope.cn/v1/', + models: SYSTEM_MODELS.modelscope, + isSystem: true, + enabled: false } ], settings: { @@ -414,26 +434,6 @@ const getIntegratedInitialState = () => { models: [model], isSystem: true, enabled: true - }, - { - id: 'lmstudio', - name: 'LM Studio', - type: 'openai', - apiKey: '', - apiHost: 'http://localhost:1234', - models: [model], - isSystem: true, - enabled: true - }, - { - id: 'modelscope', - name: 'ModelScope', - type: 'openai', - apiKey: '', - apiHost: 'https://api-inference.modelscope.cn/v1/', - models: SYSTEM_MODELS.modelscope, - isSystem: true, - enabled: false } ], settings: { diff --git a/src/renderer/src/store/migrate.ts b/src/renderer/src/store/migrate.ts index a3523685fb..fcafed4eed 100644 --- a/src/renderer/src/store/migrate.ts +++ b/src/renderer/src/store/migrate.ts @@ -1035,6 +1035,33 @@ const migrateConfig = { state.minapps.enabled.push(notebooklm) } } + + if (!state.llm.providers.find((provider) => provider.id === 'modelscope')) { + state.llm.providers.push({ + id: 'modelscope', + name: 'ModelScope', + type: 'openai', + apiKey: '', + apiHost: 'https://api-inference.modelscope.cn/v1/', + models: SYSTEM_MODELS.modelscope, + isSystem: true, + enabled: false + }) + } + + if (!state.llm.providers.find((provider) => provider.id === 'lmstudio')) { + state.llm.providers.push({ + id: 'lmstudio', + name: 'LM Studio', + type: 'openai', + apiKey: '', + apiHost: 'http://localhost:1234', + models: SYSTEM_MODELS.lmstudio, + isSystem: true, + enabled: false + }) + } + return state } }