From 744f48758556e6c835a93a4c23558fb9ff096087 Mon Sep 17 00:00:00 2001 From: zhuyu Yao Date: Thu, 6 Mar 2025 01:15:03 +0800 Subject: [PATCH] feat: support infiniai --- README.md | 2 +- app/components/ConfigManager.vue | 9 +++++++++ app/composables/useAiProvider.ts | 1 + app/stores/config.ts | 4 ++++ i18n/en.json | 4 ++++ i18n/nl.json | 4 ++++ i18n/zh.json | 4 ++++ 7 files changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 88692f3..9717f93 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Features: Currently available providers: -- AI: OpenAI compatible, SiliconFlow, DeepSeek, OpenRouter, Ollama and more +- AI: OpenAI compatible, SiliconFlow, Infiniai, DeepSeek, OpenRouter, Ollama and more - Web Search: Tavily (1000 free credits / month), Firecrawl (cloud / self-hosted) Please give a 🌟 Star if you like this project! diff --git a/app/components/ConfigManager.vue b/app/components/ConfigManager.vue index 13b1be9..f0da212 100644 --- a/app/components/ConfigManager.vue +++ b/app/components/ConfigManager.vue @@ -51,6 +51,15 @@ link: 'https://cloud.siliconflow.cn/i/J0NHrrX8', linkText: 'cloud.siliconflow.cn', }, + { + label: t('settings.ai.providers.infiniai.title'), + help: 'settings.ai.providers.infiniai.description', + // Only kept for easy reference in i18n Ally + _help: t('settings.ai.providers.infiniai.description'), + value: 'infiniai', + link: 'https://cloud.infini-ai.com/genstudio/model?deepsearch', + linkText: 'cloud.infini-ai.com', + }, { label: 'DeepSeek', value: 'deepseek', diff --git a/app/composables/useAiProvider.ts b/app/composables/useAiProvider.ts index c13a71c..25c34d7 100644 --- a/app/composables/useAiProvider.ts +++ b/app/composables/useAiProvider.ts @@ -22,6 +22,7 @@ export const useAiModel = () => { } else if ( config.ai.provider === 'deepseek' || config.ai.provider === 'siliconflow' || + config.ai.provider === 'infiniai' || // Special case if model name includes 'deepseek' // This ensures compatibilty with providers like Siliconflow config.ai.model?.toLowerCase().includes('deepseek') diff --git a/app/stores/config.ts b/app/stores/config.ts index c8d2386..946d8e6 100644 --- a/app/stores/config.ts +++ b/app/stores/config.ts @@ -4,6 +4,7 @@ import type { Locale } from '@/components/LangSwitcher.vue' export type ConfigAiProvider = | 'openai-compatible' | 'siliconflow' + | 'infiniai' | 'openrouter' | 'deepseek' | 'ollama' @@ -84,6 +85,9 @@ export const useConfigStore = defineStore('config', () => { if (ai.provider === 'siliconflow') { return ai.apiBase || 'https://api.siliconflow.cn/v1' } + if (ai.provider === 'infiniai') { + return ai.apiBase || 'https://cloud.infini-ai.com/maas/v1' + } return ai.apiBase || 'https://api.openai.com/v1' }) const webSearchApiBase = computed(() => { diff --git a/i18n/en.json b/i18n/en.json index 157ddc8..08aefb2 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -27,6 +27,10 @@ "siliconflow": { "title": "SiliconFlow", "description": "Offers ¥14 free credits on register. Get one API key at {0}." + }, + "infiniai": { + "title": "Infiniai", + "description": "After registration, you can use the full-powered Deepseek R1 and other inference-accelerated models without any barriers. Generate an APIKEY after logging in at {0}." } } }, diff --git a/i18n/nl.json b/i18n/nl.json index 9f4e909..cda0976 100644 --- a/i18n/nl.json +++ b/i18n/nl.json @@ -27,6 +27,10 @@ "siliconflow": { "title": "SiliconFlow", "description": "Biedt ¥14 (€1,85) gratis credits bij registratie. Krijg één API-sleutel bij {0}." + }, + "infiniai": { + "title": "Infiniai", + "description": "Na registratie kunt u zonder drempels de volwaardige Deepseek R1 en andere inferentie-versnelde modellen gebruiken. Genereer een APIKEY na inloggen op {0}." } } }, diff --git a/i18n/zh.json b/i18n/zh.json index a517711..8ef7b47 100644 --- a/i18n/zh.json +++ b/i18n/zh.json @@ -27,6 +27,10 @@ "siliconflow": { "title": "SiliconFlow 硅基流动", "description": "注册赠送 ¥14 元免费额度。在 {0} 生成一个 API key。" + }, + "infiniai": { + "title": "Infiniai 无问芯穹", + "description": "注册后,无门槛免费用deepseek r1满血等推理加速版模型。登录 {0} 后生成 APIKEY" } } },