feat: Add LM Studio and ModelScope as system LLM providers
- Update llm.ts to include LM Studio and ModelScope in initial system providers - Modify migrate.ts to add migration logic for adding these new providers - Ensure providers are added only if they don't already exist in the configuration
This commit is contained in:
parent
2c17f75f4f
commit
30959e2380
@ -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: {
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user