mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-17 13:06:21 +00:00
💄 style: Update Mistral AI models & Optimize many model providers fetching (#8644)
* ✨ feat(models): 添加新的模型和更新现有模型的描述与定价
* ✨ feat(models): 添加 Kimi K2 Turbo 模型及其定价信息
* ✨ feat(models): 添加 Qwen3 Coder 30B A3B Instruct 模型及其定价信息,更新模型解析设置
* ✨ feat(models): 更新 Mistral 模型的上下文窗口和显示名称,添加 Magistral Medium 模型,调整 Codestral 模型的显示名称和发布日期
* ✨ feat(types): 添加模型设置属性到 AiFullModelCard 和 ChatModelCard 接口
* Revert "✨ feat(types): 添加模型设置属性到 AiFullModelCard 和 ChatModelCard 接口"
This reverts commit fccd6acc6f.
* ✨ feat(mistral): 添加禁用浏览器请求设置;优化思维块内容处理逻辑
* ✨ feat(modelProviders): 优化模型标签添加;优化 AiHubMix 模型抓取处理逻辑
* Update index.ts
* ✨ feat(modelParse): 优化模型查找逻辑以支持本地特定提供商模型配置
* fix
* ✨ feat(createRuntime): 支持函数式模型配置并优化模型显示名称处理,支持模型名称获取
* fix test
* ✨ feat(aihubmix): 更新模型配置,增加新模型并优化现有模型描述和能力
* ✨ feat: 更新多个模型配置抓取逻辑,优化模型处理逻辑,增加 releasedAt 字段处理,更新快照
* ✨ feat: 更新 GithubModelCard 接口,优化模型处理逻辑,增加模型描述和能力处理
* fix test
* ✨ feat: 更新 aihubmix 模型配置,增加推理能力和新模型,优化描述及能力处理;更新 handlePayload 函数以简化代码结构;添加图像模型关键词配置
* ✨ feat: 更新 aihubmix 模型配置
* fix: 更新模型默认启用处理逻辑;使用最后一个 runtime 的 client 进行函数调用
* fix test
* feat: 为多个模型处理函数添加提供商 ID 参数
* fix test
* feat: 更新 siliconcloud 模型,添加 Step 3 多模态推理模型并修改发布日期
* fix: Anthropic model fetch
* fix: 移除 zhipu 部分模型 search 能力
* update groq
* update aihubmix
* feat: 更新 Qwen 模型,调整上下文窗口令牌数量并添加新模型 Qwen Flash
* update openai
* update groq
* ✨ feat(pricing): Update pricing structure for AI models to use tiered and fixed units
* update groq
* fix lint
* update
* add GLM-4.5V chat model and update vision keywords
* update v0
This commit is contained in:
@@ -114,6 +114,7 @@ export const createRouterRuntime = ({
|
||||
id,
|
||||
routers,
|
||||
apiKey: DEFAULT_API_LEY,
|
||||
models,
|
||||
...params
|
||||
}: CreateRouterRuntimeOptions) => {
|
||||
return class UniformRuntime implements LobeRuntimeAI {
|
||||
@@ -201,7 +202,14 @@ export const createRouterRuntime = ({
|
||||
}
|
||||
|
||||
async models() {
|
||||
return this._runtimes[0].runtime.models?.();
|
||||
if (models && typeof models === 'function') {
|
||||
// 如果是函数式配置,使用最后一个 runtime 的 client 调用函数
|
||||
const lastRuntime = this._runtimes.at(-1)?.runtime;
|
||||
if (lastRuntime && 'client' in lastRuntime) {
|
||||
return await models({ client: (lastRuntime as any).client });
|
||||
}
|
||||
}
|
||||
return this._runtimes.at(-1)?.runtime.models?.();
|
||||
}
|
||||
|
||||
async embeddings(payload: EmbeddingsPayload, options?: EmbeddingsOptions) {
|
||||
|
||||
@@ -40,7 +40,7 @@ export const Lobe302AI = createOpenAICompatibleRuntime({
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: Ai302ModelCard[] = modelsPage.data;
|
||||
|
||||
return processMultiProviderModelList(modelList);
|
||||
return processMultiProviderModelList(modelList, 'ai302');
|
||||
},
|
||||
provider: ModelProvider.Ai302,
|
||||
});
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import urlJoin from 'url-join';
|
||||
|
||||
import AiHubMixModels from '@/config/aiModels/aihubmix';
|
||||
import type { ChatModelCard } from '@/types/llm';
|
||||
import { LOBE_DEFAULT_MODEL_LIST } from '@/config/aiModels';
|
||||
import { responsesAPIModels } from '@/const/models';
|
||||
|
||||
import { createRouterRuntime } from '../RouterRuntime';
|
||||
import { ModelProvider } from '../types';
|
||||
import { ChatStreamPayload } from '../types/chat';
|
||||
import { detectModelProvider, processMultiProviderModelList } from '../utils/modelParse';
|
||||
|
||||
export interface AiHubMixModelCard {
|
||||
created: number;
|
||||
@@ -15,6 +17,17 @@ export interface AiHubMixModelCard {
|
||||
|
||||
const baseURL = 'https://aihubmix.com';
|
||||
|
||||
const handlePayload = (payload: ChatStreamPayload) => {
|
||||
if (
|
||||
responsesAPIModels.has(payload.model) ||
|
||||
payload.model.includes('gpt-') ||
|
||||
/^o\d/.test(payload.model)
|
||||
) {
|
||||
return { ...payload, apiMode: 'responses' } as any;
|
||||
}
|
||||
return payload as any;
|
||||
};
|
||||
|
||||
export const LobeAiHubMixAI = createRouterRuntime({
|
||||
debug: {
|
||||
chatCompletion: () => process.env.DEBUG_AIHUBMIX_CHAT_COMPLETION === '1',
|
||||
@@ -24,68 +37,11 @@ export const LobeAiHubMixAI = createRouterRuntime({
|
||||
},
|
||||
id: ModelProvider.AiHubMix,
|
||||
models: async ({ client }) => {
|
||||
const functionCallKeywords = [
|
||||
'gpt-4',
|
||||
'gpt-3.5',
|
||||
'claude',
|
||||
'gemini',
|
||||
'qwen',
|
||||
'deepseek',
|
||||
'llama',
|
||||
];
|
||||
|
||||
const visionKeywords = [
|
||||
'gpt-4o',
|
||||
'gpt-4-vision',
|
||||
'claude-3',
|
||||
'claude-4',
|
||||
'gemini-pro-vision',
|
||||
'qwen-vl',
|
||||
'llava',
|
||||
];
|
||||
|
||||
const reasoningKeywords = [
|
||||
'o1',
|
||||
'deepseek-r1',
|
||||
'qwq',
|
||||
'claude-opus-4',
|
||||
'claude-sonnet-4',
|
||||
'claude-3-5-sonnet',
|
||||
'claude-3-5-haiku',
|
||||
];
|
||||
|
||||
try {
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: AiHubMixModelCard[] = modelsPage.data || [];
|
||||
|
||||
return modelList
|
||||
.map((model) => {
|
||||
const knownModel = AiHubMixModels.find(
|
||||
(m) => model.id.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
|
||||
const modelId = model.id.toLowerCase();
|
||||
|
||||
return {
|
||||
contextWindowTokens: knownModel?.contextWindowTokens ?? undefined,
|
||||
displayName: knownModel?.displayName ?? model.id,
|
||||
enabled: knownModel?.enabled || false,
|
||||
functionCall:
|
||||
functionCallKeywords.some((keyword) => modelId.includes(keyword)) ||
|
||||
knownModel?.abilities?.functionCall ||
|
||||
false,
|
||||
id: model.id,
|
||||
reasoning:
|
||||
reasoningKeywords.some((keyword) => modelId.includes(keyword)) ||
|
||||
knownModel?.abilities?.reasoning ||
|
||||
false,
|
||||
vision:
|
||||
visionKeywords.some((keyword) => modelId.includes(keyword)) ||
|
||||
knownModel?.abilities?.vision ||
|
||||
false,
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as ChatModelCard[];
|
||||
return await processMultiProviderModelList(modelList, 'aihubmix');
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
'Failed to fetch AiHubMix models. Please ensure your AiHubMix API key is valid:',
|
||||
@@ -97,25 +53,26 @@ export const LobeAiHubMixAI = createRouterRuntime({
|
||||
routers: [
|
||||
{
|
||||
apiType: 'anthropic',
|
||||
models: async () => {
|
||||
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
|
||||
return LOBE_DEFAULT_MODEL_LIST.map((m) => m.id).filter(
|
||||
(id) => id.startsWith('claude') || id.startsWith('kimi-k2'),
|
||||
);
|
||||
},
|
||||
models: LOBE_DEFAULT_MODEL_LIST.map((m) => m.id).filter(
|
||||
(id) => detectModelProvider(id) === 'anthropic',
|
||||
),
|
||||
options: { baseURL },
|
||||
},
|
||||
{
|
||||
apiType: 'google',
|
||||
models: async () => {
|
||||
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
|
||||
return LOBE_DEFAULT_MODEL_LIST.map((m) => m.id).filter((id) => id.startsWith('gemini'));
|
||||
},
|
||||
models: LOBE_DEFAULT_MODEL_LIST.map((m) => m.id).filter(
|
||||
(id) => detectModelProvider(id) === 'google',
|
||||
),
|
||||
options: { baseURL: urlJoin(baseURL, '/gemini') },
|
||||
},
|
||||
{
|
||||
apiType: 'openai',
|
||||
options: { baseURL: urlJoin(baseURL, '/v1') },
|
||||
options: {
|
||||
baseURL: urlJoin(baseURL, '/v1'),
|
||||
chatCompletion: {
|
||||
handlePayload,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import Anthropic, { ClientOptions } from '@anthropic-ai/sdk';
|
||||
|
||||
import type { ChatModelCard } from '@/types/llm';
|
||||
|
||||
import { LobeRuntimeAI } from '../BaseAI';
|
||||
import { AgentRuntimeErrorType } from '../error';
|
||||
import {
|
||||
@@ -17,8 +15,10 @@ import { desensitizeUrl } from '../utils/desensitizeUrl';
|
||||
import { StreamingResponse } from '../utils/response';
|
||||
import { AnthropicStream } from '../utils/streams';
|
||||
import { handleAnthropicError } from './handleAnthropicError';
|
||||
import { processModelList, MODEL_LIST_CONFIGS } from '../utils/modelParse';
|
||||
|
||||
export interface AnthropicModelCard {
|
||||
created_at: string;
|
||||
display_name: string;
|
||||
id: string;
|
||||
}
|
||||
@@ -218,8 +218,6 @@ export class LobeAnthropicAI implements LobeRuntimeAI {
|
||||
}
|
||||
|
||||
async models() {
|
||||
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
|
||||
|
||||
const url = `${this.baseURL}/v1/models`;
|
||||
const response = await fetch(url, {
|
||||
headers: {
|
||||
@@ -232,30 +230,12 @@ export class LobeAnthropicAI implements LobeRuntimeAI {
|
||||
|
||||
const modelList: AnthropicModelCard[] = json['data'];
|
||||
|
||||
return modelList
|
||||
.map((model) => {
|
||||
const knownModel = LOBE_DEFAULT_MODEL_LIST.find(
|
||||
(m) => model.id.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
|
||||
return {
|
||||
contextWindowTokens: knownModel?.contextWindowTokens ?? undefined,
|
||||
const standardModelList = modelList.map((model) => ({
|
||||
created: model.created_at,
|
||||
displayName: model.display_name,
|
||||
enabled: knownModel?.enabled || false,
|
||||
functionCall:
|
||||
model.id.toLowerCase().includes('claude-3') ||
|
||||
knownModel?.abilities?.functionCall ||
|
||||
false,
|
||||
id: model.id,
|
||||
reasoning: knownModel?.abilities?.reasoning || false,
|
||||
vision:
|
||||
(model.id.toLowerCase().includes('claude-3') &&
|
||||
!model.id.toLowerCase().includes('claude-3-5-haiku')) ||
|
||||
knownModel?.abilities?.vision ||
|
||||
false,
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as ChatModelCard[];
|
||||
}));
|
||||
return processModelList(standardModelList, MODEL_LIST_CONFIGS.anthropic, 'anthropic');
|
||||
}
|
||||
|
||||
private handleError(error: any): ChatCompletionErrorPayload {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { ChatModelCard } from '@/types/llm';
|
||||
|
||||
import { ModelProvider } from '../types';
|
||||
import { processMultiProviderModelList } from '../utils/modelParse';
|
||||
import { createOpenAICompatibleRuntime } from '../utils/openaiCompatibleFactory';
|
||||
|
||||
export interface GiteeAIModelCard {
|
||||
@@ -13,44 +12,10 @@ export const LobeGiteeAI = createOpenAICompatibleRuntime({
|
||||
chatCompletion: () => process.env.DEBUG_GITEE_AI_CHAT_COMPLETION === '1',
|
||||
},
|
||||
models: async ({ client }) => {
|
||||
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
|
||||
|
||||
const functionCallKeywords = ['qwen2.5', 'glm-4'];
|
||||
|
||||
const visionKeywords = ['internvl', 'qwen2-vl'];
|
||||
|
||||
const reasoningKeywords = ['deepseek-r1', 'qwq'];
|
||||
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: GiteeAIModelCard[] = modelsPage.data;
|
||||
|
||||
return modelList
|
||||
.map((model) => {
|
||||
const knownModel = LOBE_DEFAULT_MODEL_LIST.find(
|
||||
(m) => model.id.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
|
||||
return {
|
||||
contextWindowTokens: knownModel?.contextWindowTokens ?? undefined,
|
||||
displayName: knownModel?.displayName ?? undefined,
|
||||
enabled: knownModel?.enabled || false,
|
||||
functionCall:
|
||||
(functionCallKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) &&
|
||||
!model.id.toLowerCase().includes('qwen2.5-coder')) ||
|
||||
knownModel?.abilities?.functionCall ||
|
||||
false,
|
||||
id: model.id,
|
||||
reasoning:
|
||||
reasoningKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) ||
|
||||
knownModel?.abilities?.reasoning ||
|
||||
false,
|
||||
vision:
|
||||
visionKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) ||
|
||||
knownModel?.abilities?.vision ||
|
||||
false,
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as ChatModelCard[];
|
||||
return await processMultiProviderModelList(modelList, 'giteeai');
|
||||
},
|
||||
provider: ModelProvider.GiteeAI,
|
||||
});
|
||||
|
||||
@@ -1,17 +1,26 @@
|
||||
import type { ChatModelCard } from '@/types/llm';
|
||||
|
||||
import { AgentRuntimeErrorType } from '../error';
|
||||
import { ModelProvider } from '../types';
|
||||
import { processMultiProviderModelList } from '../utils/modelParse';
|
||||
import { createOpenAICompatibleRuntime } from '../utils/openaiCompatibleFactory';
|
||||
import { pruneReasoningPayload } from '../utils/openaiHelpers';
|
||||
|
||||
export interface GithubModelCard {
|
||||
description: string;
|
||||
friendly_name: string;
|
||||
capabilities: string[];
|
||||
html_url: string;
|
||||
id: string;
|
||||
limits: {
|
||||
max_input_tokens: number;
|
||||
max_output_tokens: number;
|
||||
};
|
||||
name: string;
|
||||
publisher: string;
|
||||
rate_limit_tier: string;
|
||||
registry: string;
|
||||
summary: string;
|
||||
supported_input_modalities: string[];
|
||||
supported_output_modalities: string[];
|
||||
tags: string[];
|
||||
task: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
/* eslint-enable typescript-sort-keys/interface */
|
||||
@@ -40,47 +49,27 @@ export const LobeGithubAI = createOpenAICompatibleRuntime({
|
||||
bizError: AgentRuntimeErrorType.ProviderBizError,
|
||||
invalidAPIKey: AgentRuntimeErrorType.InvalidGithubToken,
|
||||
},
|
||||
models: async ({ client }) => {
|
||||
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
|
||||
models: async () => {
|
||||
const response = await fetch('https://models.github.ai/catalog/models');
|
||||
const modelList: GithubModelCard[] = await response.json();
|
||||
|
||||
const functionCallKeywords = ['function', 'tool'];
|
||||
const formattedModels = modelList.map((model) => ({
|
||||
contextWindowTokens: model.limits?.max_input_tokens + model.limits?.max_output_tokens,
|
||||
description: model.summary,
|
||||
displayName: model.name,
|
||||
functionCall: model.capabilities?.includes('tool-calling') ?? undefined,
|
||||
id: model.id,
|
||||
maxOutput: model.limits?.max_output_tokens ?? undefined,
|
||||
reasoning: model.tags?.includes('reasoning') ?? undefined,
|
||||
releasedAt:
|
||||
model.version && /^\d{4}-\d{2}-\d{2}$/.test(model.version) ? model.version : undefined,
|
||||
vision:
|
||||
(model.tags?.includes('multimodal') ||
|
||||
model.supported_input_modalities?.includes('image')) ??
|
||||
undefined,
|
||||
}));
|
||||
|
||||
const visionKeywords = ['vision'];
|
||||
|
||||
const reasoningKeywords = ['deepseek-r1', 'o1', 'o3', 'grok-3-mini'];
|
||||
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: GithubModelCard[] = modelsPage.body;
|
||||
|
||||
return modelList
|
||||
.map((model) => {
|
||||
const knownModel = LOBE_DEFAULT_MODEL_LIST.find(
|
||||
(m) => model.name.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
|
||||
return {
|
||||
contextWindowTokens: knownModel?.contextWindowTokens ?? undefined,
|
||||
description: model.description,
|
||||
displayName: model.friendly_name,
|
||||
enabled: knownModel?.enabled || false,
|
||||
functionCall:
|
||||
functionCallKeywords.some((keyword) =>
|
||||
model.description.toLowerCase().includes(keyword),
|
||||
) ||
|
||||
knownModel?.abilities?.functionCall ||
|
||||
false,
|
||||
id: model.name,
|
||||
reasoning:
|
||||
reasoningKeywords.some((keyword) => model.name.toLowerCase().includes(keyword)) ||
|
||||
knownModel?.abilities?.reasoning ||
|
||||
false,
|
||||
vision:
|
||||
visionKeywords.some((keyword) => model.description.toLowerCase().includes(keyword)) ||
|
||||
knownModel?.abilities?.vision ||
|
||||
false,
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as ChatModelCard[];
|
||||
return await processMultiProviderModelList(formattedModels, 'github');
|
||||
},
|
||||
provider: ModelProvider.Github,
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { ChatModelCard } from '@/types/llm';
|
||||
|
||||
import { ModelProvider } from '../types';
|
||||
import { processMultiProviderModelList } from '../utils/modelParse';
|
||||
import { createOpenAICompatibleRuntime } from '../utils/openaiCompatibleFactory';
|
||||
|
||||
export interface ModelScopeModelCard {
|
||||
@@ -16,46 +15,11 @@ export const LobeModelScopeAI = createOpenAICompatibleRuntime({
|
||||
chatCompletion: () => process.env.DEBUG_MODELSCOPE_CHAT_COMPLETION === '1',
|
||||
},
|
||||
models: async ({ client }) => {
|
||||
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
|
||||
|
||||
const functionCallKeywords = ['qwen', 'deepseek', 'llama'];
|
||||
|
||||
const visionKeywords = ['qwen-vl', 'qwen2-vl', 'llava'];
|
||||
|
||||
const reasoningKeywords = ['qwq', 'deepseek-r1'];
|
||||
|
||||
try {
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: ModelScopeModelCard[] = modelsPage.data || [];
|
||||
|
||||
return modelList
|
||||
.map((model) => {
|
||||
const knownModel = LOBE_DEFAULT_MODEL_LIST.find(
|
||||
(m) => model.id.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
|
||||
const modelId = model.id.toLowerCase();
|
||||
|
||||
return {
|
||||
contextWindowTokens: knownModel?.contextWindowTokens ?? undefined,
|
||||
displayName: knownModel?.displayName ?? model.id,
|
||||
enabled: knownModel?.enabled || false,
|
||||
functionCall:
|
||||
functionCallKeywords.some((keyword) => modelId.includes(keyword)) ||
|
||||
knownModel?.abilities?.functionCall ||
|
||||
false,
|
||||
id: model.id,
|
||||
reasoning:
|
||||
reasoningKeywords.some((keyword) => modelId.includes(keyword)) ||
|
||||
knownModel?.abilities?.reasoning ||
|
||||
false,
|
||||
vision:
|
||||
visionKeywords.some((keyword) => modelId.includes(keyword)) ||
|
||||
knownModel?.abilities?.vision ||
|
||||
false,
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as ChatModelCard[];
|
||||
return await processMultiProviderModelList(modelList, 'modelscope');
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
'Failed to fetch ModelScope models. Please ensure your ModelScope API key is valid and your Alibaba Cloud account is properly bound:',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { ChatModelCard } from '@/types/llm';
|
||||
|
||||
import { ChatStreamPayload, ModelProvider } from '../types';
|
||||
import { MODEL_LIST_CONFIGS, processModelList } from '../utils/modelParse';
|
||||
import { createOpenAICompatibleRuntime } from '../utils/openaiCompatibleFactory';
|
||||
|
||||
export interface MoonshotModelCard {
|
||||
@@ -45,43 +44,10 @@ export const LobeMoonshotAI = createOpenAICompatibleRuntime({
|
||||
chatCompletion: () => process.env.DEBUG_MOONSHOT_CHAT_COMPLETION === '1',
|
||||
},
|
||||
models: async ({ client }) => {
|
||||
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
|
||||
|
||||
const functionCallKeywords = ['moonshot-v1', 'kimi-latest'];
|
||||
|
||||
const visionKeywords = ['kimi-latest', 'kimi-thinking', 'vision'];
|
||||
|
||||
const reasoningKeywords = ['thinking'];
|
||||
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: MoonshotModelCard[] = modelsPage.data;
|
||||
|
||||
return modelList
|
||||
.map((model) => {
|
||||
const knownModel = LOBE_DEFAULT_MODEL_LIST.find(
|
||||
(m) => model.id.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
|
||||
return {
|
||||
contextWindowTokens: knownModel?.contextWindowTokens ?? undefined,
|
||||
displayName: knownModel?.displayName ?? undefined,
|
||||
enabled: knownModel?.enabled || false,
|
||||
functionCall:
|
||||
functionCallKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) ||
|
||||
knownModel?.abilities?.functionCall ||
|
||||
false,
|
||||
id: model.id,
|
||||
reasoning:
|
||||
reasoningKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) ||
|
||||
knownModel?.abilities?.reasoning ||
|
||||
false,
|
||||
vision:
|
||||
visionKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) ||
|
||||
knownModel?.abilities?.vision ||
|
||||
false,
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as ChatModelCard[];
|
||||
return processModelList(modelList, MODEL_LIST_CONFIGS.moonshot, 'moonshot');
|
||||
},
|
||||
provider: ModelProvider.Moonshot,
|
||||
});
|
||||
|
||||
@@ -5,53 +5,57 @@ exports[`NovitaAI > models > should get models 1`] = `
|
||||
{
|
||||
"contextWindowTokens": 8192,
|
||||
"description": "Meta's latest class of model (Llama 3) launched with a variety of sizes & flavors. This 8B instruct-tuned version was optimized for high quality dialogue usecases. It has demonstrated strong performance compared to leading closed-source models in human evaluations.",
|
||||
"displayName": "meta-llama/llama-3-8b-instruct",
|
||||
"displayName": "Llama 3 8B Instruct",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "meta-llama/llama-3-8b-instruct",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-04-25",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 8192,
|
||||
"description": "Meta's latest class of model (Llama 3) launched with a variety of sizes & flavors. This 70B instruct-tuned version was optimized for high quality dialogue usecases. It has demonstrated strong performance compared to leading closed-source models in human evaluations.",
|
||||
"displayName": "meta-llama/llama-3-70b-instruct",
|
||||
"displayName": "Llama 3 70B Instruct",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "meta-llama/llama-3-70b-instruct",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-04-25",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 8192,
|
||||
"contextWindowTokens": 16384,
|
||||
"description": "Meta's latest class of models, Llama 3.1, launched with a variety of sizes and configurations. The 8B instruct-tuned version is particularly fast and efficient. It has demonstrated strong performance in human evaluations, outperforming several leading closed-source models.",
|
||||
"displayName": "meta-llama/llama-3.1-8b-instruct",
|
||||
"displayName": "Llama 3.1 8B Instruct",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "meta-llama/llama-3.1-8b-instruct",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 8192,
|
||||
"description": "Meta's latest class of models, Llama 3.1, has launched with a variety of sizes and configurations. The 70B instruct-tuned version is optimized for high-quality dialogue use cases. It has demonstrated strong performance in human evaluations compared to leading closed-source models.",
|
||||
"displayName": "meta-llama/llama-3.1-70b-instruct",
|
||||
"enabled": true,
|
||||
"functionCall": false,
|
||||
"id": "meta-llama/llama-3.1-70b-instruct",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-07-24",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 32768,
|
||||
"description": "Meta's latest class of models, Llama 3.1, has launched with a variety of sizes and configurations. The 70B instruct-tuned version is optimized for high-quality dialogue use cases. It has demonstrated strong performance in human evaluations compared to leading closed-source models.",
|
||||
"displayName": "meta-llama/llama-3.1-70b-instruct",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "meta-llama/llama-3.1-70b-instruct",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-07-24",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "Meta's latest class of models, Llama 3.1, launched with a variety of sizes and configurations. This 405B instruct-tuned version is optimized for high-quality dialogue use cases. It has demonstrated strong performance compared to leading closed-source models, including GPT-4o and Claude 3.5 Sonnet, in evaluations.",
|
||||
"displayName": "meta-llama/llama-3.1-405b-instruct",
|
||||
"enabled": false,
|
||||
@@ -59,6 +63,7 @@ exports[`NovitaAI > models > should get models 1`] = `
|
||||
"id": "meta-llama/llama-3.1-405b-instruct",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-07-24",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
@@ -66,17 +71,18 @@ exports[`NovitaAI > models > should get models 1`] = `
|
||||
"contextWindowTokens": 8192,
|
||||
"description": "Gemma 2 9B by Google is an advanced, open-source language model that sets a new standard for efficiency and performance in its size class.
|
||||
Designed for a wide variety of tasks, it empowers developers and researchers to build innovative applications, while maintaining accessibility, safety, and cost-effectiveness.",
|
||||
"displayName": "google/gemma-2-9b-it",
|
||||
"displayName": "Gemma 2 9B Instruct",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "google/gemma-2-9b-it",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-07-18",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 4096,
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "This is a fine-tuned Llama-2 model designed to support longer and more detailed writing prompts, as well as next-chapter generation. It also includes an experimental role-playing instruction set with multi-round dialogues, character interactions, and varying numbers of participants",
|
||||
"displayName": "jondurbin/airoboros-l2-70b",
|
||||
"enabled": false,
|
||||
@@ -84,83 +90,90 @@ Designed for a wide variety of tasks, it empowers developers and researchers to
|
||||
"id": "jondurbin/airoboros-l2-70b",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-07-17",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 8192,
|
||||
"description": "Hermes 2 Pro is an upgraded, retrained version of Nous Hermes 2, consisting of an updated and cleaned version of the OpenHermes 2.5 Dataset, as well as a newly introduced Function Calling and JSON Mode dataset developed in-house.",
|
||||
"displayName": "nousresearch/hermes-2-pro-llama-3-8b",
|
||||
"displayName": "Hermes 2 Pro Llama 3 8B",
|
||||
"enabled": false,
|
||||
"functionCall": true,
|
||||
"functionCall": false,
|
||||
"id": "nousresearch/hermes-2-pro-llama-3-8b",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-06-27",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 32768,
|
||||
"description": "A high-performing, industry-standard 7.3B parameter model, with optimizations for speed and context length.",
|
||||
"displayName": "mistralai/mistral-7b-instruct",
|
||||
"displayName": "Mistral 7B Instruct",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "mistralai/mistral-7b-instruct",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-06-27",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 16000,
|
||||
"description": "Dolphin 2.9 is designed for instruction following, conversational, and coding. This model is a finetune of Mixtral 8x22B Instruct. It features a 64k context length and was fine-tuned with a 16k sequence length using ChatML templates.The model is uncensored and is stripped of alignment and bias. It requires an external alignment layer for ethical use.",
|
||||
"displayName": "cognitivecomputations/dolphin-mixtral-8x22b",
|
||||
"displayName": "Dolphin Mixtral 8x22B",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "cognitivecomputations/dolphin-mixtral-8x22b",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-06-27",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 16000,
|
||||
"contextWindowTokens": 8192,
|
||||
"description": "The uncensored llama3 model is a powerhouse of creativity, excelling in both roleplay and story writing. It offers a liberating experience during roleplays, free from any restrictions. This model stands out for its immense creativity, boasting a vast array of unique ideas and plots, truly a treasure trove for those seeking originality. Its unrestricted nature during roleplays allows for the full breadth of imagination to unfold, akin to an enhanced, big-brained version of Stheno. Perfect for creative minds seeking a boundless platform for their imaginative expressions, the uncensored llama3 model is an ideal choice",
|
||||
"displayName": "sao10k/l3-70b-euryale-v2.1",
|
||||
"displayName": "L3 70B Euryale v2.1",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "sao10k/l3-70b-euryale-v2.1",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": true,
|
||||
"releasedAt": "2024-06-18",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 4096,
|
||||
"description": "A merge with a complex family tree, this model was crafted for roleplaying and storytelling. Midnight Rose is a successor to Rogue Rose and Aurora Nights and improves upon them both. It wants to produce lengthy output by default and is the best creative writing merge produced so far by sophosympatheia.",
|
||||
"displayName": "sophosympatheia/midnight-rose-70b",
|
||||
"displayName": "Midnight Rose 70B",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "sophosympatheia/midnight-rose-70b",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-06-17",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 4096,
|
||||
"description": "The idea behind this merge is that each layer is composed of several tensors, which are in turn responsible for specific functions. Using MythoLogic-L2's robust understanding as its input and Huginn's extensive writing capability as its output seems to have resulted in a model that exceeds at both, confirming my theory. (More details to be released at a later time).",
|
||||
"displayName": "gryphe/mythomax-l2-13b",
|
||||
"displayName": "MythoMax l2 13B",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "gryphe/mythomax-l2-13b",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-04-25",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 4096,
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "Nous-Hermes-Llama2-13b is a state-of-the-art language model fine-tuned on over 300,000 instructions. This model was fine-tuned by Nous Research, with Teknium and Emozilla leading the fine tuning process and dataset curation, Redmond AI sponsoring the compute, and several other contributors.",
|
||||
"displayName": "nousresearch/nous-hermes-llama2-13b",
|
||||
"enabled": false,
|
||||
@@ -168,11 +181,12 @@ Designed for a wide variety of tasks, it empowers developers and researchers to
|
||||
"id": "nousresearch/nous-hermes-llama2-13b",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-04-25",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 32768,
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "Nous Hermes 2 Mixtral 8x7B DPO is the new flagship Nous Research model trained over the Mixtral 8x7B MoE LLM. The model was trained on over 1,000,000 entries of primarily GPT-4 generated data, as well as other high quality data from open datasets across the AI landscape, achieving state of the art performance on a variety of tasks.",
|
||||
"displayName": "Nous-Hermes-2-Mixtral-8x7B-DPO",
|
||||
"enabled": false,
|
||||
@@ -180,11 +194,12 @@ Designed for a wide variety of tasks, it empowers developers and researchers to
|
||||
"id": "Nous-Hermes-2-Mixtral-8x7B-DPO",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-04-25",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 4096,
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "A Mythomax/MLewd_13B-style merge of selected 70B models. A multi-model merge of several LLaMA2 70B finetunes for roleplaying and creative work. The goal was to create a model that combines creativity with intelligence for an enhanced experience.",
|
||||
"displayName": "lzlv_70b",
|
||||
"enabled": false,
|
||||
@@ -192,11 +207,12 @@ Designed for a wide variety of tasks, it empowers developers and researchers to
|
||||
"id": "lzlv_70b",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-04-25",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 4096,
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "OpenHermes 2.5 Mistral 7B is a state of the art Mistral Fine-tune, a continuation of OpenHermes 2 model, which trained on additional code datasets.",
|
||||
"displayName": "teknium/openhermes-2.5-mistral-7b",
|
||||
"enabled": false,
|
||||
@@ -204,18 +220,20 @@ Designed for a wide variety of tasks, it empowers developers and researchers to
|
||||
"id": "teknium/openhermes-2.5-mistral-7b",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-04-24",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 65535,
|
||||
"description": "WizardLM-2 8x22B is Microsoft AI's most advanced Wizard model. It demonstrates highly competitive performance compared to leading proprietary models, and it consistently outperforms all existing state-of-the-art opensource models.",
|
||||
"displayName": "microsoft/wizardlm-2-8x22b",
|
||||
"displayName": "WizardLM-2 8x22B",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "microsoft/wizardlm-2-8x22b",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-04-24",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import type { ChatModelCard } from '@/types/llm';
|
||||
|
||||
import { ModelProvider } from '../types';
|
||||
import { processMultiProviderModelList } from '../utils/modelParse';
|
||||
import { createOpenAICompatibleRuntime } from '../utils/openaiCompatibleFactory';
|
||||
@@ -16,39 +14,10 @@ export const LobeNovitaAI = createOpenAICompatibleRuntime({
|
||||
chatCompletion: () => process.env.DEBUG_NOVITA_CHAT_COMPLETION === '1',
|
||||
},
|
||||
models: async ({ client }) => {
|
||||
const reasoningKeywords = ['deepseek-r1'];
|
||||
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: NovitaModelCard[] = modelsPage.data;
|
||||
|
||||
// 解析模型能力
|
||||
const baseModels = await processMultiProviderModelList(modelList);
|
||||
|
||||
// 合并 Novita 获取的模型信息
|
||||
return baseModels
|
||||
.map((baseModel) => {
|
||||
const model = modelList.find((m) => m.id === baseModel.id);
|
||||
|
||||
if (!model) return baseModel;
|
||||
|
||||
return {
|
||||
...baseModel,
|
||||
contextWindowTokens: model.context_size,
|
||||
description: model.description,
|
||||
displayName: model.title,
|
||||
functionCall:
|
||||
baseModel.functionCall ||
|
||||
model.description.toLowerCase().includes('function calling') ||
|
||||
false,
|
||||
reasoning:
|
||||
baseModel.reasoning ||
|
||||
model.description.toLowerCase().includes('reasoning task') ||
|
||||
reasoningKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) ||
|
||||
false,
|
||||
vision: baseModel.vision || model.description.toLowerCase().includes('vision') || false,
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as ChatModelCard[];
|
||||
return await processMultiProviderModelList(modelList, 'novita');
|
||||
},
|
||||
provider: ModelProvider.Novita,
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@ export const LobeNvidiaAI = createOpenAICompatibleRuntime({
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: NvidiaModelCard[] = modelsPage.data;
|
||||
|
||||
return processMultiProviderModelList(modelList);
|
||||
return processMultiProviderModelList(modelList, 'nvidia');
|
||||
},
|
||||
provider: ModelProvider.Nvidia,
|
||||
});
|
||||
|
||||
@@ -4,309 +4,365 @@ exports[`LobeOpenAI > models > should get models 1`] = `
|
||||
[
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "通用语音识别模型,支持多语言语音识别、语音翻译和语言识别。",
|
||||
"displayName": "Whisper",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "whisper-1",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-02-27",
|
||||
"type": "stt",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "",
|
||||
"displayName": "davinci-002",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "davinci-002",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-08-21",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 16385,
|
||||
"contextWindowTokens": 16384,
|
||||
"description": "GPT 3.5 Turbo,适用于各种文本生成和理解任务,Currently points to gpt-3.5-turbo-0125",
|
||||
"displayName": "GPT-3.5 Turbo",
|
||||
"enabled": false,
|
||||
"functionCall": true,
|
||||
"id": "gpt-3.5-turbo",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-02-28",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "第二代 DALL·E 模型,支持更真实、准确的图像生成,分辨率是第一代的4倍",
|
||||
"displayName": "DALL·E 2",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "dall-e-2",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-11-01",
|
||||
"type": "image",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "",
|
||||
"displayName": "gpt-3.5-turbo-16k",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "gpt-3.5-turbo-16k",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-05-10",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "",
|
||||
"displayName": "tts-1-hd-1106",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "tts-1-hd-1106",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-11-03",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "最新的文本转语音模型,针对质量进行优化",
|
||||
"displayName": "TTS-1 HD",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "tts-1-hd",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-11-03",
|
||||
"type": "tts",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "",
|
||||
"displayName": "gpt-3.5-turbo-16k-0613",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "gpt-3.5-turbo-16k-0613",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-05-30",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 8192,
|
||||
"description": "最强大的向量化模型,适用于英文和非英文任务",
|
||||
"displayName": "Text Embedding 3 Large",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "text-embedding-3-large",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-01-22",
|
||||
"type": "embedding",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "",
|
||||
"displayName": "gpt-4-1106-vision-preview",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "gpt-4-1106-vision-preview",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-03-26",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "",
|
||||
"displayName": "gpt-3.5-turbo-instruct-0914",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "gpt-3.5-turbo-instruct-0914",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-09-07",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 128000,
|
||||
"description": "最新的 GPT-4 Turbo 模型具备视觉功能。现在,视觉请求可以使用 JSON 模式和函数调用。 GPT-4 Turbo 是一个增强版本,为多模态任务提供成本效益高的支持。它在准确性和效率之间找到平衡,适合需要进行实时交互的应用程序场景。",
|
||||
"displayName": "GPT-4 Turbo Preview 0125",
|
||||
"enabled": false,
|
||||
"functionCall": true,
|
||||
"id": "gpt-4-0125-preview",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-01-23",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 128000,
|
||||
"description": "最新的 GPT-4 Turbo 模型具备视觉功能。现在,视觉请求可以使用 JSON 模式和函数调用。 GPT-4 Turbo 是一个增强版本,为多模态任务提供成本效益高的支持。它在准确性和效率之间找到平衡,适合需要进行实时交互的应用程序场景。",
|
||||
"displayName": "GPT-4 Turbo Preview",
|
||||
"enabled": false,
|
||||
"functionCall": true,
|
||||
"id": "gpt-4-turbo-preview",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-01-23",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 4096,
|
||||
"description": "GPT 3.5 Turbo,适用于各种文本生成和理解任务,对指令遵循的优化",
|
||||
"displayName": "GPT-3.5 Turbo Instruct",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "gpt-3.5-turbo-instruct",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-08-24",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "",
|
||||
"displayName": "gpt-3.5-turbo-0301",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "gpt-3.5-turbo-0301",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-03-01",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "",
|
||||
"displayName": "gpt-3.5-turbo-0613",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "gpt-3.5-turbo-0613",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-06-12",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "最新的文本转语音模型,针对实时场景优化速度",
|
||||
"displayName": "TTS-1",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "tts-1",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-04-19",
|
||||
"type": "tts",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "最新的 DALL·E 模型,于2023年11月发布。支持更真实、准确的图像生成,具有更强的细节表现力",
|
||||
"displayName": "DALL·E 3",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "dall-e-3",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-10-31",
|
||||
"type": "image",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 16385,
|
||||
"contextWindowTokens": 16384,
|
||||
"description": "GPT 3.5 Turbo,适用于各种文本生成和理解任务,Currently points to gpt-3.5-turbo-0125",
|
||||
"displayName": "GPT-3.5 Turbo 1106",
|
||||
"enabled": false,
|
||||
"functionCall": true,
|
||||
"id": "gpt-3.5-turbo-1106",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-11-02",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 128000,
|
||||
"description": "最新的 GPT-4 Turbo 模型具备视觉功能。现在,视觉请求可以使用 JSON 模式和函数调用。 GPT-4 Turbo 是一个增强版本,为多模态任务提供成本效益高的支持。它在准确性和效率之间找到平衡,适合需要进行实时交互的应用程序场景。",
|
||||
"displayName": "GPT-4 Turbo Preview 1106",
|
||||
"enabled": false,
|
||||
"functionCall": true,
|
||||
"id": "gpt-4-1106-preview",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-11-02",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "",
|
||||
"displayName": "babbage-002",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "babbage-002",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-08-21",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "",
|
||||
"displayName": "tts-1-1106",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "tts-1-1106",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-11-03",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 128000,
|
||||
"description": "GPT-4 视觉预览版,专为图像分析和处理任务设计。",
|
||||
"displayName": "GPT 4 Turbo with Vision Preview",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "gpt-4-vision-preview",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-11-02",
|
||||
"type": "chat",
|
||||
"vision": true,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 8192,
|
||||
"description": "高效且经济的新一代 Embedding 模型,适用于知识检索、RAG 应用等场景",
|
||||
"displayName": "Text Embedding 3 Small",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "text-embedding-3-small",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-01-22",
|
||||
"type": "embedding",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 128000,
|
||||
"displayName": "GPT 4 Turbo",
|
||||
"contextWindowTokens": 8192,
|
||||
"description": "GPT-4 提供了一个更大的上下文窗口,能够处理更长的文本输入,适用于需要广泛信息整合和数据分析的场景。",
|
||||
"displayName": "GPT-4",
|
||||
"enabled": false,
|
||||
"functionCall": true,
|
||||
"id": "gpt-4",
|
||||
"maxOutput": 4096,
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-06-27",
|
||||
"type": "chat",
|
||||
"vision": true,
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": undefined,
|
||||
"description": "",
|
||||
"displayName": "text-embedding-ada-002",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "text-embedding-ada-002",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2022-12-16",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 16385,
|
||||
"contextWindowTokens": 16384,
|
||||
"description": "GPT 3.5 Turbo,适用于各种文本生成和理解任务,Currently points to gpt-3.5-turbo-0125",
|
||||
"displayName": "GPT-3.5 Turbo 0125",
|
||||
"enabled": false,
|
||||
"functionCall": true,
|
||||
"id": "gpt-3.5-turbo-0125",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-01-23",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
{
|
||||
"contextWindowTokens": 8192,
|
||||
"description": "GPT-4 提供了一个更大的上下文窗口,能够处理更长的文本输入,适用于需要广泛信息整合和数据分析的场景。",
|
||||
"displayName": "GPT-4 0613",
|
||||
"enabled": false,
|
||||
"functionCall": true,
|
||||
"id": "gpt-4-0613",
|
||||
"maxOutput": undefined,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2023-06-12",
|
||||
"type": "chat",
|
||||
"vision": false,
|
||||
},
|
||||
|
||||
@@ -55,7 +55,7 @@ export const LobeOpenAI = createOpenAICompatibleRuntime({
|
||||
const modelList: OpenAIModelCard[] = modelsPage.data;
|
||||
|
||||
// 自动检测模型提供商并选择相应配置
|
||||
return processMultiProviderModelList(modelList);
|
||||
return processMultiProviderModelList(modelList, 'openai');
|
||||
},
|
||||
provider: ModelProvider.OpenAI,
|
||||
responses: {
|
||||
|
||||
@@ -9,16 +9,11 @@ exports[`LobeOpenRouterAI > models > should get models with frontend models data
|
||||
The model was trained on synthetic data.
|
||||
|
||||
_These are free, rate-limited endpoints for [Reflection 70B](/models/mattshumer/reflection-70b). Outputs may be cached. Read about rate limits [here](/docs/limits)._",
|
||||
"displayName": "Reflection 70B (free)",
|
||||
"displayName": "Reflection 70B",
|
||||
"enabled": false,
|
||||
"functionCall": true,
|
||||
"id": "mattshumer/reflection-70b:free",
|
||||
"maxOutput": undefined,
|
||||
"maxTokens": 4096,
|
||||
"pricing": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
},
|
||||
"maxOutput": 4096,
|
||||
"reasoning": true,
|
||||
"releasedAt": "2024-09-06",
|
||||
"type": "chat",
|
||||
@@ -36,16 +31,11 @@ exports[`LobeOpenRouterAI > models > should handle fetch error gracefully 1`] =
|
||||
The model was trained on synthetic data.
|
||||
|
||||
_These are free, rate-limited endpoints for [Reflection 70B](/models/mattshumer/reflection-70b). Outputs may be cached. Read about rate limits [here](/docs/limits)._",
|
||||
"displayName": "Reflection 70B (free)",
|
||||
"displayName": "Reflection 70B",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "mattshumer/reflection-70b:free",
|
||||
"maxOutput": undefined,
|
||||
"maxTokens": 4096,
|
||||
"pricing": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
},
|
||||
"maxOutput": 4096,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-09-06",
|
||||
"type": "chat",
|
||||
@@ -63,16 +53,11 @@ exports[`LobeOpenRouterAI > models > should handle fetch failure gracefully 1`]
|
||||
The model was trained on synthetic data.
|
||||
|
||||
_These are free, rate-limited endpoints for [Reflection 70B](/models/mattshumer/reflection-70b). Outputs may be cached. Read about rate limits [here](/docs/limits)._",
|
||||
"displayName": "Reflection 70B (free)",
|
||||
"displayName": "Reflection 70B",
|
||||
"enabled": false,
|
||||
"functionCall": false,
|
||||
"id": "mattshumer/reflection-70b:free",
|
||||
"maxOutput": undefined,
|
||||
"maxTokens": 4096,
|
||||
"pricing": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
},
|
||||
"maxOutput": 4096,
|
||||
"reasoning": false,
|
||||
"releasedAt": "2024-09-06",
|
||||
"type": "chat",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import OpenRouterModels from '@/config/aiModels/openrouter';
|
||||
import type { ChatModelCard } from '@/types/llm';
|
||||
|
||||
import { ModelProvider } from '../types';
|
||||
import { processMultiProviderModelList } from '../utils/modelParse';
|
||||
@@ -71,44 +70,37 @@ export const LobeOpenRouterAI = createOpenAICompatibleRuntime({
|
||||
console.error('Failed to fetch OpenRouter frontend models:', error);
|
||||
}
|
||||
|
||||
// 解析模型能力
|
||||
const baseModels = await processMultiProviderModelList(modelList);
|
||||
// 先处理抓取的模型信息,转换为标准格式
|
||||
const formattedModels = modelList.map((model) => {
|
||||
const extraInfo = modelsExtraInfo.find(
|
||||
(m) => m.slug.toLowerCase() === model.id.toLowerCase(),
|
||||
);
|
||||
|
||||
// 合并 OpenRouter 获取的模型信息
|
||||
return baseModels
|
||||
.map((baseModel) => {
|
||||
const model = modelList.find((m) => m.id === baseModel.id);
|
||||
const extraInfo = modelsExtraInfo.find(
|
||||
(m) => m.slug.toLowerCase() === baseModel.id.toLowerCase(),
|
||||
);
|
||||
return {
|
||||
contextWindowTokens: model.context_length,
|
||||
description: model.description,
|
||||
displayName: model.name,
|
||||
functionCall:
|
||||
model.description.includes('function calling') ||
|
||||
model.description.includes('tools') ||
|
||||
extraInfo?.endpoint?.supports_tool_parameters ||
|
||||
false,
|
||||
id: model.id,
|
||||
maxOutput:
|
||||
typeof model.top_provider.max_completion_tokens === 'number'
|
||||
? model.top_provider.max_completion_tokens
|
||||
: undefined,
|
||||
pricing: {
|
||||
input: formatPrice(model.pricing.prompt),
|
||||
output: formatPrice(model.pricing.completion),
|
||||
},
|
||||
reasoning: extraInfo?.endpoint?.supports_reasoning || false,
|
||||
releasedAt: new Date(model.created * 1000).toISOString().split('T')[0],
|
||||
vision: model.architecture.modality.includes('image') || false,
|
||||
};
|
||||
});
|
||||
|
||||
if (!model) return baseModel;
|
||||
|
||||
return {
|
||||
...baseModel,
|
||||
contextWindowTokens: model.context_length,
|
||||
description: model.description,
|
||||
displayName: model.name,
|
||||
functionCall:
|
||||
baseModel.functionCall ||
|
||||
model.description.includes('function calling') ||
|
||||
model.description.includes('tools') ||
|
||||
extraInfo?.endpoint?.supports_tool_parameters ||
|
||||
false,
|
||||
maxTokens:
|
||||
typeof model.top_provider.max_completion_tokens === 'number'
|
||||
? model.top_provider.max_completion_tokens
|
||||
: undefined,
|
||||
pricing: {
|
||||
input: formatPrice(model.pricing.prompt),
|
||||
output: formatPrice(model.pricing.completion),
|
||||
},
|
||||
reasoning: baseModel.reasoning || extraInfo?.endpoint?.supports_reasoning || false,
|
||||
releasedAt: new Date(model.created * 1000).toISOString().split('T')[0],
|
||||
vision: baseModel.vision || model.architecture.modality.includes('image') || false,
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as ChatModelCard[];
|
||||
return await processMultiProviderModelList(formattedModels, 'openrouter');
|
||||
},
|
||||
provider: ModelProvider.OpenRouter,
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { ChatModelCard } from '@/types/llm';
|
||||
|
||||
import { ModelProvider } from '../types';
|
||||
import { processMultiProviderModelList } from '../utils/modelParse';
|
||||
import { createOpenAICompatibleRuntime } from '../utils/openaiCompatibleFactory';
|
||||
|
||||
export interface QiniuModelCard {
|
||||
@@ -14,34 +13,11 @@ export const LobeQiniuAI = createOpenAICompatibleRuntime({
|
||||
chatCompletion: () => process.env.DEBUG_QINIU_CHAT_COMPLETION === '1',
|
||||
},
|
||||
models: async ({ client }) => {
|
||||
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
|
||||
const { DEFAULT_MODEL_PROVIDER_LIST } = await import('@/config/modelProviders');
|
||||
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: QiniuModelCard[] = modelsPage.data;
|
||||
|
||||
return modelList
|
||||
.map((model) => {
|
||||
const knownModelProvlder = DEFAULT_MODEL_PROVIDER_LIST.find(
|
||||
(mp) => mp.id.toLowerCase() === ModelProvider.Qiniu.toLowerCase(),
|
||||
);
|
||||
|
||||
const knownModel = (knownModelProvlder?.chatModels ?? LOBE_DEFAULT_MODEL_LIST).find(
|
||||
(m) => model.id.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
|
||||
const abilities = knownModel && 'abilities' in knownModel ? knownModel.abilities : {};
|
||||
return {
|
||||
contextWindowTokens: knownModel?.contextWindowTokens ?? undefined,
|
||||
displayName: knownModel?.displayName ?? undefined,
|
||||
enabled: knownModel?.enabled || false,
|
||||
functionCall: abilities?.functionCall || false,
|
||||
id: model.id,
|
||||
reasoning: abilities?.reasoning || false,
|
||||
vision: abilities?.vision || false,
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as ChatModelCard[];
|
||||
// 自动检测模型提供商并选择相应配置
|
||||
return processMultiProviderModelList(modelList, 'qiniu');
|
||||
},
|
||||
provider: ModelProvider.Qiniu,
|
||||
});
|
||||
|
||||
@@ -88,7 +88,7 @@ export const LobeQwenAI = createOpenAICompatibleRuntime({
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: QwenModelCard[] = modelsPage.data;
|
||||
|
||||
return processMultiProviderModelList(modelList);
|
||||
return processMultiProviderModelList(modelList, 'qwen');
|
||||
},
|
||||
provider: ModelProvider.Qwen,
|
||||
});
|
||||
|
||||
@@ -71,7 +71,7 @@ export const LobeSiliconCloudAI = createOpenAICompatibleRuntime({
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: SiliconCloudModelCard[] = modelsPage.data;
|
||||
|
||||
return processMultiProviderModelList(modelList);
|
||||
return processMultiProviderModelList(modelList, 'siliconcloud');
|
||||
},
|
||||
provider: ModelProvider.SiliconCloud,
|
||||
});
|
||||
|
||||
@@ -181,7 +181,7 @@ describe('modelParse', () => {
|
||||
|
||||
const gpt4Result = result.find((m) => m.id === 'gpt-4')!;
|
||||
expect(gpt4Result.displayName).toBe('GPT-4');
|
||||
expect(gpt4Result.enabled).toBe(true);
|
||||
expect(gpt4Result.enabled).toBe(false);
|
||||
expect(gpt4Result.contextWindowTokens).toBe(8192);
|
||||
expect(gpt4Result.maxOutput).toBe(4096);
|
||||
expect(gpt4Result.functionCall).toBe(false); // From knownModel.abilities
|
||||
@@ -287,7 +287,7 @@ describe('modelParse', () => {
|
||||
{ id: 'unknown-model-for-enabled-test' }, // unknown
|
||||
];
|
||||
const result = await processModelList(modelList, config);
|
||||
expect(result.find((m) => m.id === 'gpt-4')!.enabled).toBe(true);
|
||||
expect(result.find((m) => m.id === 'gpt-4')!.enabled).toBe(false);
|
||||
expect(result.find((m) => m.id === 'model-known-disabled')!.enabled).toBe(false);
|
||||
expect(result.find((m) => m.id === 'unknown-model-for-enabled-test')!.enabled).toBe(false);
|
||||
});
|
||||
@@ -406,9 +406,9 @@ describe('modelParse', () => {
|
||||
expect(model.displayName).toBe('Test Claude Known Abilities');
|
||||
// 虽然 'claude' 是 anthropic 的 functionCall 和 vision 关键词,
|
||||
// 但是 knownModel.abilities.functionCall 和 knownModel.abilities.vision 是 false
|
||||
// 关键词匹配优先,所以应该是 true
|
||||
expect(model.functionCall).toBe(true); // 关键词 'claude' 匹配
|
||||
expect(model.vision).toBe(true); // 关键词 'claude' 匹配
|
||||
// 本地模型配置优先,所以应该是 false
|
||||
expect(model.functionCall).toBe(false); // 从 knownModel.abilities.functionCall
|
||||
expect(model.vision).toBe(false); // 从 knownModel.abilities.vision
|
||||
expect(model.reasoning).toBe(true); // 从 knownModel.abilities.reasoning
|
||||
});
|
||||
|
||||
@@ -490,7 +490,7 @@ describe('modelParse', () => {
|
||||
expect(result[0].displayName).toBe('Direct Special Model'); // From model (priority)
|
||||
expect(result[0].contextWindowTokens).toBe(5000); // From model (priority)
|
||||
expect(result[0].maxOutput).toBe(2000); // From knownModel
|
||||
expect(result[0].enabled).toBe(true); // From knownModel
|
||||
expect(result[0].enabled).toBe(false);
|
||||
});
|
||||
|
||||
it('should correctly process reasoning capabilities based on keywords', async () => {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import type { ChatModelCard } from '@/types/llm';
|
||||
|
||||
import type { ModelProviderKey } from '../types';
|
||||
|
||||
export interface ModelProcessorConfig {
|
||||
excludeKeywords?: readonly string[]; // 对符合的模型不添加标签
|
||||
functionCallKeywords?: readonly string[];
|
||||
@@ -26,7 +28,12 @@ export const MODEL_LIST_CONFIGS = {
|
||||
llama: {
|
||||
functionCallKeywords: ['llama-3.2', 'llama-3.3', 'llama-4'],
|
||||
reasoningKeywords: [],
|
||||
visionKeywords: [],
|
||||
visionKeywords: ['llava'],
|
||||
},
|
||||
moonshot: {
|
||||
functionCallKeywords: ['moonshot', 'kimi'],
|
||||
reasoningKeywords: ['thinking'],
|
||||
visionKeywords: ['vision', 'kimi-latest', 'kimi-thinking-preview'],
|
||||
},
|
||||
openai: {
|
||||
excludeKeywords: ['audio'],
|
||||
@@ -45,7 +52,7 @@ export const MODEL_LIST_CONFIGS = {
|
||||
'qwen2.5',
|
||||
'qwen3',
|
||||
],
|
||||
reasoningKeywords: ['qvq', 'qwq', 'qwen3'],
|
||||
reasoningKeywords: ['qvq', 'qwq', 'qwen3', '!-instruct-', '!-coder-'],
|
||||
visionKeywords: ['qvq', 'vl'],
|
||||
},
|
||||
v0: {
|
||||
@@ -54,9 +61,14 @@ export const MODEL_LIST_CONFIGS = {
|
||||
visionKeywords: ['v0'],
|
||||
},
|
||||
volcengine: {
|
||||
functionCallKeywords: ['doubao-1.5'],
|
||||
reasoningKeywords: ['thinking', '-r1'],
|
||||
visionKeywords: ['vision', '-m'],
|
||||
functionCallKeywords: ['1.5', '1-5', '1.6', '1-6'],
|
||||
reasoningKeywords: ['thinking', 'seed', 'ui-tars'],
|
||||
visionKeywords: ['vision', '-m', 'seed', 'ui-tars'],
|
||||
},
|
||||
xai: {
|
||||
functionCallKeywords: ['grok'],
|
||||
reasoningKeywords: ['mini', 'grok-4'],
|
||||
visionKeywords: ['vision', 'grok-4'],
|
||||
},
|
||||
zeroone: {
|
||||
functionCallKeywords: ['fc'],
|
||||
@@ -65,7 +77,7 @@ export const MODEL_LIST_CONFIGS = {
|
||||
zhipu: {
|
||||
functionCallKeywords: ['glm-4', 'glm-z1'],
|
||||
reasoningKeywords: ['glm-zero', 'glm-z1', 'glm-4.5'],
|
||||
visionKeywords: ['glm-4v'],
|
||||
visionKeywords: ['glm-4v', 'glm-4.1v', 'glm-4.5v'],
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -74,15 +86,107 @@ export const PROVIDER_DETECTION_CONFIG = {
|
||||
anthropic: ['claude'],
|
||||
deepseek: ['deepseek'],
|
||||
google: ['gemini'],
|
||||
llama: ['llama'],
|
||||
llama: ['llama', 'llava'],
|
||||
moonshot: ['moonshot', 'kimi'],
|
||||
openai: ['o1', 'o3', 'o4', 'gpt-'],
|
||||
qwen: ['qwen', 'qwq', 'qvq'],
|
||||
v0: ['v0'],
|
||||
volcengine: ['doubao'],
|
||||
xai: ['grok'],
|
||||
zeroone: ['yi-'],
|
||||
zhipu: ['glm'],
|
||||
} as const;
|
||||
|
||||
// 图像模型关键词配置
|
||||
export const IMAGE_MODEL_KEYWORDS = [
|
||||
'dall-e',
|
||||
'dalle',
|
||||
'midjourney',
|
||||
'stable-diffusion',
|
||||
'sd',
|
||||
'flux',
|
||||
'imagen',
|
||||
'firefly',
|
||||
'cogview',
|
||||
'wanxiang',
|
||||
'DESCRIBE',
|
||||
'UPSCALE',
|
||||
'-image',
|
||||
'^V3',
|
||||
'^V_2',
|
||||
'^V_1',
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* 检测关键词列表是否匹配模型ID(支持多种匹配模式)
|
||||
* @param modelId 模型ID(小写)
|
||||
* @param keywords 关键词列表,支持以下前缀:
|
||||
* - ^ 开头:只在模型ID开头匹配
|
||||
* - ! 开头:排除匹配,优先级最高
|
||||
* - 无前缀:包含匹配(默认行为)
|
||||
* @returns 是否匹配(排除逻辑优先)
|
||||
*/
|
||||
const isKeywordListMatch = (modelId: string, keywords: readonly string[]): boolean => {
|
||||
// 先检查排除规则(感叹号开头)
|
||||
const excludeKeywords = keywords.filter((keyword) => keyword.startsWith('!'));
|
||||
const includeKeywords = keywords.filter((keyword) => !keyword.startsWith('!'));
|
||||
|
||||
// 如果匹配任何排除规则,直接返回 false
|
||||
for (const excludeKeyword of excludeKeywords) {
|
||||
const keywordWithoutPrefix = excludeKeyword.slice(1);
|
||||
const isMatch = keywordWithoutPrefix.startsWith('^')
|
||||
? modelId.startsWith(keywordWithoutPrefix.slice(1))
|
||||
: modelId.includes(keywordWithoutPrefix);
|
||||
|
||||
if (isMatch) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 检查包含规则
|
||||
return includeKeywords.some((keyword) => {
|
||||
if (keyword.startsWith('^')) {
|
||||
// ^ 开头则只在开头匹配
|
||||
const keywordWithoutPrefix = keyword.slice(1);
|
||||
return modelId.startsWith(keywordWithoutPrefix);
|
||||
}
|
||||
// 默认行为:包含匹配
|
||||
return modelId.includes(keyword);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据提供商类型查找对应的本地模型配置
|
||||
* @param modelId 模型ID
|
||||
* @param provider 提供商类型
|
||||
* @returns 匹配的本地模型配置
|
||||
*/
|
||||
const findKnownModelByProvider = async (
|
||||
modelId: string,
|
||||
provider: keyof typeof MODEL_LIST_CONFIGS,
|
||||
): Promise<any> => {
|
||||
const lowerModelId = modelId.toLowerCase();
|
||||
|
||||
try {
|
||||
// 动态构建导入路径
|
||||
const modulePath = `@/config/aiModels/${provider}`;
|
||||
|
||||
// 尝试动态导入对应的配置文件
|
||||
const moduleImport = await import(modulePath);
|
||||
const providerModels = moduleImport.default;
|
||||
|
||||
// 如果导入成功且有数据,进行查找
|
||||
if (Array.isArray(providerModels)) {
|
||||
return providerModels.find((m) => m.id.toLowerCase() === lowerModelId);
|
||||
}
|
||||
|
||||
return null;
|
||||
} catch {
|
||||
// 如果导入失败(文件不存在或其他错误),返回 null
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 检测单个模型的提供商类型
|
||||
* @param modelId 模型ID
|
||||
@@ -92,7 +196,7 @@ export const detectModelProvider = (modelId: string): keyof typeof MODEL_LIST_CO
|
||||
const lowerModelId = modelId.toLowerCase();
|
||||
|
||||
for (const [provider, keywords] of Object.entries(PROVIDER_DETECTION_CONFIG)) {
|
||||
const hasKeyword = keywords.some((keyword) => lowerModelId.includes(keyword));
|
||||
const hasKeyword = isKeywordListMatch(lowerModelId, keywords);
|
||||
|
||||
if (hasKeyword && provider in MODEL_LIST_CONFIGS) {
|
||||
return provider as keyof typeof MODEL_LIST_CONFIGS;
|
||||
@@ -102,6 +206,44 @@ export const detectModelProvider = (modelId: string): keyof typeof MODEL_LIST_CO
|
||||
return 'openai';
|
||||
};
|
||||
|
||||
/**
|
||||
* 将时间戳转换为日期字符串
|
||||
* @param timestamp 时间戳(秒)
|
||||
* @returns 格式化的日期字符串 (YYYY-MM-DD)
|
||||
*/
|
||||
const formatTimestampToDate = (timestamp: number): string => {
|
||||
const date = new Date(timestamp * 1000); // 将秒转换为毫秒
|
||||
return date.toISOString().split('T')[0]; // 返回 YYYY-MM-DD 格式
|
||||
};
|
||||
|
||||
/**
|
||||
* 处理 releasedAt 字段
|
||||
* @param model 模型对象
|
||||
* @param knownModel 已知模型配置
|
||||
* @returns 处理后的 releasedAt 值
|
||||
*/
|
||||
const processReleasedAt = (model: any, knownModel?: any): string | undefined => {
|
||||
// 优先检查 model.created
|
||||
if (model.created !== undefined && model.created !== null) {
|
||||
// 检查是否为时间戳格式
|
||||
if (typeof model.created === 'number' && model.created > 1_630_000_000) {
|
||||
// AiHubMix 错误时间戳为 1626777600
|
||||
return formatTimestampToDate(model.created);
|
||||
}
|
||||
// 如果 created 是字符串且已经是日期格式,直接返回
|
||||
if (typeof model.created === 'string') {
|
||||
// Anthropic:若为 '2025-02-19T00:00:00Z' 只取日期部分
|
||||
if (/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(model.created)) {
|
||||
return model.created.split('T')[0];
|
||||
}
|
||||
return model.created;
|
||||
}
|
||||
}
|
||||
|
||||
// 回退到原有逻辑
|
||||
return model.releasedAt ?? knownModel?.releasedAt ?? undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* 处理模型卡片的通用逻辑
|
||||
*/
|
||||
@@ -117,31 +259,41 @@ const processModelCard = (
|
||||
excludeKeywords = [],
|
||||
} = config;
|
||||
|
||||
const isExcludedModel = excludeKeywords.some((keyword) =>
|
||||
model.id.toLowerCase().includes(keyword),
|
||||
);
|
||||
const isExcludedModel = isKeywordListMatch(model.id.toLowerCase(), excludeKeywords);
|
||||
|
||||
return {
|
||||
contextWindowTokens: model.contextWindowTokens ?? knownModel?.contextWindowTokens ?? undefined,
|
||||
displayName: model.displayName ?? knownModel?.displayName ?? model.id,
|
||||
enabled: knownModel?.enabled || false,
|
||||
description: model.description ?? knownModel?.description ?? '',
|
||||
displayName: (model.displayName ?? knownModel?.displayName ?? model.id)
|
||||
.replaceAll(/\s*[((][^))]*[))]\s*/g, '')
|
||||
.trim(), // 去除括号内容
|
||||
enabled: model?.enabled || false,
|
||||
functionCall:
|
||||
(functionCallKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) &&
|
||||
!isExcludedModel) ||
|
||||
knownModel?.abilities?.functionCall ||
|
||||
false,
|
||||
model.functionCall ??
|
||||
knownModel?.abilities?.functionCall ??
|
||||
((isKeywordListMatch(model.id.toLowerCase(), functionCallKeywords) && !isExcludedModel) ||
|
||||
false),
|
||||
id: model.id,
|
||||
maxOutput: model.maxOutput ?? knownModel?.maxOutput ?? undefined,
|
||||
// pricing: knownModel?.pricing ?? undefined,
|
||||
reasoning:
|
||||
reasoningKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) ||
|
||||
knownModel?.abilities?.reasoning ||
|
||||
false,
|
||||
type: model.type || knownModel?.type || 'chat',
|
||||
model.reasoning ??
|
||||
knownModel?.abilities?.reasoning ??
|
||||
(isKeywordListMatch(model.id.toLowerCase(), reasoningKeywords) || false),
|
||||
releasedAt: processReleasedAt(model, knownModel),
|
||||
type:
|
||||
model.type ||
|
||||
knownModel?.type ||
|
||||
(isKeywordListMatch(
|
||||
model.id.toLowerCase(),
|
||||
IMAGE_MODEL_KEYWORDS.map((k) => k.toLowerCase()),
|
||||
)
|
||||
? 'image'
|
||||
: 'chat'),
|
||||
vision:
|
||||
(visionKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) &&
|
||||
!isExcludedModel) ||
|
||||
knownModel?.abilities?.vision ||
|
||||
false,
|
||||
model.vision ??
|
||||
knownModel?.abilities?.vision ??
|
||||
((isKeywordListMatch(model.id.toLowerCase(), visionKeywords) && !isExcludedModel) || false),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -149,45 +301,91 @@ const processModelCard = (
|
||||
* 处理单一提供商的模型列表
|
||||
* @param modelList 模型列表
|
||||
* @param config 提供商配置
|
||||
* @param provider 提供商类型(可选,用于优先匹配对应的本地配置)
|
||||
* @returns 处理后的模型卡片列表
|
||||
*/
|
||||
export const processModelList = async (
|
||||
modelList: Array<{ id: string }>,
|
||||
config: ModelProcessorConfig,
|
||||
provider?: keyof typeof MODEL_LIST_CONFIGS,
|
||||
): Promise<ChatModelCard[]> => {
|
||||
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
|
||||
|
||||
return modelList
|
||||
.map((model) => {
|
||||
const knownModel = LOBE_DEFAULT_MODEL_LIST.find(
|
||||
(m) => model.id.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
return Promise.all(
|
||||
modelList.map(async (model) => {
|
||||
let knownModel: any = null;
|
||||
|
||||
// 如果提供了provider,优先使用提供商特定的配置
|
||||
if (provider) {
|
||||
knownModel = await findKnownModelByProvider(model.id, provider);
|
||||
}
|
||||
|
||||
// 如果未找到,回退到全局配置
|
||||
if (!knownModel) {
|
||||
knownModel = LOBE_DEFAULT_MODEL_LIST.find(
|
||||
(m) => model.id.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
}
|
||||
|
||||
return processModelCard(model, config, knownModel);
|
||||
})
|
||||
.filter(Boolean);
|
||||
}),
|
||||
).then((results) => results.filter(Boolean));
|
||||
};
|
||||
|
||||
/**
|
||||
* 处理混合提供商的模型列表
|
||||
* @param modelList 模型列表
|
||||
* @param providerid 可选的提供商ID,用于获取其本地配置文件
|
||||
* @returns 处理后的模型卡片列表
|
||||
*/
|
||||
export const processMultiProviderModelList = async (
|
||||
modelList: Array<{ id: string }>,
|
||||
providerid?: ModelProviderKey,
|
||||
): Promise<ChatModelCard[]> => {
|
||||
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
|
||||
|
||||
return modelList
|
||||
.map((model) => {
|
||||
// 如果提供了 providerid,尝试获取该提供商的本地配置
|
||||
let providerLocalConfig: any[] | null = null;
|
||||
if (providerid) {
|
||||
try {
|
||||
const modulePath = `@/config/aiModels/${providerid}`;
|
||||
const moduleImport = await import(modulePath);
|
||||
providerLocalConfig = moduleImport.default;
|
||||
} catch {
|
||||
// 如果配置文件不存在或导入失败,保持为 null
|
||||
providerLocalConfig = null;
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.all(
|
||||
modelList.map(async (model) => {
|
||||
const detectedProvider = detectModelProvider(model.id);
|
||||
const config = MODEL_LIST_CONFIGS[detectedProvider];
|
||||
|
||||
const knownModel = LOBE_DEFAULT_MODEL_LIST.find(
|
||||
(m) => model.id.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
// 优先使用提供商特定的配置
|
||||
let knownModel = await findKnownModelByProvider(model.id, detectedProvider);
|
||||
|
||||
return processModelCard(model, config, knownModel);
|
||||
})
|
||||
.filter(Boolean);
|
||||
// 如果未找到,回退到全局配置
|
||||
if (!knownModel) {
|
||||
knownModel = LOBE_DEFAULT_MODEL_LIST.find(
|
||||
(m) => model.id.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
}
|
||||
|
||||
// 如果提供了 providerid 且有本地配置,尝试从中获取模型的 enabled 状态
|
||||
let providerLocalModelConfig = null;
|
||||
if (providerLocalConfig && Array.isArray(providerLocalConfig)) {
|
||||
providerLocalModelConfig = providerLocalConfig.find((m) => m.id === model.id);
|
||||
}
|
||||
|
||||
const processedModel = processModelCard(model, config, knownModel);
|
||||
|
||||
// 如果找到了本地配置中的模型,使用其 enabled 状态
|
||||
if (providerLocalModelConfig && typeof providerLocalModelConfig.enabled === 'boolean') {
|
||||
processedModel.enabled = providerLocalModelConfig.enabled;
|
||||
}
|
||||
|
||||
return processedModel;
|
||||
}),
|
||||
).then((results) => results.filter(Boolean));
|
||||
};
|
||||
|
||||
@@ -188,6 +188,18 @@ const transformOpenAIStream = (
|
||||
let reasoning_content = (() => {
|
||||
if ('reasoning_content' in item.delta) return item.delta.reasoning_content;
|
||||
if ('reasoning' in item.delta) return item.delta.reasoning;
|
||||
// Handle content array format with thinking blocks (e.g. mistral AI Magistral model)
|
||||
if ('content' in item.delta && Array.isArray(item.delta.content)) {
|
||||
return item.delta.content
|
||||
.filter((block: any) => block.type === 'thinking' && Array.isArray(block.thinking))
|
||||
.map((block: any) =>
|
||||
block.thinking
|
||||
.filter((thinkItem: any) => thinkItem.type === 'text' && thinkItem.text)
|
||||
.map((thinkItem: any) => thinkItem.text)
|
||||
.join('')
|
||||
)
|
||||
.join('');
|
||||
}
|
||||
return null;
|
||||
})();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ModelProvider } from '../types';
|
||||
import { processMultiProviderModelList } from '../utils/modelParse';
|
||||
import { MODEL_LIST_CONFIGS, processModelList } from '../utils/modelParse';
|
||||
import { createOpenAICompatibleRuntime } from '../utils/openaiCompatibleFactory';
|
||||
|
||||
export interface V0ModelCard {
|
||||
@@ -15,7 +15,7 @@ export const LobeV0AI = createOpenAICompatibleRuntime({
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: V0ModelCard[] = modelsPage.data;
|
||||
|
||||
return processMultiProviderModelList(modelList);
|
||||
return processModelList(modelList, MODEL_LIST_CONFIGS.v0, 'v0');
|
||||
},
|
||||
provider: ModelProvider.V0,
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ export const LobeVolcengineAI = createOpenAICompatibleRuntime({
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: VolcengineModelCard[] = modelsPage.data;
|
||||
|
||||
return processModelList(modelList, MODEL_LIST_CONFIGS.volcengine);
|
||||
return processModelList(modelList, MODEL_LIST_CONFIGS.volcengine, 'volcengine');
|
||||
},
|
||||
provider: ModelProvider.Volcengine,
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { ChatModelCard } from '@/types/llm';
|
||||
|
||||
import { ModelProvider } from '../types';
|
||||
import { MODEL_LIST_CONFIGS, processModelList } from '../utils/modelParse';
|
||||
import { createOpenAICompatibleRuntime } from '../utils/openaiCompatibleFactory';
|
||||
|
||||
export interface XAIModelCard {
|
||||
@@ -55,31 +54,10 @@ export const LobeXAI = createOpenAICompatibleRuntime({
|
||||
chatCompletion: () => process.env.DEBUG_XAI_CHAT_COMPLETION === '1',
|
||||
},
|
||||
models: async ({ client }) => {
|
||||
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
|
||||
|
||||
const modelsPage = (await client.models.list()) as any;
|
||||
const modelList: XAIModelCard[] = modelsPage.data;
|
||||
|
||||
return modelList
|
||||
.map((model) => {
|
||||
const knownModel = LOBE_DEFAULT_MODEL_LIST.find(
|
||||
(m) => model.id.toLowerCase() === m.id.toLowerCase(),
|
||||
);
|
||||
|
||||
return {
|
||||
contextWindowTokens: knownModel?.contextWindowTokens ?? undefined,
|
||||
displayName: knownModel?.displayName ?? undefined,
|
||||
enabled: knownModel?.enabled || false,
|
||||
functionCall: knownModel?.abilities?.functionCall || false,
|
||||
id: model.id,
|
||||
reasoning: knownModel?.abilities?.reasoning || false,
|
||||
vision:
|
||||
model.id.toLowerCase().includes('vision') ||
|
||||
knownModel?.abilities?.functionCall ||
|
||||
false,
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as ChatModelCard[];
|
||||
return processModelList(modelList, MODEL_LIST_CONFIGS.xai, 'xai');
|
||||
},
|
||||
provider: ModelProvider.XAI,
|
||||
});
|
||||
|
||||
@@ -134,7 +134,7 @@ export const LobeZhipuAI = createOpenAICompatibleRuntime({
|
||||
displayName: model.modelName,
|
||||
id: model.modelCode,
|
||||
}));
|
||||
return processModelList(standardModelList, MODEL_LIST_CONFIGS.zhipu);
|
||||
return processModelList(standardModelList, MODEL_LIST_CONFIGS.zhipu, 'zhipu');
|
||||
},
|
||||
provider: ModelProvider.ZhiPu,
|
||||
});
|
||||
|
||||
@@ -328,7 +328,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
search: true,
|
||||
},
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
@@ -344,16 +343,12 @@ const aihubmixModels: AIChatModelCard[] = [
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-04-03',
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
},
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
@@ -370,7 +365,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
||||
releasedAt: '2025-04-03',
|
||||
settings: {
|
||||
extendParams: ['reasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -780,4 +774,4 @@ const aihubmixModels: AIChatModelCard[] = [
|
||||
},
|
||||
];
|
||||
|
||||
export default aihubmixModels;
|
||||
export default aihubmixModels;
|
||||
@@ -113,7 +113,6 @@ const anthropicChatModels: AIChatModelCard[] = [
|
||||
description:
|
||||
'Claude 3.7 Sonnet 是 Anthropic 迄今为止最智能的模型,也是市场上首个混合推理模型。Claude 3.7 Sonnet 可以产生近乎即时的响应或延长的逐步思考,用户可以清晰地看到这些过程。Sonnet 特别擅长编程、数据科学、视觉处理、代理任务。',
|
||||
displayName: 'Claude 3.7 Sonnet',
|
||||
enabled: true,
|
||||
id: 'claude-3-7-sonnet-20250219',
|
||||
maxOutput: 64_000,
|
||||
pricing: {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { AIChatModelCard } from '@/types/aiModel';
|
||||
|
||||
const groqChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Compound-beta 是一个复合 AI 系统,由 GroqCloud 中已经支持的多个开放可用的模型提供支持,可以智能地、有选择地使用工具来回答用户查询。',
|
||||
displayName: 'Compound Beta',
|
||||
@@ -15,7 +15,7 @@ const groqChatModels: AIChatModelCard[] = [
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Compound-beta-mini 是一个复合 AI 系统,由 GroqCloud 中已经支持的公开可用模型提供支持,可以智能地、有选择地使用工具来回答用户查询。',
|
||||
displayName: 'Compound Beta Mini',
|
||||
@@ -121,7 +121,7 @@ const groqChatModels: AIChatModelCard[] = [
|
||||
contextWindowTokens: 131_072,
|
||||
displayName: 'Qwen3 32B',
|
||||
id: 'qwen/qwen3-32b',
|
||||
maxOutput: 131_072,
|
||||
maxOutput: 40_960,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0.29, strategy: 'fixed', unit: 'millionTokens' },
|
||||
@@ -147,23 +147,6 @@ const groqChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
},
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Gemma 2 9B 是一款优化用于特定任务和工具整合的模型。',
|
||||
displayName: 'Gemma 2 9B',
|
||||
id: 'gemma2-9b-it',
|
||||
maxOutput: 8192,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -186,7 +169,7 @@ const groqChatModels: AIChatModelCard[] = [
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
},
|
||||
contextWindowTokens: 32_768,
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Meta Llama 3.3 多语言大语言模型 ( LLM ) 是 70B(文本输入/文本输出)中的预训练和指令调整生成模型。 Llama 3.3 指令调整的纯文本模型针对多语言对话用例进行了优化,并且在常见行业基准上优于许多可用的开源和封闭式聊天模型。',
|
||||
displayName: 'Llama 3.3 70B Versatile',
|
||||
|
||||
@@ -342,7 +342,7 @@ const hunyuanChatModels: AIChatModelCard[] = [
|
||||
{ name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-05-20',
|
||||
releasedAt: '2025-07-16',
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
|
||||
@@ -42,9 +42,9 @@ const mistralChatModels: AIChatModelCard[] = [
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
},
|
||||
contextWindowTokens: 32_000,
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Mistral Small是成本效益高、快速且可靠的选项,适用于翻译、摘要和情感分析等用例。',
|
||||
displayName: 'Mistral Small 3.1',
|
||||
displayName: 'Mistral Small 3.2',
|
||||
enabled: true,
|
||||
id: 'mistral-small-latest',
|
||||
pricing: {
|
||||
@@ -62,7 +62,7 @@ const mistralChatModels: AIChatModelCard[] = [
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Mistral Large是旗舰大模型,擅长多语言任务、复杂推理和代码生成,是高端应用的理想选择。',
|
||||
displayName: 'Mistral Large 24.11',
|
||||
displayName: 'Mistral Large 2.1',
|
||||
enabled: true,
|
||||
id: 'mistral-large-latest',
|
||||
pricing: {
|
||||
@@ -73,6 +73,23 @@ const mistralChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
reasoning: true,
|
||||
},
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Magistral Medium 1.1 是 Mistral AI 于2025年7月发布的前沿级推理模型。',
|
||||
displayName: 'Magistral Medium 1.1',
|
||||
enabled: true,
|
||||
id: 'magistral-medium-latest',
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -80,7 +97,7 @@ const mistralChatModels: AIChatModelCard[] = [
|
||||
contextWindowTokens: 256_000,
|
||||
description:
|
||||
'Codestral 是我们最先进的编码语言模型,第二个版本于2025年1月发布,专门从事低延迟、高频任务如中间填充(RST)、代码纠正和测试生成。',
|
||||
displayName: 'Codestral',
|
||||
displayName: 'Codestral 2508',
|
||||
id: 'codestral-latest',
|
||||
pricing: {
|
||||
units: [
|
||||
@@ -88,7 +105,7 @@ const mistralChatModels: AIChatModelCard[] = [
|
||||
{ name: 'textOutput', rate: 0.9, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-01-13',
|
||||
releasedAt: '2025-07-30',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
|
||||
@@ -23,6 +23,26 @@ const moonshotChatModels: AIChatModelCard[] = [
|
||||
releasedAt: '2025-07-11',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
},
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'kimi-k2 是一款具备超强代码和 Agent 能力的 MoE 架构基础模型,总参数 1T,激活参数 32B。在通用知识推理、编程、数学、Agent 等主要类别的基准性能测试中,K2 模型的性能超过其他主流开源模型。',
|
||||
displayName: 'Kimi K2 Turbo',
|
||||
id: 'kimi-k2-turbo-preview',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 64, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-07-11',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
|
||||
@@ -352,28 +352,6 @@ export const openaiChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
reasoning: true,
|
||||
},
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'o1是OpenAI新的推理模型,适用于需要广泛通用知识的复杂任务。该模型具有128K上下文和2023年10月的知识截止日期。',
|
||||
displayName: 'o1-preview',
|
||||
id: 'o1-preview',
|
||||
maxOutput: 32_768,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2024-09-12',
|
||||
settings: {
|
||||
extendParams: ['reasoningEffort'],
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -443,27 +421,6 @@ export const openaiChatModels: AIChatModelCard[] = [
|
||||
releasedAt: '2025-04-14',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'GPT-4.5 的研究预览版,它是我们迄今为止最大、最强大的 GPT 模型。它拥有广泛的世界知识,并能更好地理解用户意图,使其在创造性任务和自主规划方面表现出色。GPT-4.5 可接受文本和图像输入,并生成文本输出(包括结构化输出)。支持关键的开发者功能,如函数调用、批量 API 和流式输出。在需要创造性、开放式思考和对话的任务(如写作、学习或探索新想法)中,GPT-4.5 表现尤为出色。知识截止日期为 2023 年 10 月。',
|
||||
displayName: 'GPT-4.5 Preview',
|
||||
id: 'gpt-4.5-preview', // deprecated on 2025-07-14
|
||||
maxOutput: 16_384,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 37.5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 75, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 150, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-02-27',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
|
||||
@@ -60,7 +60,7 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
config: {
|
||||
deploymentName: 'qwen3-coder-flash',
|
||||
},
|
||||
contextWindowTokens: 1_048_576,
|
||||
contextWindowTokens: 1_000_000,
|
||||
description:
|
||||
'通义千问代码模型。最新的 Qwen3-Coder 系列模型是基于 Qwen3 的代码生成模型,具有强大的Coding Agent能力,擅长工具调用和环境交互,能够实现自主编程,代码能力卓越的同时兼具通用能力。',
|
||||
displayName: 'Qwen3 Coder Flash',
|
||||
@@ -423,6 +423,64 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'qwen-flash',
|
||||
},
|
||||
contextWindowTokens: 1_000_000,
|
||||
description: '通义千问系列速度最快、成本极低的模型,适合简单任务。',
|
||||
displayName: 'Qwen Flash',
|
||||
enabled: true,
|
||||
id: 'qwen-flash',
|
||||
maxOutput: 32_768,
|
||||
organization: 'Qwen',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{
|
||||
name: 'textInput',
|
||||
strategy: 'tiered',
|
||||
tiers: [
|
||||
{ rate: 0.15, upTo: 0.128 },
|
||||
{ rate: 0.6, upTo: 0.256 },
|
||||
{ rate: 1.2, upTo: 'infinity' },
|
||||
],
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
name: 'textOutput',
|
||||
strategy: 'tiered',
|
||||
tiers: [
|
||||
{ rate: 1.5, upTo: 0.128 },
|
||||
{ rate: 6, upTo: 0.256 },
|
||||
{ rate: 12, upTo: 'infinity' },
|
||||
],
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
name: 'textInput_cacheRead',
|
||||
strategy: 'tiered',
|
||||
tiers: [
|
||||
{ rate: 0.15 * 0.4, upTo: 0.128 },
|
||||
{ rate: 0.6 * 0.4, upTo: 0.256 },
|
||||
{ rate: 1.2 * 0.4, upTo: 'infinity' },
|
||||
],
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-07-28',
|
||||
settings: {
|
||||
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -433,9 +491,9 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
deploymentName: 'qwen-turbo-2025-07-15',
|
||||
},
|
||||
contextWindowTokens: 1_000_000, // Non-thinking mode
|
||||
description: '通义千问超大规模语言模型,支持中文、英文等不同语言输入。',
|
||||
description:
|
||||
'通义千问 Turbo 后续不再更新,建议替换为通义千问 Flash 。通义千问超大规模语言模型,支持中文、英文等不同语言输入。',
|
||||
displayName: 'Qwen Turbo',
|
||||
enabled: true,
|
||||
id: 'qwen-turbo',
|
||||
maxOutput: 16_384,
|
||||
organization: 'Qwen',
|
||||
|
||||
@@ -23,9 +23,9 @@ const sensenovaChatModels: AIChatModelCard[] = [
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-07-23',
|
||||
settings: {
|
||||
extendParams: ['enableReasoning'],
|
||||
},
|
||||
// settings: {
|
||||
// extendParams: ['enableReasoning'],
|
||||
// },
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
@@ -47,9 +47,9 @@ const sensenovaChatModels: AIChatModelCard[] = [
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-07-23',
|
||||
settings: {
|
||||
extendParams: ['enableReasoning'],
|
||||
},
|
||||
// settings: {
|
||||
// extendParams: ['enableReasoning'],
|
||||
// },
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2,6 +2,65 @@ import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
|
||||
|
||||
// https://siliconflow.cn/zh-cn/models
|
||||
const siliconcloudChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'Step3 是由阶跃星辰(StepFun)发布的前沿多模态推理模型,它基于拥有 321B 总参数和 38B 激活参数的专家混合(MoE)架构构建。该模型采用端到端设计,旨在最小化解码成本,同时在视觉语言推理方面提供顶级性能。通过多矩阵分解注意力(MFA)和注意力-FFN 解耦(AFD)的协同设计,Step3 在旗舰级和低端加速器上都能保持卓越的效率。在预训练阶段,Step3 处理了超过 20T 的文本 token 和 4T 的图文混合 token,覆盖十多种语言。该模型在数学、代码及多模态等多个基准测试中均达到了开源模型的领先水平。',
|
||||
displayName: 'Step 3',
|
||||
id: 'stepfun-ai/step3',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-07-31',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
},
|
||||
contextWindowTokens: 262_144,
|
||||
description:
|
||||
'Qwen3-Coder-480B-A35B-Instruct 是由阿里巴巴发布的、迄今为止最具代理(Agentic)能力的代码模型。它是一个拥有 4800 亿总参数和 350 亿激活参数的混合专家(MoE)模型,在效率和性能之间取得了平衡。该模型原生支持 256K(约 26 万) tokens 的上下文长度,并可通过 YaRN 等外推方法扩展至 100 万 tokens,使其能够处理大规模代码库和复杂的编程任务。Qwen3-Coder 专为代理式编码工作流设计,不仅能生成代码,还能与开发工具和环境自主交互,以解决复杂的编程问题。在多个编码和代理任务的基准测试中,该模型在开源模型中取得了顶尖水平,其性能可与 Claude Sonnet 4 等领先模型相媲美。',
|
||||
displayName: 'Qwen3 Coder 480B A35B Instruct',
|
||||
id: 'Qwen/Qwen3-Coder-480B-A35B-Instruct',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-07-23',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
},
|
||||
contextWindowTokens: 262_144,
|
||||
description:
|
||||
'Qwen3-Coder-30B-A3B-Instruct 是由阿里巴巴通义千问团队开发的 Qwen3 系列中的代码模型。作为一个经过精简优化的模型,它在保持高性能和高效率的同时,专注于提升代码处理能力。该模型在代理式编程(Agentic Coding)、自动化浏览器操作和工具调用等复杂任务上,于开源模型中表现出显著的性能优势。它原生支持 256K tokens 的长上下文,并可扩展至 1M tokens,从而能够更好地进行代码库级别的理解和处理。此外,该模型为 Qwen Code、CLINE 等平台提供了强大的代理编码支持,并设计了专门的函数调用格式。',
|
||||
displayName: 'Qwen3 Coder 30B A3B Instruct',
|
||||
id: 'Qwen/Qwen3-Coder-30B-A3B-Instruct',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0.7, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 2.8, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-07-31',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -226,6 +285,27 @@ const siliconcloudChatModels: AIChatModelCard[] = [
|
||||
releasedAt: '2025-07-21',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
},
|
||||
contextWindowTokens: 262_144,
|
||||
description:
|
||||
'Qwen3-30B-A3B-Thinking-2507 是由阿里巴巴通义千问团队发布的 Qwen3 系列的最新思考模型。作为一个拥有 305 亿总参数和 33 亿激活参数的混合专家(MoE)模型,它专注于提升复杂任务的处理能力。该模型在逻辑推理、数学、科学、编程和需要人类专业知识的学术基准测试上表现出显著的性能提升。同时,它在指令遵循、工具使用、文本生成和与人类偏好对齐等通用能力方面也得到了显著增强。模型原生支持 256K 的长上下文理解能力,并可扩展至 100 万 tokens。此版本专为“思考模式”设计,旨在通过详尽的逐步推理来解决高度复杂的任务,其 Agent 智能体能力也表现出色。',
|
||||
displayName: 'Qwen3 30B A3B Thinking 2507',
|
||||
id: 'Qwen/Qwen3-30B-A3B-Thinking-2507',
|
||||
organization: 'Qwen',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0.7, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 2.8, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-07-30',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
|
||||
@@ -3,6 +3,42 @@ import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
|
||||
// https://platform.stepfun.com/docs/pricing/details
|
||||
|
||||
const stepfunChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
reasoning: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 64_000,
|
||||
description:
|
||||
'该模型拥有强大的视觉感知和复杂推理能力。可准确完成跨领域的复杂知识理解、数学与视觉信息的交叉分析,以及日常生活中的各类视觉分析问题。',
|
||||
displayName: 'Step 3',
|
||||
enabled: true,
|
||||
id: 'step-3',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{
|
||||
name: 'textInput',
|
||||
strategy: 'tiered',
|
||||
tiers: [
|
||||
{ rate: 1.5, upTo: 0.004 },
|
||||
{ rate: 4, upTo: 'infinity' },
|
||||
],
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
name: 'textOutput',
|
||||
strategy: 'tiered',
|
||||
tiers: [
|
||||
{ rate: 4, upTo: 0.004 },
|
||||
{ rate: 8, upTo: 'infinity' }, // 仍与文档有出入
|
||||
],
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
],
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
// functionCall: true,
|
||||
@@ -14,7 +50,6 @@ const stepfunChatModels: AIChatModelCard[] = [
|
||||
description:
|
||||
'该模型是拥有强大的图像理解能力的推理大模型,能够处理图像和文字信息,经过深度思考后输出文本生成文本内容。该模型在视觉推理领域表现突出,同时拥有第一梯队的数学、代码、文本推理能力。上下文长度为100k。',
|
||||
displayName: 'Step R1 V Mini',
|
||||
enabled: true,
|
||||
id: 'step-r1-v-mini',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
@@ -144,7 +179,6 @@ const stepfunChatModels: AIChatModelCard[] = [
|
||||
contextWindowTokens: 16_000,
|
||||
description: 'step-2模型的实验版本,包含最新的特性,滚动更新中。不推荐在正式生产环境使用。',
|
||||
displayName: 'Step 2 16K Exp',
|
||||
enabled: true,
|
||||
id: 'step-2-16k-exp',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
@@ -235,8 +269,8 @@ const stepfunChatModels: AIChatModelCard[] = [
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 35, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-02-14',
|
||||
|
||||
@@ -1,6 +1,35 @@
|
||||
import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
|
||||
|
||||
const zhipuChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'智谱新一代基于 MOE 架构的视觉推理模型,以106B的总参数量和12B激活参数量,在各类基准测试中达到全球同级别开源多模态模型 SOTA,涵盖图像、视频、文档理解及 GUI 任务等常见任务。',
|
||||
displayName: 'GLM-4.5V',
|
||||
enabled: true,
|
||||
id: 'glm-4.5v',
|
||||
maxOutput: 32_768,
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
// 输入长度 [0, 32]
|
||||
{ name: 'textInput_cacheRead', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['enableReasoning'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -132,7 +161,6 @@ const zhipuChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
reasoning: true,
|
||||
search: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 65_536,
|
||||
@@ -148,15 +176,11 @@ const zhipuChatModels: AIChatModelCard[] = [
|
||||
{ name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
reasoning: true,
|
||||
search: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 65_536,
|
||||
@@ -173,9 +197,6 @@ const zhipuChatModels: AIChatModelCard[] = [
|
||||
{ name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
const AiHubMix: ModelProviderCard = {
|
||||
apiKeyUrl: 'https://lobe.li/9mZhb4T',
|
||||
chatModels: [],
|
||||
checkModel: 'gpt-4.1-mini',
|
||||
checkModel: 'gpt-4.1-nano',
|
||||
description: 'AiHubMix 通过统一的 API 接口提供对多种 AI 模型的访问。',
|
||||
id: 'aihubmix',
|
||||
modelsUrl: 'https://docs.aihubmix.com/cn/api/Model-List',
|
||||
|
||||
@@ -106,6 +106,7 @@ const Mistral: ModelProviderCard = {
|
||||
modelsUrl: 'https://docs.mistral.ai/getting-started/models',
|
||||
name: 'Mistral',
|
||||
settings: {
|
||||
disableBrowserRequest: true, // CORS Error
|
||||
proxyUrl: {
|
||||
placeholder: 'https://api.mistral.ai',
|
||||
},
|
||||
|
||||
@@ -245,7 +245,7 @@ const OpenAI: ModelProviderCard = {
|
||||
id: 'gpt-3.5-turbo-instruct',
|
||||
},
|
||||
],
|
||||
checkModel: 'gpt-4.1-nano',
|
||||
checkModel: 'gpt-5-nano',
|
||||
description:
|
||||
'OpenAI 是全球领先的人工智能研究机构,其开发的模型如GPT系列推动了自然语言处理的前沿。OpenAI 致力于通过创新和高效的AI解决方案改变多个行业。他们的产品具有显著的性能和经济性,广泛用于研究、商业和创新应用。',
|
||||
enabled: true,
|
||||
|
||||
@@ -247,7 +247,7 @@ const Qwen: ModelProviderCard = {
|
||||
releasedAt: '2025-02-05',
|
||||
},
|
||||
],
|
||||
checkModel: 'qwen-turbo-latest',
|
||||
checkModel: 'qwen-flash-latest',
|
||||
description:
|
||||
'通义千问是阿里云自主研发的超大规模语言模型,具有强大的自然语言理解和生成能力。它可以回答各种问题、创作文字内容、表达观点看法、撰写代码等,在多个领域发挥作用。',
|
||||
disableBrowserRequest: true,
|
||||
|
||||
@@ -9,6 +9,7 @@ const V0: ModelProviderCard = {
|
||||
modelsUrl: 'https://vercel.com/docs/v0/api#models',
|
||||
name: 'Vercel (v0)',
|
||||
settings: {
|
||||
disableBrowserRequest: true, // CORS error
|
||||
sdkType: 'openai',
|
||||
},
|
||||
url: 'https://v0.dev',
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
// ref https://www.volcengine.com/docs/82379/1330310
|
||||
const Doubao: ModelProviderCard = {
|
||||
chatModels: [],
|
||||
checkModel: 'doubao-1-5-lite-32k-250115',
|
||||
description:
|
||||
'字节跳动推出的大模型服务的开发平台,提供功能丰富、安全以及具备价格竞争力的模型调用服务,同时提供模型数据、精调、推理、评测等端到端功能,全方位保障您的 AI 应用开发落地。',
|
||||
id: 'volcengine',
|
||||
|
||||
Reference in New Issue
Block a user