diff --git a/src/renderer/static/icons/providers/aionly.png b/src/renderer/static/icons/providers/aionly.png new file mode 100644 index 0000000000..1846c9cf99 Binary files /dev/null and b/src/renderer/static/icons/providers/aionly.png differ diff --git a/src/shared/models/index.ts b/src/shared/models/index.ts index 304c6909a5..f6caa2c308 100644 --- a/src/shared/models/index.ts +++ b/src/shared/models/index.ts @@ -30,6 +30,7 @@ export const aiProviderNameHash: Record = { [ModelProviderEnum.OpenRouter]: 'OpenRouter API', [ModelProviderEnum.Bedrock]: 'AWS Bedrock', [ModelProviderEnum.VercelAIGateway]: 'Vercel AI Gateway', + [ModelProviderEnum.Aionly]: 'AiOnly API', [ModelProviderEnum.Custom]: 'Custom Provider', } @@ -155,6 +156,11 @@ export const AIModelProviderMenuOptionList = [ label: aiProviderNameHash[ModelProviderEnum.ChatGLM6B], disabled: false, }, + { + value: ModelProviderEnum.Aionly, + label: aiProviderNameHash[ModelProviderEnum.Aionly], + disabled: false, + }, // { // value: 'hunyuan', // label: '腾讯混元', diff --git a/src/shared/providers/definitions/aionly.ts b/src/shared/providers/definitions/aionly.ts new file mode 100644 index 0000000000..a15824f320 --- /dev/null +++ b/src/shared/providers/definitions/aionly.ts @@ -0,0 +1,87 @@ +import { ModelProviderEnum, ModelProviderType } from '../../types' +import { defineProvider } from '../registry' +import Aionly from './models/aionly' + +export const aionlyProvider = defineProvider({ + id: ModelProviderEnum.Aionly, + name: 'AiOnly', + type: ModelProviderType.OpenAI, + description: 'AiOnly 多模型中转网关,聚合 Claude/GPT/Gemini/DeepSeek/GLM/Qwen 等主流模型。', + urls: { + website: 'https://api.aionly.com/', + }, + defaultSettings: { + models: [ + { + modelId: 'claude-opus-4-8', + nickname: 'Claude Opus 4.8', + capabilities: ['tool_use'], + contextWindow: 128_000, + }, + { + modelId: 'claude-sonnet-5', + nickname: 'Claude Sonnet 5', + capabilities: ['tool_use'], + contextWindow: 128_000, + }, + { + modelId: 'gpt-5.5', + nickname: 'GPT-5.5', + capabilities: ['tool_use'], + contextWindow: 128_000, + }, + { + modelId: 'gpt-5.4', + nickname: 'GPT-5.4', + capabilities: ['tool_use'], + contextWindow: 128_000, + }, + { + modelId: 'gemini-3.1-pro-preview', + nickname: 'Gemini 3.1 Pro', + capabilities: ['tool_use'], + contextWindow: 128_000, + }, + { + modelId: 'gemini-2.5-pro', + nickname: 'Gemini 2.5 Pro', + capabilities: ['tool_use'], + contextWindow: 128_000, + }, + { + modelId: 'deepseek-v4-pro', + nickname: 'DeepSeek V4 Pro', + capabilities: ['reasoning', 'tool_use'], + contextWindow: 128_000, + }, + { + modelId: 'glm-5.2', + nickname: 'GLM 5.2', + capabilities: ['tool_use'], + contextWindow: 128_000, + }, + { + modelId: 'qwen3.7-plus', + nickname: 'Qwen 3.7 Plus', + capabilities: ['tool_use'], + contextWindow: 128_000, + }, + ], + }, + createModel: (config) => { + return new Aionly( + { + apiKey: config.effectiveApiKey, + model: config.model, + temperature: config.settings.temperature, + topP: config.settings.topP, + maxOutputTokens: config.settings.maxTokens, + stream: config.settings.stream, + }, + config.dependencies + ) + }, + getDisplayName: (modelId, providerSettings) => { + return `AiOnly API (${providerSettings?.models?.find((m) => m.modelId === modelId)?.nickname || modelId})` + }, +}) diff --git a/src/shared/providers/definitions/models/aionly.ts b/src/shared/providers/definitions/models/aionly.ts new file mode 100644 index 0000000000..f1d96ac2e1 --- /dev/null +++ b/src/shared/providers/definitions/models/aionly.ts @@ -0,0 +1,28 @@ +import OpenAICompatible, { type OpenAICompatibleSettings } from '../../../models/openai-compatible' +import type { ModelDependencies } from '../../../types/adapters' + +interface Options extends OpenAICompatibleSettings {} + +export default class Aionly extends OpenAICompatible { + public name = 'AiOnly' + public options: Options + constructor(options: Omit, dependencies: ModelDependencies) { + const apiHost = 'https://api.aionly.com/v1' + super( + { + apiKey: options.apiKey, + apiHost, + model: options.model, + temperature: options.temperature, + topP: options.topP, + maxOutputTokens: options.maxOutputTokens, + stream: options.stream, + }, + dependencies + ) + this.options = { + ...options, + apiHost, + } + } +} diff --git a/src/shared/providers/index.ts b/src/shared/providers/index.ts index 06742110e7..c7ec842faa 100644 --- a/src/shared/providers/index.ts +++ b/src/shared/providers/index.ts @@ -29,6 +29,7 @@ import './definitions/chatglm' import './definitions/github-copilot' import './definitions/bedrock' import './definitions/vercel-ai-gateway' +import './definitions/aionly' import { clearProviderRegistry, defineProvider, diff --git a/src/shared/types/provider.ts b/src/shared/types/provider.ts index 8f12db4f03..4423094072 100644 --- a/src/shared/types/provider.ts +++ b/src/shared/types/provider.ts @@ -27,6 +27,7 @@ export enum ModelProviderEnum { OpenRouter = 'openrouter', Bedrock = 'bedrock', VercelAIGateway = 'vercel-ai-gateway', + Aionly = 'aionly', Custom = 'custom', }