feat: add support for 'aihubmix' models and aihubmix llm provider

This commit is contained in:
kangfenmao 2025-01-07 09:22:57 +08:00
parent d0948e6f8a
commit f68bd4d8d8
2 changed files with 52 additions and 24 deletions

View File

@ -262,6 +262,44 @@ export function getModelLogo(modelId: string) {
} }
export const SYSTEM_MODELS: Record<string, Model[]> = { export const SYSTEM_MODELS: Record<string, Model[]> = {
aihubmix: [
{
id: 'gpt-4o',
provider: 'aihubmix',
name: 'GPT-4o',
group: 'GPT-4o'
},
{
id: 'claude-3-5-sonnet-latest',
provider: 'aihubmix',
name: 'Claude 3.5 Sonnet',
group: 'Claude 3.5'
},
{
id: 'gemini-2.0-flash-exp-search',
provider: 'aihubmix',
name: 'Gemini 2.0 Flash Exp Search',
group: 'Gemini 2.0'
},
{
id: 'deepseek-chat',
provider: 'aihubmix',
name: 'DeepSeek Chat',
group: 'DeepSeek Chat'
},
{
id: 'aihubmix-Llama-3-3-70B-Instruct',
provider: 'aihubmix',
name: 'Llama-3.3-70b',
group: 'Llama 3.3'
},
{
id: 'Qwen/QVQ-72B-Preview',
provider: 'aihubmix',
name: 'Qwen/QVQ-72B',
group: 'Qwen'
}
],
ollama: [], ollama: [],
silicon: [ silicon: [
{ {
@ -750,20 +788,6 @@ export const SYSTEM_MODELS: Record<string, Model[]> = {
group: 'Jina Embeddings V3' group: 'Jina Embeddings V3'
} }
], ],
aihubmix: [
{
id: 'gpt-4o-mini',
provider: 'aihubmix',
name: 'GPT-4o Mini',
group: 'GPT-4o'
},
{
id: 'aihubmix-Llama-3-70B-Instruct',
provider: 'aihubmix',
name: 'Llama 3 70B Instruct',
group: 'Llama3'
}
],
fireworks: [ fireworks: [
{ {
id: 'accounts/fireworks/models/mythomax-l2-13b', id: 'accounts/fireworks/models/mythomax-l2-13b',
@ -1017,5 +1041,9 @@ export function isWebSearchModel(model: Model): boolean {
return model?.id !== 'hunyuan-lite' return model?.id !== 'hunyuan-lite'
} }
if (provider.id === 'aihubmix') {
return model?.id === 'gemini-2.0-flash-exp-search'
}
return false return false
} }

View File

@ -33,6 +33,16 @@ const initialState: LlmState = {
isSystem: true, isSystem: true,
enabled: true enabled: true
}, },
{
id: 'aihubmix',
name: 'AiHubMix',
type: 'openai',
apiKey: '',
apiHost: 'https://aihubmix.com',
models: SYSTEM_MODELS.aihubmix,
isSystem: true,
enabled: false
},
{ {
id: 'ollama', id: 'ollama',
name: 'Ollama', name: 'Ollama',
@ -313,16 +323,6 @@ const initialState: LlmState = {
models: SYSTEM_MODELS.jina, models: SYSTEM_MODELS.jina,
isSystem: true, isSystem: true,
enabled: false enabled: false
},
{
id: 'aihubmix',
name: 'AiHubMix',
type: 'openai',
apiKey: '',
apiHost: 'https://aihubmix.com',
models: SYSTEM_MODELS.aihubmix,
isSystem: true,
enabled: false
} }
], ],
settings: { settings: {