Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/renderer/static/icons/providers/aionly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/shared/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const aiProviderNameHash: Record<ModelProviderEnum, string> = {
[ModelProviderEnum.OpenRouter]: 'OpenRouter API',
[ModelProviderEnum.Bedrock]: 'AWS Bedrock',
[ModelProviderEnum.VercelAIGateway]: 'Vercel AI Gateway',
[ModelProviderEnum.Aionly]: 'AiOnly API',
[ModelProviderEnum.Custom]: 'Custom Provider',
}

Expand Down Expand Up @@ -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: '腾讯混元',
Expand Down
87 changes: 87 additions & 0 deletions src/shared/providers/definitions/aionly.ts
Original file line number Diff line number Diff line change
@@ -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})`
},
})
28 changes: 28 additions & 0 deletions src/shared/providers/definitions/models/aionly.ts
Original file line number Diff line number Diff line change
@@ -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<Options, 'apiHost'>, 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,
}
}
}
1 change: 1 addition & 0 deletions src/shared/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/shared/types/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export enum ModelProviderEnum {
OpenRouter = 'openrouter',
Bedrock = 'bedrock',
VercelAIGateway = 'vercel-ai-gateway',
Aionly = 'aionly',
Custom = 'custom',
}

Expand Down