From 0b0ed88325ba3d6fa6564ea8f70269d47aade3d1 Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Fri, 24 Oct 2025 20:12:07 +0800 Subject: [PATCH] feat(stage-ui): support Cerebras as provider Close #672 --- cspell.config.yaml | 1 + packages/i18n/src/locales/en/settings.yaml | 3 +++ packages/i18n/src/locales/es/settings.yaml | 3 +++ packages/i18n/src/locales/fr/settings.yaml | 3 +++ packages/i18n/src/locales/ru/settings.yaml | 3 +++ packages/i18n/src/locales/vi/settings.yaml | 3 +++ packages/i18n/src/locales/zh-Hans/settings.yaml | 3 +++ packages/i18n/src/locales/zh-Hant/settings.yaml | 12 +++++++++--- packages/stage-ui/src/stores/providers.ts | 13 +++++++++++++ 9 files changed, 41 insertions(+), 3 deletions(-) diff --git a/cspell.config.yaml b/cspell.config.yaml index 6f3d8f75c..4d1ad3e9d 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -34,6 +34,7 @@ words: - byteorder - catppuccin - cdylib + - cerebras - cientos - cjkfonts - clippy diff --git a/packages/i18n/src/locales/en/settings.yaml b/packages/i18n/src/locales/en/settings.yaml index 1f4299541..c4cd92fc7 100644 --- a/packages/i18n/src/locales/en/settings.yaml +++ b/packages/i18n/src/locales/en/settings.yaml @@ -578,6 +578,9 @@ pages: comet-api: description: CometAPI.com title: Comet API + cerebras: + description: cerebras.ai + title: Cerebras transcriptions: playground: title: Transcription Playground diff --git a/packages/i18n/src/locales/es/settings.yaml b/packages/i18n/src/locales/es/settings.yaml index cb2567e15..5adcc4865 100644 --- a/packages/i18n/src/locales/es/settings.yaml +++ b/packages/i18n/src/locales/es/settings.yaml @@ -509,6 +509,9 @@ pages: comet-api: description: CometAPI.com title: Comet API + cerebras: + description: cerebras.ai + title: Cerebras transcriptions: playground: title: Playground de Transcripción diff --git a/packages/i18n/src/locales/fr/settings.yaml b/packages/i18n/src/locales/fr/settings.yaml index 0e250425b..25826f08a 100644 --- a/packages/i18n/src/locales/fr/settings.yaml +++ b/packages/i18n/src/locales/fr/settings.yaml @@ -512,6 +512,9 @@ pages: comet-api: description: CometAPI.com title: Comet API + cerebras: + description: cerebras.ai + title: Cerebras transcriptions: playground: title: Terrain de test de transcription diff --git a/packages/i18n/src/locales/ru/settings.yaml b/packages/i18n/src/locales/ru/settings.yaml index 2f39ada8e..1f6a4ee9f 100644 --- a/packages/i18n/src/locales/ru/settings.yaml +++ b/packages/i18n/src/locales/ru/settings.yaml @@ -493,6 +493,9 @@ pages: comet-api: description: CometAPI.com title: Comet API + cerebras: + description: cerebras.ai + title: Cerebras transcriptions: playground: title: Песочница транскрипции diff --git a/packages/i18n/src/locales/vi/settings.yaml b/packages/i18n/src/locales/vi/settings.yaml index ec65882a2..a6e1240ae 100644 --- a/packages/i18n/src/locales/vi/settings.yaml +++ b/packages/i18n/src/locales/vi/settings.yaml @@ -498,6 +498,9 @@ pages: comet-api: description: CometAPI.com title: Comet API + cerebras: + description: cerebras.ai + title: Cerebras transcriptions: playground: title: Transcription Playground diff --git a/packages/i18n/src/locales/zh-Hans/settings.yaml b/packages/i18n/src/locales/zh-Hans/settings.yaml index 05ed3b2f2..9e8c0e7e3 100644 --- a/packages/i18n/src/locales/zh-Hans/settings.yaml +++ b/packages/i18n/src/locales/zh-Hans/settings.yaml @@ -502,6 +502,9 @@ pages: comet-api: description: CometAPI.com title: Comet API + cerebras: + description: cerebras.ai + title: Cerebras transcriptions: playground: title: 实验平台 diff --git a/packages/i18n/src/locales/zh-Hant/settings.yaml b/packages/i18n/src/locales/zh-Hant/settings.yaml index 0ea9323c9..06eb21606 100644 --- a/packages/i18n/src/locales/zh-Hant/settings.yaml +++ b/packages/i18n/src/locales/zh-Hant/settings.yaml @@ -473,12 +473,18 @@ pages: xai: description: X.AI title: xAI - transcriptions: - playground: - title: 實驗平台 302-ai: title: 302.AI description: 302.AI + comet-api: + description: CometAPI.com + title: Comet API + cerebras: + description: cerebras.ai + title: Cerebras + transcriptions: + playground: + title: 實驗平台 title: 服務來源 scene: description: 設定角色所在環境 diff --git a/packages/stage-ui/src/stores/providers.ts b/packages/stage-ui/src/stores/providers.ts index 8003f078d..3eff44610 100644 --- a/packages/stage-ui/src/stores/providers.ts +++ b/packages/stage-ui/src/stores/providers.ts @@ -21,6 +21,7 @@ import { isStageTamagotchi, isUrl } from '@proj-airi/stage-shared' import { computedAsync, useLocalStorage } from '@vueuse/core' import { createAzure, + createCerebras, createDeepSeek, createFireworks, createGoogleGenerativeAI, @@ -1273,6 +1274,18 @@ export const useProvidersStore = defineStore('providers', () => { ), validation: ['model_list'], }), + 'cerebras-ai': buildOpenAICompatibleProvider({ + id: 'cerebras-ai', + name: 'Cerebras', + nameKey: 'settings.pages.providers.provider.cerebras.title', + descriptionKey: 'settings.pages.providers.provider.cerebras.description', + icon: 'i-lobe-icons:cerebras', + description: 'cerebras.ai', + defaultBaseUrl: 'https://api.cerebras.ai/v1/', + creator: createCerebras, + validation: ['health', 'model_list'], + iconColor: 'i-lobe-icons:cerebras-color', + }), 'together-ai': buildOpenAICompatibleProvider({ id: 'together-ai', name: 'Together.ai',