mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 11:40:07 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 39218c49e4 |
+1
-4
@@ -136,7 +136,7 @@
|
||||
"@formkit/auto-animate": "^0.8.2",
|
||||
"@google/genai": "^1.13.0",
|
||||
"@huggingface/inference": "^2.8.1",
|
||||
"@icons-pack/react-simple-icons": "9.6.0",
|
||||
"@icons-pack/react-simple-icons": "^13.7.0",
|
||||
"@khmyznikov/pwa-install": "0.3.9",
|
||||
"@langchain/community": "^0.3.50",
|
||||
"@lobechat/const": "workspace:*",
|
||||
@@ -272,10 +272,7 @@
|
||||
"use-merge-value": "^1.2.0",
|
||||
"uuid": "^11.1.0",
|
||||
"ws": "^8.18.3",
|
||||
"y-protocols": "^1.0.6",
|
||||
"y-webrtc": "^10.3.0",
|
||||
"yaml": "^2.8.1",
|
||||
"yjs": "^13.6.27",
|
||||
"zod": "^3.25.76",
|
||||
"zustand": "5.0.4",
|
||||
"zustand-utils": "^2.1.0"
|
||||
|
||||
@@ -5,11 +5,11 @@ import { BRANDING_NAME, ORG_NAME } from './branding';
|
||||
export const CURRENT_VERSION = pkg.version;
|
||||
|
||||
export const isServerMode = process.env.NEXT_PUBLIC_SERVICE_MODE === 'server';
|
||||
export const isUsePgliteDB = process.env.NEXT_PUBLIC_CLIENT_DB === 'pglite';
|
||||
export const isUsePgliteDB = !isServerMode;
|
||||
|
||||
export const isDesktop = process.env.NEXT_PUBLIC_IS_DESKTOP_APP === '1';
|
||||
|
||||
export const isDeprecatedEdition = !isServerMode && !isUsePgliteDB;
|
||||
export const isDeprecatedEdition = false;
|
||||
|
||||
// @ts-ignore
|
||||
export const isCustomBranding = BRANDING_NAME !== 'LobeChat';
|
||||
|
||||
@@ -6,7 +6,6 @@ import { uuid } from '@/utils/uuid';
|
||||
|
||||
import * as EXPORT_TABLES from '../../schemas';
|
||||
import { LobeChatDatabase } from '../../type';
|
||||
import { DeprecatedDataImporterRepos } from './deprecated';
|
||||
|
||||
interface ImportResult {
|
||||
added: number;
|
||||
@@ -258,19 +257,17 @@ const IMPORT_TABLE_CONFIG: TableImportConfig[] = [
|
||||
export class DataImporterRepos {
|
||||
private userId: string;
|
||||
private db: LobeChatDatabase;
|
||||
private deprecatedDataImporterRepos: DeprecatedDataImporterRepos;
|
||||
private idMaps: Record<string, Record<string, string>> = {};
|
||||
private conflictRecords: Record<string, { field: string; value: any }[]> = {};
|
||||
|
||||
constructor(db: LobeChatDatabase, userId: string) {
|
||||
this.userId = userId;
|
||||
this.db = db;
|
||||
this.deprecatedDataImporterRepos = new DeprecatedDataImporterRepos(db, userId);
|
||||
}
|
||||
|
||||
importData = async (data: ImporterEntryData): Promise<ImportResultData> => {
|
||||
const results = await this.deprecatedDataImporterRepos.importData(data);
|
||||
return { results, success: true };
|
||||
console.log(data);
|
||||
return { results: {}, success: true };
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -118,12 +118,14 @@ export interface UpdateMessageParams {
|
||||
imageList?: ChatImageItem[];
|
||||
metadata?: MessageMetadata;
|
||||
model?: string;
|
||||
observationId?: string;
|
||||
provider?: string;
|
||||
reasoning?: ModelReasoning;
|
||||
role?: string;
|
||||
search?: GroundingSearch;
|
||||
toolCalls?: MessageToolCall[];
|
||||
tools?: ChatToolPayload[] | null;
|
||||
traceId?: string;
|
||||
}
|
||||
|
||||
export interface NewMessageQueryParams {
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
import { LobeDBSchemaMap } from '@/database/_deprecated/core/db';
|
||||
|
||||
export type OnSyncEvent = (tableKey: keyof LobeDBSchemaMap) => void;
|
||||
export type OnSyncStatusChange = (status: PeerSyncStatus) => void;
|
||||
export type OnAwarenessChange = (state: SyncAwarenessState[]) => void;
|
||||
|
||||
// export type PeerSyncStatus = 'syncing' | 'synced' | 'ready' | 'unconnected';
|
||||
|
||||
export enum PeerSyncStatus {
|
||||
Connecting = 'connecting',
|
||||
Disabled = 'disabled',
|
||||
Ready = 'ready',
|
||||
Synced = 'synced',
|
||||
Syncing = 'syncing',
|
||||
Unconnected = 'unconnected',
|
||||
}
|
||||
|
||||
export interface StartDataSyncParams {
|
||||
channel: {
|
||||
name: string;
|
||||
password?: string;
|
||||
};
|
||||
onAwarenessChange: OnAwarenessChange;
|
||||
onSyncEvent: OnSyncEvent;
|
||||
onSyncStatusChange: OnSyncStatusChange;
|
||||
signaling: string;
|
||||
user: SyncUserInfo;
|
||||
}
|
||||
|
||||
export interface SyncUserInfo {
|
||||
browser?: string;
|
||||
id: string;
|
||||
isMobile: boolean;
|
||||
name?: string;
|
||||
os?: string;
|
||||
}
|
||||
|
||||
export interface SyncAwarenessState extends SyncUserInfo {
|
||||
clientID: number;
|
||||
current: boolean;
|
||||
}
|
||||
@@ -30,6 +30,7 @@ export interface CloudflareKeyVault {
|
||||
}
|
||||
|
||||
export interface SearchEngineKeyVaults {
|
||||
jina?: OpenAICompatibleKeyVault;
|
||||
searchxng?: {
|
||||
apiKey?: string;
|
||||
baseURL?: string;
|
||||
@@ -37,63 +38,5 @@ export interface SearchEngineKeyVaults {
|
||||
}
|
||||
|
||||
export interface UserKeyVaults extends SearchEngineKeyVaults {
|
||||
ai21?: OpenAICompatibleKeyVault;
|
||||
ai302?: OpenAICompatibleKeyVault;
|
||||
ai360?: OpenAICompatibleKeyVault;
|
||||
aihubmix?: OpenAICompatibleKeyVault;
|
||||
anthropic?: OpenAICompatibleKeyVault;
|
||||
azure?: AzureOpenAIKeyVault;
|
||||
azureai?: AzureOpenAIKeyVault;
|
||||
baichuan?: OpenAICompatibleKeyVault;
|
||||
bedrock?: AWSBedrockKeyVault;
|
||||
cloudflare?: CloudflareKeyVault;
|
||||
cohere?: OpenAICompatibleKeyVault;
|
||||
deepseek?: OpenAICompatibleKeyVault;
|
||||
fal?: FalKeyVault;
|
||||
fireworksai?: OpenAICompatibleKeyVault;
|
||||
giteeai?: OpenAICompatibleKeyVault;
|
||||
github?: OpenAICompatibleKeyVault;
|
||||
google?: OpenAICompatibleKeyVault;
|
||||
groq?: OpenAICompatibleKeyVault;
|
||||
higress?: OpenAICompatibleKeyVault;
|
||||
huggingface?: OpenAICompatibleKeyVault;
|
||||
hunyuan?: OpenAICompatibleKeyVault;
|
||||
infiniai?: OpenAICompatibleKeyVault;
|
||||
internlm?: OpenAICompatibleKeyVault;
|
||||
jina?: OpenAICompatibleKeyVault;
|
||||
lmstudio?: OpenAICompatibleKeyVault;
|
||||
lobehub?: any;
|
||||
minimax?: OpenAICompatibleKeyVault;
|
||||
mistral?: OpenAICompatibleKeyVault;
|
||||
modelscope?: OpenAICompatibleKeyVault;
|
||||
moonshot?: OpenAICompatibleKeyVault;
|
||||
novita?: OpenAICompatibleKeyVault;
|
||||
nvidia?: OpenAICompatibleKeyVault;
|
||||
ollama?: OpenAICompatibleKeyVault;
|
||||
openai?: OpenAICompatibleKeyVault;
|
||||
openrouter?: OpenAICompatibleKeyVault;
|
||||
password?: string;
|
||||
perplexity?: OpenAICompatibleKeyVault;
|
||||
ppio?: OpenAICompatibleKeyVault;
|
||||
qiniu?: OpenAICompatibleKeyVault;
|
||||
qwen?: OpenAICompatibleKeyVault;
|
||||
sambanova?: OpenAICompatibleKeyVault;
|
||||
search1api?: OpenAICompatibleKeyVault;
|
||||
sensenova?: OpenAICompatibleKeyVault;
|
||||
siliconcloud?: OpenAICompatibleKeyVault;
|
||||
spark?: OpenAICompatibleKeyVault;
|
||||
stepfun?: OpenAICompatibleKeyVault;
|
||||
taichu?: OpenAICompatibleKeyVault;
|
||||
tencentcloud?: OpenAICompatibleKeyVault;
|
||||
togetherai?: OpenAICompatibleKeyVault;
|
||||
upstage?: OpenAICompatibleKeyVault;
|
||||
v0?: OpenAICompatibleKeyVault;
|
||||
vertexai?: OpenAICompatibleKeyVault;
|
||||
vllm?: OpenAICompatibleKeyVault;
|
||||
volcengine?: OpenAICompatibleKeyVault;
|
||||
wenxin?: OpenAICompatibleKeyVault;
|
||||
xai?: OpenAICompatibleKeyVault;
|
||||
xinference?: OpenAICompatibleKeyVault;
|
||||
zeroone?: OpenAICompatibleKeyVault;
|
||||
zhipu?: OpenAICompatibleKeyVault;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { LOBE_DEFAULT_MODEL_LIST, OpenAIProviderCard } from '@/config/modelProviders';
|
||||
import { LOBE_DEFAULT_MODEL_LIST } from '@/config/aiModels';
|
||||
import { OpenAIProviderCard } from '@/config/modelProviders';
|
||||
import { ChatModelCard } from '@/types/llm';
|
||||
|
||||
import { parseModelString, transformToChatModelCards } from './parseModels';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { produce } from 'immer';
|
||||
|
||||
import { LOBE_DEFAULT_MODEL_LIST } from '@/config/modelProviders';
|
||||
import { LOBE_DEFAULT_MODEL_LIST } from '@/config/aiModels';
|
||||
import { ChatModelCard } from '@/types/llm';
|
||||
|
||||
/**
|
||||
|
||||
@@ -106,17 +106,8 @@ export const getToolManifest = async (
|
||||
|
||||
// 4. if exist OpenAPI api, merge the OpenAPIs to api
|
||||
if (parser.data.openapi) {
|
||||
const openapiJson = await fetchJSON(parser.data.openapi, useProxy);
|
||||
|
||||
try {
|
||||
const { OpenAPIConvertor } = await import('@lobehub/chat-plugin-sdk/openapi');
|
||||
|
||||
const convertor = new OpenAPIConvertor(openapiJson);
|
||||
const openAPIs = await convertor.convertOpenAPIToPluginSchema();
|
||||
|
||||
data.api = [...data.api, ...openAPIs];
|
||||
|
||||
data.settings = await convertor.convertAuthToSettingsSchema(data.settings);
|
||||
data.api = [...data.api];
|
||||
} catch (error) {
|
||||
throw new TypeError('openAPIInvalid', { cause: error });
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import { memo } from 'react';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { enableAuth, enableNextAuth } from '@/const/auth';
|
||||
import { isDeprecatedEdition } from '@/const/version';
|
||||
import DataStatistics from '@/features/User/DataStatistics';
|
||||
import UserInfo from '@/features/User/UserInfo';
|
||||
import UserLoginOrSignup from '@/features/User/UserLoginOrSignup/Community';
|
||||
@@ -25,11 +24,10 @@ const UserBanner = memo(() => {
|
||||
<Link href={'/profile'} style={{ color: 'inherit' }}>
|
||||
<UserInfo />
|
||||
</Link>
|
||||
{!isDeprecatedEdition && (
|
||||
<Link href={'/profile/stats'} style={{ color: 'inherit' }}>
|
||||
<DataStatistics paddingInline={12} />
|
||||
</Link>
|
||||
)}
|
||||
|
||||
<Link href={'/profile/stats'} style={{ color: 'inherit' }}>
|
||||
<DataStatistics paddingInline={12} />
|
||||
</Link>
|
||||
</>
|
||||
) : (
|
||||
<UserLoginOrSignup
|
||||
|
||||
@@ -5,7 +5,6 @@ import { useTranslation } from 'react-i18next';
|
||||
|
||||
import Cell, { CellProps } from '@/components/Cell';
|
||||
import DataImporter from '@/features/DataImporter';
|
||||
import { configService } from '@/services/export/_deprecated';
|
||||
|
||||
const Category = memo(() => {
|
||||
const { t } = useTranslation('common');
|
||||
@@ -13,17 +12,14 @@ const Category = memo(() => {
|
||||
{
|
||||
key: 'allAgent',
|
||||
label: t('exportType.allAgent'),
|
||||
onClick: configService.exportAgents,
|
||||
},
|
||||
{
|
||||
key: 'allAgentWithMessage',
|
||||
label: t('exportType.allAgentWithMessage'),
|
||||
onClick: configService.exportSessions,
|
||||
},
|
||||
{
|
||||
key: 'globalSetting',
|
||||
label: t('exportType.globalSetting'),
|
||||
onClick: configService.exportSettings,
|
||||
},
|
||||
{
|
||||
type: 'divider',
|
||||
@@ -31,7 +27,6 @@ const Category = memo(() => {
|
||||
{
|
||||
key: 'all',
|
||||
label: t('exportType.all'),
|
||||
onClick: configService.exportAll,
|
||||
},
|
||||
{
|
||||
type: 'divider',
|
||||
|
||||
@@ -7,7 +7,6 @@ import { useTranslation } from 'react-i18next';
|
||||
|
||||
import Cell, { CellProps } from '@/components/Cell';
|
||||
import { enableAuth } from '@/const/auth';
|
||||
import { isDeprecatedEdition } from '@/const/version';
|
||||
import { ProfileTabs } from '@/store/global/initialState';
|
||||
import { useUserStore } from '@/store/user';
|
||||
import { authSelectors } from '@/store/user/selectors';
|
||||
@@ -34,7 +33,7 @@ const Category = memo(() => {
|
||||
label: t('tab.security'),
|
||||
onClick: () => router.push('/profile/security'),
|
||||
},
|
||||
!isDeprecatedEdition && {
|
||||
{
|
||||
icon: ChartColumnBigIcon,
|
||||
key: ProfileTabs.Stats,
|
||||
label: t('tab.stats'),
|
||||
|
||||
@@ -9,7 +9,6 @@ import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { ProductLogo } from '@/components/Branding';
|
||||
import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
|
||||
import SyncStatusTag from '@/features/SyncStatusInspector';
|
||||
import { useActionSWR } from '@/libs/swr';
|
||||
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
||||
import { useSessionStore } from '@/store/session';
|
||||
@@ -33,7 +32,7 @@ const Header = memo(() => {
|
||||
const { styles } = useStyles();
|
||||
const { t } = useTranslation('chat');
|
||||
const [createSession] = useSessionStore((s) => [s.createSession]);
|
||||
const { enableWebrtc, showCreateSession } = useServerConfigStore(featureFlagsSelectors);
|
||||
const { showCreateSession } = useServerConfigStore(featureFlagsSelectors);
|
||||
|
||||
const { mutate, isValidating } = useActionSWR('session.createSession', () => createSession());
|
||||
|
||||
@@ -50,7 +49,6 @@ const Header = memo(() => {
|
||||
}}
|
||||
>
|
||||
<ProductLogo className={styles.logo} size={36} type={'text'} />
|
||||
{enableWebrtc && <SyncStatusTag />}
|
||||
</Flexbox>
|
||||
<Flexbox align={'center'} gap={4} horizontal>
|
||||
<TogglePanelButton />
|
||||
|
||||
@@ -9,7 +9,6 @@ import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { ProductLogo } from '@/components/Branding';
|
||||
import { MOBILE_HEADER_ICON_SIZE } from '@/const/layoutTokens';
|
||||
import SyncStatusInspector from '@/features/SyncStatusInspector';
|
||||
import UserAvatar from '@/features/User/UserAvatar';
|
||||
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
||||
import { useSessionStore } from '@/store/session';
|
||||
@@ -18,7 +17,7 @@ import { mobileHeaderSticky } from '@/styles/mobileHeader';
|
||||
const Header = memo(() => {
|
||||
const [createSession] = useSessionStore((s) => [s.createSession]);
|
||||
const router = useRouter();
|
||||
const { enableWebrtc, showCreateSession } = useServerConfigStore(featureFlagsSelectors);
|
||||
const { showCreateSession } = useServerConfigStore(featureFlagsSelectors);
|
||||
|
||||
return (
|
||||
<ChatHeader
|
||||
@@ -26,7 +25,6 @@ const Header = memo(() => {
|
||||
<Flexbox align={'center'} gap={8} horizontal style={{ marginLeft: 8 }}>
|
||||
<UserAvatar onClick={() => router.push('/me')} size={32} />
|
||||
<ProductLogo type={'text'} />
|
||||
{enableWebrtc && <SyncStatusInspector placement={'bottom'} />}
|
||||
</Flexbox>
|
||||
}
|
||||
right={
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Button } from '@lobehub/ui';
|
||||
import { ReactNode, memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { ClientService } from '@/services/import/_deprecated';
|
||||
import { useChatStore } from '@/store/chat';
|
||||
import { useSessionStore } from '@/store/session';
|
||||
|
||||
@@ -18,7 +17,7 @@ export interface UpgradeButtonProps {
|
||||
}
|
||||
|
||||
const UpgradeButton = memo<UpgradeButtonProps>(
|
||||
({ setUpgradeStatus, upgradeStatus, state, setError, primary = true, children }) => {
|
||||
({ setUpgradeStatus, upgradeStatus, setError, primary = true, children }) => {
|
||||
const { t } = useTranslation('migration');
|
||||
|
||||
const refreshSession = useSessionStore((s) => s.refreshSessions);
|
||||
@@ -31,13 +30,6 @@ const UpgradeButton = memo<UpgradeButtonProps>(
|
||||
try {
|
||||
setUpgradeStatus(UpgradeStatus.UPGRADING);
|
||||
|
||||
const configService = new ClientService();
|
||||
await configService.importConfigState({
|
||||
exportType: 'sessions',
|
||||
state: state,
|
||||
version: 7,
|
||||
});
|
||||
|
||||
await refreshSession();
|
||||
await refreshMessages();
|
||||
await refreshTopic();
|
||||
|
||||
+1
-3
@@ -9,8 +9,6 @@ import { useRouter } from 'nextjs-toploader/app';
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { isDeprecatedEdition } from '@/const/version';
|
||||
|
||||
import { useDetailContext } from '../../DetailProvider';
|
||||
|
||||
const useStyles = createStyles(({ css }) => ({
|
||||
@@ -27,7 +25,7 @@ const ProviderConfig = memo(() => {
|
||||
const { url, modelsUrl, identifier } = useDetailContext();
|
||||
const router = useRouter();
|
||||
const openSettings = () => {
|
||||
router.push(isDeprecatedEdition ? '/settings/llm' : `/settings/provider/${identifier}`);
|
||||
router.push(`/settings/provider/${identifier}`);
|
||||
};
|
||||
|
||||
const icon = <Icon icon={SquareArrowOutUpRight} size={16} />;
|
||||
|
||||
+3
-8
@@ -8,7 +8,6 @@ import { useTranslation } from 'react-i18next';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { ModelItemRender, ProviderItemRender } from '@/components/ModelSelect';
|
||||
import { isDeprecatedEdition } from '@/const/version';
|
||||
import { useAiInfraStore } from '@/store/aiInfra';
|
||||
import { aiProviderSelectors } from '@/store/aiInfra/slices/aiProvider/selectors';
|
||||
import { useImageStore } from '@/store/image';
|
||||
@@ -65,9 +64,7 @@ const ModelSelect = memo(() => {
|
||||
</Flexbox>
|
||||
),
|
||||
onClick: () => {
|
||||
router.push(
|
||||
isDeprecatedEdition ? '/settings/llm' : `/settings/provider/${provider.id}`,
|
||||
);
|
||||
router.push(`/settings/provider/${provider.id}`);
|
||||
},
|
||||
value: `${provider.id}/empty`,
|
||||
},
|
||||
@@ -89,7 +86,7 @@ const ModelSelect = memo(() => {
|
||||
</Flexbox>
|
||||
),
|
||||
onClick: () => {
|
||||
router.push(isDeprecatedEdition ? '/settings/llm' : '/settings/provider');
|
||||
router.push('/settings/provider');
|
||||
},
|
||||
value: 'no-provider',
|
||||
},
|
||||
@@ -111,9 +108,7 @@ const ModelSelect = memo(() => {
|
||||
source={provider.source}
|
||||
/>
|
||||
{showLLM && (
|
||||
<Link
|
||||
href={isDeprecatedEdition ? '/settings/llm' : `/settings/provider/${provider.id}`}
|
||||
>
|
||||
<Link href={`/settings/provider/${provider.id}`}>
|
||||
<ActionIcon
|
||||
icon={LucideBolt}
|
||||
size={'small'}
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { ModelProvider } from '@lobechat/model-runtime';
|
||||
import { AutoComplete, Input, InputPassword, Markdown } from '@lobehub/ui';
|
||||
import { createStyles } from 'antd-style';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { AzureProviderCard } from '@/config/modelProviders';
|
||||
import { useUserStore } from '@/store/user';
|
||||
import { modelProviderSelectors } from '@/store/user/selectors';
|
||||
|
||||
import { KeyVaultsConfigKey, LLMProviderApiTokenKey } from '../../const';
|
||||
import { ProviderItem } from '../../type';
|
||||
|
||||
const useStyles = createStyles(({ css, token }) => ({
|
||||
markdown: css`
|
||||
p {
|
||||
color: ${token.colorTextDescription} !important;
|
||||
}
|
||||
`,
|
||||
tip: css`
|
||||
font-size: 12px;
|
||||
color: ${token.colorTextDescription};
|
||||
`,
|
||||
}));
|
||||
|
||||
const providerKey = ModelProvider.Azure;
|
||||
|
||||
export const useAzureProvider = (): ProviderItem => {
|
||||
const { t } = useTranslation('modelProvider');
|
||||
const { styles } = useStyles();
|
||||
|
||||
// Get the first model card's deployment name as the check model
|
||||
const checkModel = useUserStore((s) => {
|
||||
const chatModelCards = modelProviderSelectors.getModelCardsById(providerKey)(s);
|
||||
|
||||
if (chatModelCards.length > 0) {
|
||||
return chatModelCards[0].deploymentName;
|
||||
}
|
||||
|
||||
return 'gpt-35-turbo';
|
||||
});
|
||||
return {
|
||||
...AzureProviderCard,
|
||||
apiKeyItems: [
|
||||
{
|
||||
children: (
|
||||
<InputPassword autoComplete={'new-password'} placeholder={t('azure.token.placeholder')} />
|
||||
),
|
||||
desc: t('azure.token.desc'),
|
||||
label: t('azure.token.title'),
|
||||
name: [KeyVaultsConfigKey, providerKey, LLMProviderApiTokenKey],
|
||||
},
|
||||
{
|
||||
children: <Input allowClear placeholder={t('azure.endpoint.placeholder')} />,
|
||||
desc: t('azure.endpoint.desc'),
|
||||
label: t('azure.endpoint.title'),
|
||||
name: [KeyVaultsConfigKey, providerKey, 'endpoint'],
|
||||
},
|
||||
{
|
||||
children: (
|
||||
<AutoComplete
|
||||
options={[
|
||||
'2024-06-01',
|
||||
'2024-02-01',
|
||||
'2024-05-01-preview',
|
||||
'2024-04-01-preview',
|
||||
'2024-03-01-preview',
|
||||
'2024-02-15-preview',
|
||||
'2023-10-01-preview',
|
||||
'2023-06-01-preview',
|
||||
'2023-05-15',
|
||||
].map((i) => ({ label: i, value: i }))}
|
||||
placeholder={'20XX-XX-XX'}
|
||||
/>
|
||||
),
|
||||
desc: (
|
||||
<Markdown className={styles.markdown} fontSize={12} variant={'chat'}>
|
||||
{t('azure.azureApiVersion.desc')}
|
||||
</Markdown>
|
||||
),
|
||||
label: t('azure.azureApiVersion.title'),
|
||||
name: [KeyVaultsConfigKey, providerKey, 'apiVersion'],
|
||||
},
|
||||
],
|
||||
checkModel,
|
||||
modelList: {
|
||||
azureDeployName: true,
|
||||
notFoundContent: t('azure.empty'),
|
||||
placeholder: t('azure.modelListPlaceholder'),
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -1,70 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { InputPassword, Select } from '@lobehub/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { BedrockProviderCard } from '@/config/modelProviders';
|
||||
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
||||
|
||||
import { KeyVaultsConfigKey } from '../../const';
|
||||
import { ProviderItem } from '../../type';
|
||||
|
||||
const providerKey: GlobalLLMProviderKey = 'bedrock';
|
||||
|
||||
export const useBedrockProvider = (): ProviderItem => {
|
||||
const { t } = useTranslation('modelProvider');
|
||||
|
||||
return {
|
||||
...BedrockProviderCard,
|
||||
apiKeyItems: [
|
||||
{
|
||||
children: (
|
||||
<InputPassword
|
||||
autoComplete={'new-password'}
|
||||
placeholder={t(`${providerKey}.accessKeyId.placeholder`)}
|
||||
/>
|
||||
),
|
||||
desc: t(`${providerKey}.accessKeyId.desc`),
|
||||
label: t(`${providerKey}.accessKeyId.title`),
|
||||
name: [KeyVaultsConfigKey, providerKey, 'accessKeyId'],
|
||||
},
|
||||
{
|
||||
children: (
|
||||
<InputPassword
|
||||
autoComplete={'new-password'}
|
||||
placeholder={t(`${providerKey}.secretAccessKey.placeholder`)}
|
||||
/>
|
||||
),
|
||||
desc: t(`${providerKey}.secretAccessKey.desc`),
|
||||
label: t(`${providerKey}.secretAccessKey.title`),
|
||||
name: [KeyVaultsConfigKey, providerKey, 'secretAccessKey'],
|
||||
},
|
||||
{
|
||||
children: (
|
||||
<InputPassword
|
||||
autoComplete={'new-password'}
|
||||
placeholder={t(`${providerKey}.sessionToken.placeholder`)}
|
||||
/>
|
||||
),
|
||||
desc: t(`${providerKey}.sessionToken.desc`),
|
||||
label: t(`${providerKey}.sessionToken.title`),
|
||||
name: [KeyVaultsConfigKey, providerKey, 'sessionToken'],
|
||||
},
|
||||
{
|
||||
children: (
|
||||
<Select
|
||||
allowClear
|
||||
options={['us-east-1', 'us-west-2', 'ap-southeast-1', 'eu-central-1'].map((i) => ({
|
||||
label: i,
|
||||
value: i,
|
||||
}))}
|
||||
placeholder={'us-east-1'}
|
||||
/>
|
||||
),
|
||||
desc: t(`${providerKey}.region.desc`),
|
||||
label: t(`${providerKey}.region.title`),
|
||||
name: [KeyVaultsConfigKey, providerKey, 'region'],
|
||||
},
|
||||
],
|
||||
};
|
||||
};
|
||||
@@ -1,39 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { Input, InputPassword } from '@lobehub/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { CloudflareProviderCard } from '@/config/modelProviders';
|
||||
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
||||
|
||||
import { KeyVaultsConfigKey } from '../../const';
|
||||
import { ProviderItem } from '../../type';
|
||||
|
||||
const providerKey: GlobalLLMProviderKey = 'cloudflare';
|
||||
|
||||
export const useCloudflareProvider = (): ProviderItem => {
|
||||
const { t } = useTranslation('modelProvider');
|
||||
|
||||
return {
|
||||
...CloudflareProviderCard,
|
||||
apiKeyItems: [
|
||||
{
|
||||
children: (
|
||||
<InputPassword
|
||||
autoComplete={'new-password'}
|
||||
placeholder={t(`${providerKey}.apiKey.placeholder`)}
|
||||
/>
|
||||
),
|
||||
desc: t(`${providerKey}.apiKey.desc`),
|
||||
label: t(`${providerKey}.apiKey.title`),
|
||||
name: [KeyVaultsConfigKey, providerKey, 'apiKey'],
|
||||
},
|
||||
{
|
||||
children: <Input placeholder={t(`${providerKey}.baseURLOrAccountID.placeholder`)} />,
|
||||
desc: t(`${providerKey}.baseURLOrAccountID.desc`),
|
||||
label: t(`${providerKey}.baseURLOrAccountID.title`),
|
||||
name: [KeyVaultsConfigKey, providerKey, 'baseURLOrAccountID'],
|
||||
},
|
||||
],
|
||||
};
|
||||
};
|
||||
@@ -1,52 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { InputPassword, Markdown } from '@lobehub/ui';
|
||||
import { createStyles } from 'antd-style';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { GithubProviderCard } from '@/config/modelProviders';
|
||||
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
||||
|
||||
import { KeyVaultsConfigKey, LLMProviderApiTokenKey } from '../../const';
|
||||
import { ProviderItem } from '../../type';
|
||||
|
||||
const useStyles = createStyles(({ css, token }) => ({
|
||||
markdown: css`
|
||||
p {
|
||||
color: ${token.colorTextDescription} !important;
|
||||
}
|
||||
`,
|
||||
tip: css`
|
||||
font-size: 12px;
|
||||
color: ${token.colorTextDescription};
|
||||
`,
|
||||
}));
|
||||
|
||||
const providerKey: GlobalLLMProviderKey = 'github';
|
||||
|
||||
// Same as OpenAIProvider, but replace API Key with Github Personal Access Token
|
||||
export const useGithubProvider = (): ProviderItem => {
|
||||
const { t } = useTranslation('modelProvider');
|
||||
const { styles } = useStyles();
|
||||
|
||||
return {
|
||||
...GithubProviderCard,
|
||||
apiKeyItems: [
|
||||
{
|
||||
children: (
|
||||
<InputPassword
|
||||
autoComplete={'new-password'}
|
||||
placeholder={t(`${providerKey}.personalAccessToken.placeholder`)}
|
||||
/>
|
||||
),
|
||||
desc: (
|
||||
<Markdown className={styles.markdown} fontSize={12} variant={'chat'}>
|
||||
{t(`${providerKey}.personalAccessToken.desc`)}
|
||||
</Markdown>
|
||||
),
|
||||
label: t(`${providerKey}.personalAccessToken.title`),
|
||||
name: [KeyVaultsConfigKey, providerKey, LLMProviderApiTokenKey],
|
||||
},
|
||||
],
|
||||
};
|
||||
};
|
||||
@@ -1,52 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { InputPassword, Markdown } from '@lobehub/ui';
|
||||
import { createStyles } from 'antd-style';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { HuggingFaceProviderCard } from '@/config/modelProviders';
|
||||
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
||||
|
||||
import { KeyVaultsConfigKey, LLMProviderApiTokenKey } from '../../const';
|
||||
import { ProviderItem } from '../../type';
|
||||
|
||||
const useStyles = createStyles(({ css, token }) => ({
|
||||
markdown: css`
|
||||
p {
|
||||
color: ${token.colorTextDescription} !important;
|
||||
}
|
||||
`,
|
||||
tip: css`
|
||||
font-size: 12px;
|
||||
color: ${token.colorTextDescription};
|
||||
`,
|
||||
}));
|
||||
|
||||
const providerKey: GlobalLLMProviderKey = 'huggingface';
|
||||
|
||||
// Same as OpenAIProvider, but replace API Key with HuggingFace Access Token
|
||||
export const useHuggingFaceProvider = (): ProviderItem => {
|
||||
const { t } = useTranslation('modelProvider');
|
||||
const { styles } = useStyles();
|
||||
|
||||
return {
|
||||
...HuggingFaceProviderCard,
|
||||
apiKeyItems: [
|
||||
{
|
||||
children: (
|
||||
<InputPassword
|
||||
autoComplete={'new-password'}
|
||||
placeholder={t(`${providerKey}.accessToken.placeholder`)}
|
||||
/>
|
||||
),
|
||||
desc: (
|
||||
<Markdown className={styles.markdown} fontSize={12} variant={'chat'}>
|
||||
{t(`${providerKey}.accessToken.desc`)}
|
||||
</Markdown>
|
||||
),
|
||||
label: t(`${providerKey}.accessToken.title`),
|
||||
name: [KeyVaultsConfigKey, providerKey, LLMProviderApiTokenKey],
|
||||
},
|
||||
],
|
||||
};
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { OllamaProviderCard } from '@/config/modelProviders';
|
||||
|
||||
import { ProviderItem } from '../../type';
|
||||
|
||||
export const useOllamaProvider = (): ProviderItem => {
|
||||
const { t } = useTranslation('modelProvider');
|
||||
|
||||
return {
|
||||
...OllamaProviderCard,
|
||||
proxyUrl: {
|
||||
desc: t('ollama.endpoint.desc'),
|
||||
placeholder: 'http://127.0.0.1:11434',
|
||||
title: t('ollama.endpoint.title'),
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -1,17 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { OpenAIProviderCard } from '@/config/modelProviders';
|
||||
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
||||
|
||||
import { ProviderItem } from '../../type';
|
||||
|
||||
export const useOpenAIProvider = (): ProviderItem => {
|
||||
const { showOpenAIProxyUrl, showOpenAIApiKey } = useServerConfigStore(featureFlagsSelectors);
|
||||
return {
|
||||
...OpenAIProviderCard,
|
||||
proxyUrl: showOpenAIProxyUrl && {
|
||||
placeholder: 'https://api.openai.com/v1',
|
||||
},
|
||||
showApiKey: showOpenAIApiKey,
|
||||
};
|
||||
};
|
||||
@@ -1,128 +0,0 @@
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import {
|
||||
Ai21ProviderCard,
|
||||
Ai302ProviderCard,
|
||||
Ai360ProviderCard,
|
||||
AnthropicProviderCard,
|
||||
BaichuanProviderCard,
|
||||
CohereProviderCard,
|
||||
DeepSeekProviderCard,
|
||||
FireworksAIProviderCard,
|
||||
GiteeAIProviderCard,
|
||||
GoogleProviderCard,
|
||||
GroqProviderCard,
|
||||
HigressProviderCard,
|
||||
HunyuanProviderCard,
|
||||
InfiniAIProviderCard,
|
||||
InternLMProviderCard,
|
||||
JinaProviderCard,
|
||||
MinimaxProviderCard,
|
||||
MistralProviderCard,
|
||||
MoonshotProviderCard,
|
||||
NovitaProviderCard,
|
||||
NvidiaProviderCard,
|
||||
OpenRouterProviderCard,
|
||||
PPIOProviderCard,
|
||||
PerplexityProviderCard,
|
||||
QiniuProviderCard,
|
||||
QwenProviderCard,
|
||||
SambaNovaProviderCard,
|
||||
Search1APIProviderCard,
|
||||
SenseNovaProviderCard,
|
||||
SiliconCloudProviderCard,
|
||||
SparkProviderCard,
|
||||
StepfunProviderCard,
|
||||
TaichuProviderCard,
|
||||
TogetherAIProviderCard,
|
||||
UpstageProviderCard,
|
||||
V0ProviderCard,
|
||||
VLLMProviderCard,
|
||||
WenxinProviderCard,
|
||||
XAIProviderCard,
|
||||
XinferenceProviderCard,
|
||||
ZeroOneProviderCard,
|
||||
ZhiPuProviderCard,
|
||||
} from '@/config/modelProviders';
|
||||
|
||||
import { ProviderItem } from '../type';
|
||||
import { useAzureProvider } from './Azure';
|
||||
import { useBedrockProvider } from './Bedrock';
|
||||
import { useCloudflareProvider } from './Cloudflare';
|
||||
import { useGithubProvider } from './Github';
|
||||
import { useHuggingFaceProvider } from './HuggingFace';
|
||||
import { useOllamaProvider } from './Ollama';
|
||||
import { useOpenAIProvider } from './OpenAI';
|
||||
|
||||
export const useProviderList = (): ProviderItem[] => {
|
||||
const AzureProvider = useAzureProvider();
|
||||
const OllamaProvider = useOllamaProvider();
|
||||
const OpenAIProvider = useOpenAIProvider();
|
||||
const BedrockProvider = useBedrockProvider();
|
||||
const CloudflareProvider = useCloudflareProvider();
|
||||
const GithubProvider = useGithubProvider();
|
||||
const HuggingFaceProvider = useHuggingFaceProvider();
|
||||
|
||||
return useMemo(
|
||||
() => [
|
||||
OpenAIProvider,
|
||||
AzureProvider,
|
||||
OllamaProvider,
|
||||
VLLMProviderCard,
|
||||
XinferenceProviderCard,
|
||||
AnthropicProviderCard,
|
||||
BedrockProvider,
|
||||
GoogleProviderCard,
|
||||
DeepSeekProviderCard,
|
||||
HuggingFaceProvider,
|
||||
OpenRouterProviderCard,
|
||||
CloudflareProvider,
|
||||
GithubProvider,
|
||||
NovitaProviderCard,
|
||||
TogetherAIProviderCard,
|
||||
FireworksAIProviderCard,
|
||||
GroqProviderCard,
|
||||
NvidiaProviderCard,
|
||||
PerplexityProviderCard,
|
||||
MistralProviderCard,
|
||||
Ai21ProviderCard,
|
||||
UpstageProviderCard,
|
||||
XAIProviderCard,
|
||||
JinaProviderCard,
|
||||
SambaNovaProviderCard,
|
||||
Search1APIProviderCard,
|
||||
CohereProviderCard,
|
||||
V0ProviderCard,
|
||||
QiniuProviderCard,
|
||||
QwenProviderCard,
|
||||
WenxinProviderCard,
|
||||
HunyuanProviderCard,
|
||||
SparkProviderCard,
|
||||
ZhiPuProviderCard,
|
||||
ZeroOneProviderCard,
|
||||
SenseNovaProviderCard,
|
||||
StepfunProviderCard,
|
||||
MoonshotProviderCard,
|
||||
BaichuanProviderCard,
|
||||
MinimaxProviderCard,
|
||||
Ai360ProviderCard,
|
||||
TaichuProviderCard,
|
||||
InternLMProviderCard,
|
||||
SiliconCloudProviderCard,
|
||||
HigressProviderCard,
|
||||
GiteeAIProviderCard,
|
||||
PPIOProviderCard,
|
||||
InfiniAIProviderCard,
|
||||
Ai302ProviderCard,
|
||||
],
|
||||
[
|
||||
AzureProvider,
|
||||
OllamaProvider,
|
||||
OpenAIProvider,
|
||||
BedrockProvider,
|
||||
CloudflareProvider,
|
||||
GithubProvider,
|
||||
HuggingFaceProvider,
|
||||
],
|
||||
);
|
||||
};
|
||||
@@ -1,119 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { CheckCircleFilled } from '@ant-design/icons';
|
||||
import { TraceNameMap } from '@lobechat/types';
|
||||
import { Alert, Button, Highlighter } from '@lobehub/ui';
|
||||
import { useTheme } from 'antd-style';
|
||||
import { memo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { useIsMobile } from '@/hooks/useIsMobile';
|
||||
import { useProviderName } from '@/hooks/useProviderName';
|
||||
import { chatService } from '@/services/chat';
|
||||
import { ChatMessageError } from '@/types/message';
|
||||
|
||||
interface ConnectionCheckerProps {
|
||||
model: string;
|
||||
provider: string;
|
||||
}
|
||||
|
||||
const Error = memo<{ error: ChatMessageError }>(({ error }) => {
|
||||
const { t } = useTranslation('error');
|
||||
const providerName = useProviderName(error.body?.provider);
|
||||
|
||||
return (
|
||||
<Flexbox gap={8} style={{ maxWidth: '600px', width: '100%' }}>
|
||||
<Alert
|
||||
banner
|
||||
extra={
|
||||
<Flexbox>
|
||||
<Highlighter actionIconSize={'small'} language={'json'} variant={'borderless'}>
|
||||
{JSON.stringify(error.body || error, null, 2)}
|
||||
</Highlighter>
|
||||
</Flexbox>
|
||||
}
|
||||
message={t(`response.${error.type}` as any, { provider: providerName })}
|
||||
showIcon
|
||||
type={'error'}
|
||||
/>
|
||||
</Flexbox>
|
||||
);
|
||||
});
|
||||
|
||||
const Checker = memo<ConnectionCheckerProps>(({ model, provider }) => {
|
||||
const { t } = useTranslation('setting');
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [pass, setPass] = useState(false);
|
||||
|
||||
const theme = useTheme();
|
||||
const [error, setError] = useState<ChatMessageError | undefined>();
|
||||
|
||||
const checkConnection = async () => {
|
||||
let isError = false;
|
||||
|
||||
await chatService.fetchPresetTaskResult({
|
||||
onError: (_, rawError) => {
|
||||
setError(rawError);
|
||||
setPass(false);
|
||||
isError = true;
|
||||
},
|
||||
onFinish: async (value) => {
|
||||
if (!isError && value) {
|
||||
setError(undefined);
|
||||
setPass(true);
|
||||
} else {
|
||||
setPass(false);
|
||||
setError({
|
||||
body: value,
|
||||
message: t('response.ConnectionCheckFailed', { ns: 'error' }),
|
||||
type: 'ConnectionCheckFailed',
|
||||
});
|
||||
}
|
||||
},
|
||||
onLoadingChange: (loading) => {
|
||||
setLoading(loading);
|
||||
},
|
||||
params: {
|
||||
messages: [
|
||||
{
|
||||
content: '你好',
|
||||
role: 'user',
|
||||
},
|
||||
],
|
||||
model,
|
||||
provider,
|
||||
},
|
||||
trace: {
|
||||
sessionId: `connection:${provider}`,
|
||||
topicId: model,
|
||||
traceName: TraceNameMap.ConnectivityChecker,
|
||||
},
|
||||
});
|
||||
};
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
return (
|
||||
<Flexbox align={isMobile ? 'flex-start' : 'flex-end'} gap={8}>
|
||||
<Flexbox align={'center'} direction={isMobile ? 'horizontal-reverse' : 'horizontal'} gap={12}>
|
||||
{pass && (
|
||||
<Flexbox gap={4} horizontal>
|
||||
<CheckCircleFilled
|
||||
style={{
|
||||
color: theme.colorSuccess,
|
||||
}}
|
||||
/>
|
||||
{t('llm.checker.pass')}
|
||||
</Flexbox>
|
||||
)}
|
||||
<Button loading={loading} onClick={checkConnection}>
|
||||
{t('llm.checker.button')}
|
||||
</Button>
|
||||
</Flexbox>
|
||||
{error && <Error error={error} />}
|
||||
</Flexbox>
|
||||
);
|
||||
});
|
||||
|
||||
export default Checker;
|
||||
@@ -1,303 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { ProviderCombine } from '@lobehub/icons';
|
||||
import {
|
||||
Form,
|
||||
type FormGroupItemType,
|
||||
type FormItemProps,
|
||||
Icon,
|
||||
Input,
|
||||
InputPassword,
|
||||
Tooltip,
|
||||
} from '@lobehub/ui';
|
||||
import { Switch } from 'antd';
|
||||
import { createStyles } from 'antd-style';
|
||||
import { debounce } from 'lodash-es';
|
||||
import { LockIcon } from 'lucide-react';
|
||||
import Link from 'next/link';
|
||||
import { ReactNode, memo } from 'react';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
import { Center, Flexbox } from 'react-layout-kit';
|
||||
import urlJoin from 'url-join';
|
||||
|
||||
import { useSyncSettings } from '@/app/[variants]/(main)/settings/hooks/useSyncSettings';
|
||||
import {
|
||||
KeyVaultsConfigKey,
|
||||
LLMProviderApiTokenKey,
|
||||
LLMProviderBaseUrlKey,
|
||||
LLMProviderConfigKey,
|
||||
LLMProviderModelListKey,
|
||||
} from '@/app/[variants]/(main)/settings/llm/const';
|
||||
import { FORM_STYLE } from '@/const/layoutTokens';
|
||||
import { AES_GCM_URL, BASE_PROVIDER_DOC_URL } from '@/const/url';
|
||||
import { isServerMode } from '@/const/version';
|
||||
import { useUserStore } from '@/store/user';
|
||||
import { keyVaultsConfigSelectors, modelConfigSelectors } from '@/store/user/selectors';
|
||||
import { ModelProviderCard } from '@/types/llm';
|
||||
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
||||
|
||||
import Checker from '../Checker';
|
||||
import ProviderModelListSelect from '../ProviderModelList';
|
||||
|
||||
const useStyles = createStyles(({ css, prefixCls, responsive, token }) => ({
|
||||
aceGcm: css`
|
||||
padding-block: 0 !important;
|
||||
.${prefixCls}-form-item-label {
|
||||
display: none;
|
||||
}
|
||||
.${prefixCls}-form-item-control {
|
||||
width: 100%;
|
||||
|
||||
font-size: 12px;
|
||||
color: ${token.colorTextSecondary};
|
||||
text-align: center;
|
||||
|
||||
opacity: 0.66;
|
||||
|
||||
transition: opacity 0.2s ${token.motionEaseInOut};
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
`,
|
||||
form: css`
|
||||
.${prefixCls}-form-item-control:has(.${prefixCls}-input,.${prefixCls}-select) {
|
||||
flex: none;
|
||||
width: min(70%, 800px);
|
||||
min-width: min(70%, 800px) !important;
|
||||
}
|
||||
${responsive.mobile} {
|
||||
width: 100%;
|
||||
min-width: unset !important;
|
||||
}
|
||||
.${prefixCls}-select-selection-overflow-item {
|
||||
font-size: 12px;
|
||||
}
|
||||
`,
|
||||
help: css`
|
||||
border-radius: 50%;
|
||||
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: ${token.colorTextDescription};
|
||||
|
||||
background: ${token.colorFillTertiary};
|
||||
|
||||
&:hover {
|
||||
color: ${token.colorText};
|
||||
background: ${token.colorFill};
|
||||
}
|
||||
`,
|
||||
}));
|
||||
|
||||
export interface ProviderConfigProps extends Omit<ModelProviderCard, 'id' | 'chatModels'> {
|
||||
apiKeyItems?: FormItemProps[];
|
||||
canDeactivate?: boolean;
|
||||
checkerItem?: FormItemProps;
|
||||
className?: string;
|
||||
extra?: ReactNode;
|
||||
hideSwitch?: boolean;
|
||||
id: GlobalLLMProviderKey;
|
||||
modelList?: {
|
||||
azureDeployName?: boolean;
|
||||
notFoundContent?: ReactNode;
|
||||
placeholder?: string;
|
||||
showModelFetcher?: boolean;
|
||||
};
|
||||
showAceGcm?: boolean;
|
||||
title?: ReactNode;
|
||||
}
|
||||
|
||||
const ProviderConfig = memo<ProviderConfigProps>(
|
||||
({
|
||||
apiKeyItems,
|
||||
id,
|
||||
proxyUrl,
|
||||
showApiKey = true,
|
||||
checkModel,
|
||||
canDeactivate = true,
|
||||
checkerItem,
|
||||
modelList,
|
||||
title,
|
||||
defaultShowBrowserRequest,
|
||||
disableBrowserRequest,
|
||||
className,
|
||||
name,
|
||||
showAceGcm = true,
|
||||
showChecker = true,
|
||||
extra,
|
||||
}) => {
|
||||
const { t } = useTranslation('setting');
|
||||
const [form] = Form.useForm();
|
||||
const { cx, styles } = useStyles();
|
||||
const [
|
||||
toggleProviderEnabled,
|
||||
setSettings,
|
||||
enabled,
|
||||
isFetchOnClient,
|
||||
isProviderEndpointNotEmpty,
|
||||
isProviderApiKeyNotEmpty,
|
||||
] = useUserStore((s) => [
|
||||
s.toggleProviderEnabled,
|
||||
s.setSettings,
|
||||
modelConfigSelectors.isProviderEnabled(id)(s),
|
||||
modelConfigSelectors.isProviderFetchOnClient(id)(s),
|
||||
keyVaultsConfigSelectors.isProviderEndpointNotEmpty(id)(s),
|
||||
keyVaultsConfigSelectors.isProviderApiKeyNotEmpty(id)(s),
|
||||
]);
|
||||
|
||||
useSyncSettings(form);
|
||||
|
||||
const apiKeyItem: FormItemProps[] = !showApiKey
|
||||
? []
|
||||
: (apiKeyItems ?? [
|
||||
{
|
||||
children: (
|
||||
<InputPassword
|
||||
autoComplete={'new-password'}
|
||||
placeholder={t(`llm.apiKey.placeholder`, { name })}
|
||||
/>
|
||||
),
|
||||
desc: t(`llm.apiKey.desc`, { name }),
|
||||
label: t(`llm.apiKey.title`),
|
||||
name: [KeyVaultsConfigKey, id, LLMProviderApiTokenKey],
|
||||
},
|
||||
]);
|
||||
|
||||
const aceGcmItem: FormItemProps = {
|
||||
children: (
|
||||
<>
|
||||
<Icon icon={LockIcon} style={{ marginRight: 4 }} />
|
||||
<Trans i18nKey="llm.aesGcm" ns={'setting'}>
|
||||
您的秘钥与代理地址等将使用
|
||||
<Link href={AES_GCM_URL} style={{ marginInline: 4 }} target={'_blank'}>
|
||||
AES-GCM
|
||||
</Link>
|
||||
加密算法进行加密
|
||||
</Trans>
|
||||
</>
|
||||
),
|
||||
className: styles.aceGcm,
|
||||
minWidth: undefined,
|
||||
};
|
||||
|
||||
const showEndpoint = !!proxyUrl;
|
||||
|
||||
const formItems = [
|
||||
...apiKeyItem,
|
||||
showEndpoint && {
|
||||
children: <Input allowClear placeholder={proxyUrl?.placeholder} />,
|
||||
desc: proxyUrl?.desc || t('llm.proxyUrl.desc'),
|
||||
label: proxyUrl?.title || t('llm.proxyUrl.title'),
|
||||
name: [KeyVaultsConfigKey, id, LLMProviderBaseUrlKey],
|
||||
},
|
||||
/*
|
||||
* Conditions to show Client Fetch Switch
|
||||
* 1. provider is not disabled browser request
|
||||
* 2. provider show browser request by default
|
||||
* 3. Provider allow to edit endpoint and the value of endpoint is not empty
|
||||
* 4. There is an apikey provided by user
|
||||
*/
|
||||
!disableBrowserRequest &&
|
||||
(defaultShowBrowserRequest ||
|
||||
(showEndpoint && isProviderEndpointNotEmpty) ||
|
||||
(showApiKey && isProviderApiKeyNotEmpty)) && {
|
||||
children: (
|
||||
<Switch
|
||||
onChange={(enabled) => {
|
||||
setSettings({ [LLMProviderConfigKey]: { [id]: { fetchOnClient: enabled } } });
|
||||
}}
|
||||
value={isFetchOnClient}
|
||||
/>
|
||||
),
|
||||
desc: t('llm.fetchOnClient.desc'),
|
||||
label: t('llm.fetchOnClient.title'),
|
||||
minWidth: undefined,
|
||||
},
|
||||
{
|
||||
children: (
|
||||
<ProviderModelListSelect
|
||||
notFoundContent={modelList?.notFoundContent}
|
||||
placeholder={modelList?.placeholder ?? t('llm.modelList.placeholder')}
|
||||
provider={id}
|
||||
showAzureDeployName={modelList?.azureDeployName}
|
||||
showModelFetcher={modelList?.showModelFetcher}
|
||||
/>
|
||||
),
|
||||
desc: t('llm.modelList.desc'),
|
||||
label: t('llm.modelList.title'),
|
||||
name: [LLMProviderConfigKey, id, LLMProviderModelListKey],
|
||||
},
|
||||
showChecker
|
||||
? (checkerItem ?? {
|
||||
children: <Checker model={checkModel!} provider={id} />,
|
||||
desc: t('llm.checker.desc'),
|
||||
label: t('llm.checker.title'),
|
||||
minWidth: undefined,
|
||||
})
|
||||
: undefined,
|
||||
showAceGcm && isServerMode && aceGcmItem,
|
||||
].filter(Boolean) as FormItemProps[];
|
||||
|
||||
/* ↓ cloud slot ↓ */
|
||||
|
||||
/* ↑ cloud slot ↑ */
|
||||
|
||||
const model: FormGroupItemType = {
|
||||
children: formItems,
|
||||
|
||||
defaultActive: canDeactivate ? enabled : undefined,
|
||||
|
||||
extra: (
|
||||
<Flexbox align={'center'} gap={8} horizontal>
|
||||
{extra}
|
||||
<Tooltip title={t('llm.helpDoc')}>
|
||||
<Link
|
||||
href={urlJoin(BASE_PROVIDER_DOC_URL, id)}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
target={'_blank'}
|
||||
>
|
||||
<Center className={styles.help} height={20} width={20}>
|
||||
?
|
||||
</Center>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
{canDeactivate ? (
|
||||
<Switch
|
||||
onChange={(enabled) => {
|
||||
toggleProviderEnabled(id, enabled);
|
||||
}}
|
||||
value={enabled}
|
||||
/>
|
||||
) : undefined}
|
||||
</Flexbox>
|
||||
),
|
||||
title: (
|
||||
<Flexbox
|
||||
align={'center'}
|
||||
horizontal
|
||||
style={{
|
||||
height: 24,
|
||||
maxHeight: 24,
|
||||
...(enabled ? {} : { filter: 'grayscale(100%)', maxHeight: 24, opacity: 0.66 }),
|
||||
}}
|
||||
>
|
||||
{title ?? <ProviderCombine provider={id} size={24} />}
|
||||
</Flexbox>
|
||||
),
|
||||
};
|
||||
|
||||
return (
|
||||
<Form
|
||||
className={cx(styles.form, className)}
|
||||
form={form}
|
||||
items={[model]}
|
||||
onValuesChange={debounce(setSettings, 100)}
|
||||
{...FORM_STYLE}
|
||||
/>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
export default ProviderConfig;
|
||||
-98
@@ -1,98 +0,0 @@
|
||||
import { ModelIcon } from '@lobehub/icons';
|
||||
import { ActionIcon, Icon, Text } from '@lobehub/ui';
|
||||
import { App } from 'antd';
|
||||
import isEqual from 'fast-deep-equal';
|
||||
import { LucideArrowRight, LucideSettings, LucideTrash2 } from 'lucide-react';
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { ModelInfoTags } from '@/components/ModelSelect';
|
||||
import { useUserStore } from '@/store/user';
|
||||
import { modelConfigSelectors, modelProviderSelectors } from '@/store/user/selectors';
|
||||
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
||||
|
||||
interface CustomModelOptionProps {
|
||||
id: string;
|
||||
provider: GlobalLLMProviderKey;
|
||||
}
|
||||
|
||||
const CustomModelOption = memo<CustomModelOptionProps>(({ id, provider }) => {
|
||||
const { t } = useTranslation('common');
|
||||
const { t: s } = useTranslation('setting');
|
||||
const { modal } = App.useApp();
|
||||
|
||||
const [dispatchCustomModelCards, toggleEditingCustomModelCard, removeEnabledModels] =
|
||||
useUserStore((s) => [
|
||||
s.dispatchCustomModelCards,
|
||||
s.toggleEditingCustomModelCard,
|
||||
s.removeEnabledModels,
|
||||
]);
|
||||
|
||||
const modelCard = useUserStore(
|
||||
modelConfigSelectors.getCustomModelCard({ id, provider }),
|
||||
isEqual,
|
||||
);
|
||||
|
||||
const isEnabled = useUserStore(
|
||||
(s) => modelProviderSelectors.getEnableModelsById(provider)(s)?.includes(id),
|
||||
isEqual,
|
||||
);
|
||||
|
||||
return (
|
||||
<Flexbox align={'center'} distribution={'space-between'} gap={8} horizontal>
|
||||
<Flexbox align={'center'} gap={8} horizontal style={{ flex: 1, width: '70%' }}>
|
||||
<ModelIcon model={id} size={32} />
|
||||
<Flexbox direction={'vertical'} style={{ flex: 1, overflow: 'hidden' }}>
|
||||
<Flexbox align={'center'} gap={8} horizontal>
|
||||
<Text ellipsis>{modelCard?.displayName || id}</Text>
|
||||
<ModelInfoTags id={id} {...modelCard} isCustom />
|
||||
</Flexbox>
|
||||
<Text ellipsis style={{ fontSize: 12, marginTop: '4px' }} type={'secondary'}>
|
||||
{id}
|
||||
{!!modelCard?.deploymentName && (
|
||||
<>
|
||||
<Icon icon={LucideArrowRight} />
|
||||
{modelCard?.deploymentName}
|
||||
</>
|
||||
)}
|
||||
</Text>
|
||||
</Flexbox>
|
||||
</Flexbox>
|
||||
|
||||
<Flexbox horizontal>
|
||||
<ActionIcon
|
||||
icon={LucideSettings}
|
||||
onClick={async (e) => {
|
||||
e.stopPropagation();
|
||||
toggleEditingCustomModelCard({ id, provider });
|
||||
}}
|
||||
title={s('llm.customModelCards.config')}
|
||||
/>
|
||||
<ActionIcon
|
||||
icon={LucideTrash2}
|
||||
onClick={async (e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
await modal.confirm({
|
||||
centered: true,
|
||||
content: s('llm.customModelCards.confirmDelete'),
|
||||
okButtonProps: { danger: true },
|
||||
onOk: async () => {
|
||||
// delete model and deactivate id
|
||||
await dispatchCustomModelCards(provider, { id, type: 'delete' });
|
||||
await removeEnabledModels(provider, id);
|
||||
},
|
||||
type: 'warning',
|
||||
});
|
||||
}}
|
||||
style={isEnabled ? { marginRight: '10px' } : {}}
|
||||
title={t('delete')}
|
||||
/>
|
||||
</Flexbox>
|
||||
</Flexbox>
|
||||
);
|
||||
});
|
||||
|
||||
export default CustomModelOption;
|
||||
-104
@@ -1,104 +0,0 @@
|
||||
import { Input } from '@lobehub/ui';
|
||||
import { Checkbox, Form, FormInstance } from 'antd';
|
||||
import { memo, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import MaxTokenSlider from '@/components/MaxTokenSlider';
|
||||
import { useIsMobile } from '@/hooks/useIsMobile';
|
||||
import { ChatModelCard } from '@/types/llm';
|
||||
|
||||
interface ModelConfigFormProps {
|
||||
initialValues?: ChatModelCard;
|
||||
onFormInstanceReady: (instance: FormInstance) => void;
|
||||
showAzureDeployName?: boolean;
|
||||
}
|
||||
|
||||
const ModelConfigForm = memo<ModelConfigFormProps>(
|
||||
({ showAzureDeployName, onFormInstanceReady, initialValues }) => {
|
||||
const { t } = useTranslation('setting');
|
||||
|
||||
const [formInstance] = Form.useForm();
|
||||
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
useEffect(() => {
|
||||
onFormInstanceReady(formInstance);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
colon={false}
|
||||
form={formInstance}
|
||||
initialValues={initialValues}
|
||||
labelCol={{ span: 4 }}
|
||||
style={{ marginTop: 16 }}
|
||||
wrapperCol={isMobile ? { span: 18 } : { offset: 1, span: 18 }}
|
||||
>
|
||||
<Form.Item
|
||||
extra={t('llm.customModelCards.modelConfig.id.extra')}
|
||||
label={t('llm.customModelCards.modelConfig.id.title')}
|
||||
name={'id'}
|
||||
>
|
||||
<Input placeholder={t('llm.customModelCards.modelConfig.id.placeholder')} />
|
||||
</Form.Item>
|
||||
{showAzureDeployName && (
|
||||
<Form.Item
|
||||
extra={t('llm.customModelCards.modelConfig.azureDeployName.extra')}
|
||||
label={t('llm.customModelCards.modelConfig.azureDeployName.title')}
|
||||
name={'deploymentName'}
|
||||
>
|
||||
<Input
|
||||
placeholder={t('llm.customModelCards.modelConfig.azureDeployName.placeholder')}
|
||||
/>
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item
|
||||
label={t('llm.customModelCards.modelConfig.displayName.title')}
|
||||
name={'displayName'}
|
||||
>
|
||||
<Input placeholder={t('llm.customModelCards.modelConfig.displayName.placeholder')} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t('llm.customModelCards.modelConfig.tokens.title')}
|
||||
name={'contextWindowTokens'}
|
||||
>
|
||||
<MaxTokenSlider />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
extra={t('llm.customModelCards.modelConfig.functionCall.extra')}
|
||||
label={t('llm.customModelCards.modelConfig.functionCall.title')}
|
||||
name={'functionCall'}
|
||||
valuePropName={'checked'}
|
||||
>
|
||||
<Checkbox />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
extra={t('llm.customModelCards.modelConfig.vision.extra')}
|
||||
label={t('llm.customModelCards.modelConfig.vision.title')}
|
||||
name={'vision'}
|
||||
valuePropName={'checked'}
|
||||
>
|
||||
<Checkbox />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
extra={t('llm.customModelCards.modelConfig.files.extra')}
|
||||
label={t('llm.customModelCards.modelConfig.files.title')}
|
||||
name={'files'}
|
||||
valuePropName={'checked'}
|
||||
>
|
||||
<Checkbox />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
);
|
||||
export default ModelConfigForm;
|
||||
-77
@@ -1,77 +0,0 @@
|
||||
import { Button, Modal } from '@lobehub/ui';
|
||||
import { FormInstance } from 'antd';
|
||||
import isEqual from 'fast-deep-equal';
|
||||
import { memo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { useUserStore } from '@/store/user';
|
||||
import { modelConfigSelectors } from '@/store/user/selectors';
|
||||
|
||||
import ModelConfigForm from './Form';
|
||||
|
||||
interface ModelConfigModalProps {
|
||||
provider?: string;
|
||||
showAzureDeployName?: boolean;
|
||||
}
|
||||
|
||||
const ModelConfigModal = memo<ModelConfigModalProps>(({ showAzureDeployName, provider }) => {
|
||||
const { t } = useTranslation('setting');
|
||||
const { t: tc } = useTranslation('common');
|
||||
const [formInstance, setFormInstance] = useState<FormInstance>();
|
||||
|
||||
const [open, id, editingProvider, dispatchCustomModelCards, toggleEditingCustomModelCard] =
|
||||
useUserStore((s) => [
|
||||
!!s.editingCustomCardModel && provider === s.editingCustomCardModel?.provider,
|
||||
s.editingCustomCardModel?.id,
|
||||
s.editingCustomCardModel?.provider,
|
||||
s.dispatchCustomModelCards,
|
||||
s.toggleEditingCustomModelCard,
|
||||
]);
|
||||
|
||||
const modelCard = useUserStore(
|
||||
modelConfigSelectors.getCustomModelCard({ id, provider: editingProvider }),
|
||||
isEqual,
|
||||
);
|
||||
|
||||
const closeModal = () => {
|
||||
toggleEditingCustomModelCard(undefined);
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
destroyOnHidden
|
||||
footer={[
|
||||
<Button key="cancel" onClick={closeModal}>
|
||||
{tc('cancel')}
|
||||
</Button>,
|
||||
<Button
|
||||
key="ok"
|
||||
onClick={() => {
|
||||
if (!editingProvider || !id || !formInstance) return;
|
||||
const data = formInstance.getFieldsValue();
|
||||
|
||||
dispatchCustomModelCards(editingProvider as any, { id, type: 'update', value: data });
|
||||
|
||||
closeModal();
|
||||
}}
|
||||
style={{ marginInlineStart: '16px' }}
|
||||
type="primary"
|
||||
>
|
||||
{tc('ok')}
|
||||
</Button>,
|
||||
]}
|
||||
maskClosable
|
||||
onCancel={closeModal}
|
||||
open={open}
|
||||
title={t('llm.customModelCards.modelConfig.modalTitle')}
|
||||
zIndex={1251} // Select is 1150
|
||||
>
|
||||
<ModelConfigForm
|
||||
initialValues={modelCard}
|
||||
onFormInstanceReady={setFormInstance}
|
||||
showAzureDeployName={showAzureDeployName}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
});
|
||||
export default ModelConfigModal;
|
||||
@@ -1,105 +0,0 @@
|
||||
import { ActionIcon, Icon, Text, Tooltip } from '@lobehub/ui';
|
||||
import { createStyles } from 'antd-style';
|
||||
import dayjs from 'dayjs';
|
||||
import isEqual from 'fast-deep-equal';
|
||||
import { CircleX, LucideLoaderCircle, LucideRefreshCcwDot } from 'lucide-react';
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { useUserStore } from '@/store/user';
|
||||
import {
|
||||
modelConfigSelectors,
|
||||
modelProviderSelectors,
|
||||
settingsSelectors,
|
||||
} from '@/store/user/selectors';
|
||||
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
||||
|
||||
const useStyles = createStyles(({ css, token }) => ({
|
||||
hover: css`
|
||||
cursor: pointer;
|
||||
|
||||
padding-block: 4px;
|
||||
padding-inline: 8px;
|
||||
border-radius: ${token.borderRadius}px;
|
||||
|
||||
transition: all 0.2s ease-in-out;
|
||||
|
||||
&:hover {
|
||||
color: ${token.colorText};
|
||||
background-color: ${token.colorFillSecondary};
|
||||
}
|
||||
`,
|
||||
}));
|
||||
|
||||
interface ModelFetcherProps {
|
||||
provider: GlobalLLMProviderKey;
|
||||
}
|
||||
|
||||
const ModelFetcher = memo<ModelFetcherProps>(({ provider }) => {
|
||||
const { styles } = useStyles();
|
||||
const { t } = useTranslation('setting');
|
||||
const [useFetchProviderModelList, clearObtainedModels] = useUserStore((s) => [
|
||||
s.useFetchProviderModelList,
|
||||
s.clearObtainedModels,
|
||||
s.setModelProviderConfig,
|
||||
]);
|
||||
const enabledAutoFetch = useUserStore(modelConfigSelectors.isAutoFetchModelsEnabled(provider));
|
||||
const latestFetchTime = useUserStore(
|
||||
(s) => settingsSelectors.providerConfig(provider)(s)?.latestFetchTime,
|
||||
);
|
||||
const totalModels = useUserStore(
|
||||
(s) => modelProviderSelectors.getModelCardsById(provider)(s).length,
|
||||
);
|
||||
|
||||
const remoteModels = useUserStore(
|
||||
modelProviderSelectors.remoteProviderModelCards(provider),
|
||||
isEqual,
|
||||
);
|
||||
|
||||
const { mutate, isValidating } = useFetchProviderModelList(provider, enabledAutoFetch);
|
||||
|
||||
return (
|
||||
<Text style={{ fontSize: 12 }} type={'secondary'}>
|
||||
<Flexbox align={'center'} gap={0} horizontal justify={'space-between'}>
|
||||
<div style={{ display: 'flex', lineHeight: '24px' }}>
|
||||
{t('llm.modelList.total', { count: totalModels })}
|
||||
{remoteModels && remoteModels.length > 0 && (
|
||||
<ActionIcon
|
||||
icon={CircleX}
|
||||
onClick={() => clearObtainedModels(provider)}
|
||||
size={'small'}
|
||||
title={t('llm.fetcher.clear')}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<Tooltip
|
||||
styles={{ root: { pointerEvents: 'none' } }}
|
||||
title={
|
||||
latestFetchTime
|
||||
? t('llm.fetcher.latestTime', {
|
||||
time: dayjs(latestFetchTime).format('YYYY-MM-DD HH:mm:ss'),
|
||||
})
|
||||
: t('llm.fetcher.noLatestTime')
|
||||
}
|
||||
>
|
||||
<Flexbox
|
||||
align={'center'}
|
||||
className={styles.hover}
|
||||
gap={4}
|
||||
horizontal
|
||||
onClick={() => mutate()}
|
||||
>
|
||||
<Icon
|
||||
icon={isValidating ? LucideLoaderCircle : LucideRefreshCcwDot}
|
||||
size={'small'}
|
||||
spin={isValidating}
|
||||
/>
|
||||
<div>{isValidating ? t('llm.fetcher.fetching') : t('llm.fetcher.fetch')}</div>
|
||||
</Flexbox>
|
||||
</Tooltip>
|
||||
</Flexbox>
|
||||
</Text>
|
||||
);
|
||||
});
|
||||
export default ModelFetcher;
|
||||
@@ -1,68 +0,0 @@
|
||||
import { ModelIcon } from '@lobehub/icons';
|
||||
import { ActionIcon, Text, Tooltip } from '@lobehub/ui';
|
||||
import { useTheme } from 'antd-style';
|
||||
import isEqual from 'fast-deep-equal';
|
||||
import { Recycle } from 'lucide-react';
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { ModelInfoTags } from '@/components/ModelSelect';
|
||||
import { useUserStore } from '@/store/user';
|
||||
import { modelProviderSelectors } from '@/store/user/selectors';
|
||||
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
||||
|
||||
import CustomModelOption from './CustomModelOption';
|
||||
|
||||
interface OptionRenderProps {
|
||||
displayName: string;
|
||||
id: string;
|
||||
isAzure?: boolean;
|
||||
provider: GlobalLLMProviderKey;
|
||||
removed?: boolean;
|
||||
}
|
||||
const OptionRender = memo<OptionRenderProps>(({ displayName, id, provider, isAzure, removed }) => {
|
||||
const model = useUserStore(
|
||||
(s) => modelProviderSelectors.getModelCardById(id, provider)(s),
|
||||
isEqual,
|
||||
);
|
||||
const { t } = useTranslation('components');
|
||||
const theme = useTheme();
|
||||
// if there is isCustom, it means it is a user defined custom model
|
||||
if (model?.isCustom || isAzure) return <CustomModelOption id={id} provider={provider} />;
|
||||
|
||||
return (
|
||||
<Flexbox
|
||||
align={'center'}
|
||||
gap={8}
|
||||
horizontal
|
||||
justify={'space-between'}
|
||||
style={{ paddingInlineEnd: 8 }}
|
||||
>
|
||||
<Flexbox align={'center'} gap={8} horizontal>
|
||||
<ModelIcon model={id} size={32} />
|
||||
<Flexbox>
|
||||
<Flexbox align={'center'} gap={8} horizontal>
|
||||
{displayName}
|
||||
<ModelInfoTags directionReverse placement={'top'} {...model!} />
|
||||
</Flexbox>
|
||||
<Text style={{ fontSize: 12 }} type={'secondary'}>
|
||||
{id}
|
||||
</Text>
|
||||
</Flexbox>
|
||||
</Flexbox>
|
||||
{removed && (
|
||||
<Tooltip
|
||||
placement={'top'}
|
||||
style={{ pointerEvents: 'none' }}
|
||||
styles={{ root: { maxWidth: 300 } }}
|
||||
title={t('ModelSelect.removed')}
|
||||
>
|
||||
<ActionIcon icon={Recycle} style={{ color: theme.colorWarning }} />
|
||||
</Tooltip>
|
||||
)}
|
||||
</Flexbox>
|
||||
);
|
||||
});
|
||||
|
||||
export default OptionRender;
|
||||
@@ -1,146 +0,0 @@
|
||||
import { ActionIcon, Select } from '@lobehub/ui';
|
||||
import { css, cx } from 'antd-style';
|
||||
import isEqual from 'fast-deep-equal';
|
||||
import { RotateCwIcon } from 'lucide-react';
|
||||
import { ReactNode, memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { useUserStore } from '@/store/user';
|
||||
import { modelProviderSelectors } from '@/store/user/selectors';
|
||||
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
||||
|
||||
import ModelConfigModal from './ModelConfigModal';
|
||||
import ModelFetcher from './ModelFetcher';
|
||||
import OptionRender from './Option';
|
||||
|
||||
const styles = {
|
||||
divStyle: css`
|
||||
position: relative;
|
||||
|
||||
.ant-select-selector {
|
||||
padding-inline-end: 50px !important;
|
||||
}
|
||||
`,
|
||||
popup: css`
|
||||
&.ant-select-dropdown {
|
||||
.ant-select-item-option-selected {
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
`,
|
||||
reset: css`
|
||||
position: absolute;
|
||||
z-index: 20;
|
||||
inset-block-start: 50%;
|
||||
inset-inline-end: 28px;
|
||||
transform: translateY(-50%);
|
||||
`,
|
||||
};
|
||||
|
||||
interface CustomModelSelectProps {
|
||||
notFoundContent?: ReactNode;
|
||||
placeholder?: string;
|
||||
provider: GlobalLLMProviderKey;
|
||||
showAzureDeployName?: boolean;
|
||||
showModelFetcher?: boolean;
|
||||
}
|
||||
|
||||
const ProviderModelListSelect = memo<CustomModelSelectProps>(
|
||||
({ showModelFetcher = false, provider, showAzureDeployName, notFoundContent, placeholder }) => {
|
||||
const { t } = useTranslation('common');
|
||||
const { t: transSetting } = useTranslation('setting');
|
||||
const [setModelProviderConfig, updateEnabledModels] = useUserStore((s) => [
|
||||
s.setModelProviderConfig,
|
||||
s.updateEnabledModels,
|
||||
]);
|
||||
|
||||
const chatModelCards = useUserStore(
|
||||
modelProviderSelectors.getModelCardsById(provider),
|
||||
isEqual,
|
||||
);
|
||||
|
||||
const defaultEnableModel = useUserStore(
|
||||
modelProviderSelectors.getDefaultEnabledModelsById(provider),
|
||||
isEqual,
|
||||
);
|
||||
const enabledModels = useUserStore(
|
||||
modelProviderSelectors.getEnableModelsById(provider),
|
||||
isEqual,
|
||||
);
|
||||
|
||||
const showReset = !!enabledModels && !isEqual(defaultEnableModel, enabledModels);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Flexbox gap={8}>
|
||||
<div className={cx(styles.divStyle)}>
|
||||
<div className={cx(styles.reset)}>
|
||||
{showReset && (
|
||||
<ActionIcon
|
||||
icon={RotateCwIcon}
|
||||
onClick={() => {
|
||||
setModelProviderConfig(provider, { enabledModels: null });
|
||||
}}
|
||||
size={'small'}
|
||||
title={t('reset')}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<Select
|
||||
allowClear
|
||||
mode="tags"
|
||||
notFoundContent={notFoundContent}
|
||||
onChange={(value, options) => {
|
||||
updateEnabledModels(provider, value, options as any[]);
|
||||
}}
|
||||
optionFilterProp="label"
|
||||
optionRender={({ label, value }) => {
|
||||
// model is in the chatModels
|
||||
if (chatModelCards.some((c) => c.id === value))
|
||||
return (
|
||||
<OptionRender
|
||||
displayName={label as string}
|
||||
id={value as string}
|
||||
isAzure={showAzureDeployName}
|
||||
provider={provider}
|
||||
/>
|
||||
);
|
||||
|
||||
if (enabledModels?.some((m) => value === m)) {
|
||||
return (
|
||||
<OptionRender
|
||||
displayName={label as string}
|
||||
id={value as string}
|
||||
isAzure={showAzureDeployName}
|
||||
provider={provider}
|
||||
removed
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// model is defined by user in client
|
||||
return (
|
||||
<Flexbox align={'center'} gap={8} horizontal>
|
||||
{transSetting('llm.customModelCards.addNew', { id: value })}
|
||||
</Flexbox>
|
||||
);
|
||||
}}
|
||||
options={chatModelCards.map((model) => ({
|
||||
label: model.displayName || model.id,
|
||||
value: model.id,
|
||||
}))}
|
||||
placeholder={placeholder}
|
||||
popupClassName={cx(styles.popup)}
|
||||
value={enabledModels ?? defaultEnableModel}
|
||||
/>
|
||||
</div>
|
||||
{showModelFetcher && <ModelFetcher provider={provider} />}
|
||||
</Flexbox>
|
||||
<ModelConfigModal provider={provider} showAzureDeployName={showAzureDeployName} />
|
||||
</>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
export default ProviderModelListSelect;
|
||||
@@ -1,20 +0,0 @@
|
||||
export const LLMProviderConfigKey = 'languageModel';
|
||||
export const KeyVaultsConfigKey = 'keyVaults';
|
||||
|
||||
/**
|
||||
* we use this key to define default api key
|
||||
* equal GOOGLE_API_KEY or ZHIPU_API_KEY
|
||||
*/
|
||||
export const LLMProviderApiTokenKey = 'apiKey';
|
||||
|
||||
/**
|
||||
* we use this key to define the baseURL
|
||||
* equal OPENAI_PROXY_URL
|
||||
*/
|
||||
export const LLMProviderBaseUrlKey = 'baseURL';
|
||||
|
||||
/**
|
||||
* we use this key to define the custom model name
|
||||
* equal CUSTOM_MODELS
|
||||
*/
|
||||
export const LLMProviderModelListKey = 'enabledModels';
|
||||
@@ -1,35 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { useTheme } from 'antd-style';
|
||||
import Link from 'next/link';
|
||||
import { memo } from 'react';
|
||||
import { Trans } from 'react-i18next';
|
||||
import { Center } from 'react-layout-kit';
|
||||
|
||||
import { MORE_MODEL_PROVIDER_REQUEST_URL } from '@/const/url';
|
||||
|
||||
const Footer = memo(() => {
|
||||
const theme = useTheme();
|
||||
return (
|
||||
<Center
|
||||
style={{
|
||||
background: theme.colorFillQuaternary,
|
||||
border: `1px dashed ${theme.colorFillSecondary}`,
|
||||
borderRadius: theme.borderRadiusLG,
|
||||
padding: 12,
|
||||
}}
|
||||
>
|
||||
<div style={{ color: theme.colorTextSecondary, fontSize: 12, textAlign: 'center' }}>
|
||||
<Trans i18nKey="llm.waitingForMore" ns={'setting'}>
|
||||
更多模型正在
|
||||
<Link aria-label={'todo'} href={MORE_MODEL_PROVIDER_REQUEST_URL} target="_blank">
|
||||
计划接入
|
||||
</Link>
|
||||
中 ,敬请期待
|
||||
</Trans>
|
||||
</div>
|
||||
</Center>
|
||||
);
|
||||
});
|
||||
|
||||
export default Footer;
|
||||
@@ -1,26 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { isCustomBranding } from '@/const/version';
|
||||
|
||||
import { useProviderList } from './ProviderList/providers';
|
||||
import ProviderConfig from './components/ProviderConfig';
|
||||
import Footer from './features/Footer';
|
||||
|
||||
const Page = () => {
|
||||
const list = useProviderList();
|
||||
|
||||
return (
|
||||
<Flexbox gap={24} width={'100%'}>
|
||||
{list.map(({ id, ...res }) => (
|
||||
<ProviderConfig id={id as any} key={id} {...res} />
|
||||
))}
|
||||
{!isCustomBranding && <Footer />}
|
||||
</Flexbox>
|
||||
);
|
||||
};
|
||||
|
||||
Page.displayName = 'LlmSetting';
|
||||
|
||||
export default Page;
|
||||
@@ -1,26 +0,0 @@
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
import { serverFeatureFlags } from '@/config/featureFlags';
|
||||
import { metadataModule } from '@/server/metadata';
|
||||
import { translation } from '@/server/translation';
|
||||
import { DynamicLayoutProps } from '@/types/next';
|
||||
import { RouteVariants } from '@/utils/server/routeVariants';
|
||||
|
||||
import Page from './index';
|
||||
|
||||
export const generateMetadata = async (props: DynamicLayoutProps) => {
|
||||
const locale = await RouteVariants.getLocale(props);
|
||||
const { t } = await translation('setting', locale);
|
||||
return metadataModule.generate({
|
||||
description: t('header.desc'),
|
||||
title: t('tab.llm'),
|
||||
url: '/settings/llm',
|
||||
});
|
||||
};
|
||||
|
||||
export default () => {
|
||||
const showLLM = serverFeatureFlags().showLLM;
|
||||
if (!showLLM) return notFound();
|
||||
|
||||
return <Page />;
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
import { ProviderConfigProps } from './components/ProviderConfig';
|
||||
|
||||
export interface ProviderItem extends Omit<ProviderConfigProps, 'id'> {
|
||||
id: string;
|
||||
}
|
||||
@@ -7,9 +7,7 @@ import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { FormInput, FormPassword } from '@/components/FormInput';
|
||||
import { AzureProviderCard } from '@/config/modelProviders';
|
||||
import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra';
|
||||
import { useUserStore } from '@/store/user';
|
||||
import { modelProviderSelectors } from '@/store/user/selectors';
|
||||
import { aiModelSelectors, aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra';
|
||||
|
||||
import { KeyVaultsConfigKey, LLMProviderApiTokenKey, LLMProviderBaseUrlKey } from '../../const';
|
||||
import { SkeletonInput } from '../../features/ProviderConfig';
|
||||
@@ -35,14 +33,13 @@ const useProviderCard = (): ProviderItem => {
|
||||
const { styles } = useStyles();
|
||||
|
||||
// Get the first model card's deployment name as the check model
|
||||
const checkModel = useUserStore((s) => {
|
||||
const chatModelCards = modelProviderSelectors.getModelCardsById(providerKey)(s);
|
||||
const checkModel = useAiInfraStore((s) => {
|
||||
const chatModelCards = aiModelSelectors.enabledAiProviderModelList(s);
|
||||
|
||||
if (chatModelCards.length > 0) {
|
||||
return chatModelCards[0].deploymentName;
|
||||
}
|
||||
if (chatModelCards.length > 0 && chatModelCards[0].config?.deploymentName)
|
||||
return chatModelCards[0].config?.deploymentName;
|
||||
|
||||
return 'gpt-35-turbo';
|
||||
return 'gpt-4.1-mini';
|
||||
});
|
||||
|
||||
const isLoading = useAiInfraStore(aiProviderSelectors.isAiProviderConfigLoading(providerKey));
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { Alert } from '@lobehub/ui';
|
||||
import Link from 'next/link';
|
||||
import { memo } from 'react';
|
||||
import { Trans } from 'react-i18next';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { MAX_WIDTH } from '@/const/layoutTokens';
|
||||
import { WEBRTC_SYNC_DOCUMENTS } from '@/const/url';
|
||||
import { useUserStore } from '@/store/user';
|
||||
import { preferenceSelectors } from '@/store/user/selectors';
|
||||
|
||||
interface ExperimentAlertProps {
|
||||
mobile?: boolean;
|
||||
}
|
||||
const ExperimentAlert = memo<ExperimentAlertProps>(({ mobile }) => {
|
||||
const [hideSyncAlert, updatePreference] = useUserStore((s) => [
|
||||
preferenceSelectors.hideSyncAlert(s),
|
||||
s.updatePreference,
|
||||
]);
|
||||
|
||||
return (
|
||||
!hideSyncAlert && (
|
||||
<Flexbox style={{ maxWidth: MAX_WIDTH }} width={'100%'}>
|
||||
<Alert
|
||||
banner={mobile}
|
||||
closable
|
||||
message={
|
||||
<Trans i18nKey="sync.warning.tip" ns={'setting'}>
|
||||
经过较长一段时间测试,WebRTC 同步可能无法稳定满足通用的数据同步诉求。请自行
|
||||
<Link
|
||||
aria-label={'Webrtc Sync deployment'}
|
||||
href={WEBRTC_SYNC_DOCUMENTS}
|
||||
style={{ color: 'inherit', textDecoration: 'underline' }}
|
||||
target="_blank"
|
||||
>
|
||||
部署信令服务器
|
||||
</Link>
|
||||
后使用。
|
||||
</Trans>
|
||||
}
|
||||
onClose={() => {
|
||||
updatePreference({ hideSyncAlert: true });
|
||||
}}
|
||||
type={'warning'}
|
||||
/>
|
||||
</Flexbox>
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
export default ExperimentAlert;
|
||||
@@ -1,42 +0,0 @@
|
||||
import { createStyles } from 'antd-style';
|
||||
import { ReactNode, memo } from 'react';
|
||||
import { Center, Flexbox } from 'react-layout-kit';
|
||||
|
||||
const useStyles = createStyles(({ css, token, responsive }) => ({
|
||||
container: css`
|
||||
border-radius: ${token.borderRadius}px;
|
||||
background: ${token.colorFillTertiary};
|
||||
|
||||
.${responsive.mobile} {
|
||||
width: 100%;
|
||||
}
|
||||
`,
|
||||
icon: css`
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
`,
|
||||
title: css`
|
||||
font-size: 16px;
|
||||
`,
|
||||
}));
|
||||
|
||||
const Card = memo<{ icon: ReactNode; title: string }>(({ title, icon }) => {
|
||||
const { styles } = useStyles();
|
||||
|
||||
return (
|
||||
<Flexbox
|
||||
align={'center'}
|
||||
className={styles.container}
|
||||
flex={1}
|
||||
gap={12}
|
||||
horizontal
|
||||
paddingBlock={12}
|
||||
paddingInline={20}
|
||||
>
|
||||
<Center className={styles.icon}>{icon}</Center>
|
||||
<div className={styles.title}>{title}</div>
|
||||
</Flexbox>
|
||||
);
|
||||
});
|
||||
|
||||
export default Card;
|
||||
@@ -1,62 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { EditableText, Text } from '@lobehub/ui';
|
||||
import { memo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { useUserStore } from '@/store/user';
|
||||
import { syncSettingsSelectors } from '@/store/user/selectors';
|
||||
|
||||
const DeviceName = memo(() => {
|
||||
const { t } = useTranslation('setting');
|
||||
|
||||
const [deviceName, setSettings] = useUserStore((s) => [
|
||||
syncSettingsSelectors.deviceName(s),
|
||||
s.setSettings,
|
||||
]);
|
||||
|
||||
const [editing, setEditing] = useState(false);
|
||||
|
||||
const updateDeviceName = (deviceName: string) => {
|
||||
setSettings({ sync: { deviceName } });
|
||||
setEditing(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<Flexbox
|
||||
align={'center'}
|
||||
flex={1}
|
||||
height={40}
|
||||
horizontal
|
||||
style={{ fontSize: 20, fontWeight: 'bold', lineHeight: 1, minWidth: 240, paddingLeft: 8 }}
|
||||
>
|
||||
{!deviceName && !editing && (
|
||||
<Flexbox
|
||||
onClick={() => {
|
||||
setEditing(true);
|
||||
}}
|
||||
style={{ cursor: 'pointer' }}
|
||||
>
|
||||
<Text type={'secondary'}>{t('sync.device.deviceName.hint')}</Text>
|
||||
</Flexbox>
|
||||
)}
|
||||
<EditableText
|
||||
editing={editing}
|
||||
inputProps={{
|
||||
placeholder: t('sync.device.deviceName.placeholder'),
|
||||
}}
|
||||
onBlur={(e) => updateDeviceName(e.target.value)}
|
||||
onChange={(e) => {
|
||||
updateDeviceName(e);
|
||||
}}
|
||||
onEditingChange={setEditing}
|
||||
size={'large'}
|
||||
value={deviceName}
|
||||
variant={'filled'}
|
||||
/>
|
||||
</Flexbox>
|
||||
);
|
||||
});
|
||||
|
||||
export default DeviceName;
|
||||
@@ -1,31 +0,0 @@
|
||||
import {
|
||||
SiAndroid,
|
||||
SiApple,
|
||||
SiBlackberry,
|
||||
SiGooglechrome,
|
||||
SiLinux,
|
||||
SiWindows11,
|
||||
} from '@icons-pack/react-simple-icons';
|
||||
import { memo } from 'react';
|
||||
|
||||
const SystemIcon = memo<{ title?: string }>(({ title }) => {
|
||||
if (!title) return;
|
||||
|
||||
if (['Mac OS', 'iOS', 'iPadOS'].includes(title)) return <SiApple size={24} />;
|
||||
|
||||
// Remove Microsoft brands in @icons-pack/react-simple-icons v10
|
||||
// https://github.com/simple-icons/simple-icons/pull/10019
|
||||
if (['Windows'].includes(title)) return <SiWindows11 size={24} />;
|
||||
|
||||
if (title === 'Android') return <SiAndroid size={24} />;
|
||||
|
||||
if (['BlackBerry'].includes(title)) return <SiBlackberry size={24} />;
|
||||
|
||||
if (title === 'Linux') return <SiLinux size={24} />;
|
||||
|
||||
if (title === 'Chrome OS') return <SiGooglechrome size={24} />;
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
export default SystemIcon;
|
||||
@@ -1,103 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { Text } from '@lobehub/ui';
|
||||
import { createStyles } from 'antd-style';
|
||||
import { rgba } from 'polished';
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { BrowserIcon } from '@/components/BrowserIcon';
|
||||
import { MAX_WIDTH } from '@/const/layoutTokens';
|
||||
|
||||
import Card from './Card';
|
||||
import DeviceName from './DeviceName';
|
||||
import SystemIcon from './SystemIcon';
|
||||
|
||||
const useStyles = createStyles(({ css, cx, responsive, isDarkMode, token, stylish }) => ({
|
||||
container: css`
|
||||
position: relative;
|
||||
width: 100%;
|
||||
border-radius: ${token.borderRadiusLG}px;
|
||||
`,
|
||||
content: css`
|
||||
z-index: 2;
|
||||
padding: 8px;
|
||||
border-radius: ${token.borderRadiusLG - 1}px;
|
||||
background: ${rgba(token.colorBgContainer, isDarkMode ? 0.7 : 1)};
|
||||
`,
|
||||
glow: cx(
|
||||
stylish.gradientAnimation,
|
||||
css`
|
||||
pointer-events: none;
|
||||
opacity: 0.5;
|
||||
background-image: linear-gradient(
|
||||
-45deg,
|
||||
${isDarkMode ? token.geekblue4 : token.geekblue},
|
||||
${isDarkMode ? token.cyan4 : token.cyan}
|
||||
);
|
||||
animation-duration: 10s;
|
||||
`,
|
||||
),
|
||||
wrapper: css`
|
||||
${responsive.mobile} {
|
||||
padding-block: 8px;
|
||||
padding-inline: 4px;
|
||||
}
|
||||
`,
|
||||
}));
|
||||
|
||||
interface DeviceCardProps {
|
||||
browser?: string;
|
||||
os?: string;
|
||||
}
|
||||
|
||||
const DeviceCard = memo<DeviceCardProps>(({ browser, os }) => {
|
||||
const { styles } = useStyles();
|
||||
const { t } = useTranslation('setting');
|
||||
|
||||
return (
|
||||
<Flexbox
|
||||
className={styles.wrapper}
|
||||
style={{ maxWidth: MAX_WIDTH, position: 'relative' }}
|
||||
width={'100%'}
|
||||
>
|
||||
<Flexbox className={styles.container} padding={4}>
|
||||
<Flexbox horizontal paddingBlock={8} paddingInline={12}>
|
||||
<div>
|
||||
<Text strong style={{ fontSize: 18 }}>
|
||||
{t('sync.device.title')}
|
||||
</Text>
|
||||
</div>
|
||||
</Flexbox>
|
||||
<Flexbox
|
||||
align={'center'}
|
||||
className={styles.content}
|
||||
flex={1}
|
||||
gap={16}
|
||||
horizontal
|
||||
justify={'space-between'}
|
||||
padding={12}
|
||||
wrap={'wrap'}
|
||||
>
|
||||
<DeviceName />
|
||||
<Flexbox flex={1} gap={12} horizontal>
|
||||
<Card icon={<SystemIcon title={os} />} title={os || t('sync.device.unknownOS')} />
|
||||
<Card
|
||||
icon={browser && <BrowserIcon browser={browser} size={24} />}
|
||||
title={browser || t('sync.device.unknownBrowser')}
|
||||
/>
|
||||
</Flexbox>
|
||||
</Flexbox>
|
||||
<Flexbox
|
||||
className={styles.glow}
|
||||
height={'100%'}
|
||||
style={{ left: 0, position: 'absolute', top: 0 }}
|
||||
width={'100%'}
|
||||
/>
|
||||
</Flexbox>
|
||||
</Flexbox>
|
||||
);
|
||||
});
|
||||
|
||||
export default DeviceCard;
|
||||
@@ -1,45 +0,0 @@
|
||||
import { ActionIcon, Input, InputProps } from '@lobehub/ui';
|
||||
import { FormInstance } from 'antd/es/form/hooks/useForm';
|
||||
import { LucideDices } from 'lucide-react';
|
||||
import { memo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { generateRandomRoomName } from './generateRandomRoomName';
|
||||
|
||||
interface ChannelNameInputProps extends Omit<InputProps, 'form'> {
|
||||
form: FormInstance;
|
||||
}
|
||||
|
||||
const ChannelNameInput = memo<ChannelNameInputProps>(({ form, ...rest }) => {
|
||||
const { t } = useTranslation('setting');
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<Input
|
||||
placeholder={t('sync.webrtc.channelName.placeholder')}
|
||||
suffix={
|
||||
<ActionIcon
|
||||
active
|
||||
icon={LucideDices}
|
||||
loading={loading}
|
||||
onClick={async () => {
|
||||
setLoading(true);
|
||||
const name = await generateRandomRoomName();
|
||||
setLoading(false);
|
||||
form.setFieldValue(['sync', 'webrtc', 'channelName'], name);
|
||||
form.setFieldValue(['sync', 'webrtc', 'enabled'], false);
|
||||
form.submit();
|
||||
}}
|
||||
size={'small'}
|
||||
style={{
|
||||
marginRight: -4,
|
||||
}}
|
||||
title={t('sync.webrtc.channelName.shuffle')}
|
||||
/>
|
||||
}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
export default ChannelNameInput;
|
||||
@@ -1,238 +0,0 @@
|
||||
/* stylelint-disable */
|
||||
.wrapper {
|
||||
--hue: 223;
|
||||
--off-hue: 3;
|
||||
--on-hue1: 123;
|
||||
--on-hue2: 168;
|
||||
--fg: hsl(var(--hue), 10%, 90%);
|
||||
--primary: hsl(var(--hue), 90%, 50%);
|
||||
--trans-dur: 0.6s;
|
||||
--trans-timing: cubic-bezier(0.65, 0, 0.35, 1);
|
||||
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.switch,
|
||||
.switch__input {
|
||||
-webkit-tap-highlight-color: #0000;
|
||||
}
|
||||
|
||||
.switch {
|
||||
position: relative;
|
||||
|
||||
display: block;
|
||||
|
||||
width: 5em;
|
||||
height: 3em;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.switch__base-outer,
|
||||
.switch__base-inner {
|
||||
position: absolute;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.switch__base-outer {
|
||||
top: 0.125em;
|
||||
left: 0.125em;
|
||||
|
||||
width: 4.75em;
|
||||
height: 2.75em;
|
||||
|
||||
border-radius: 1.25em;
|
||||
box-shadow:
|
||||
-0.125em -0.125em 0.25em hsl(var(--hue), 10%, 30%),
|
||||
0.125em 0.125em 0.125em hsl(var(--hue), 10%, 30%) inset,
|
||||
0.125em 0.125em 0.25em hsl(0deg, 0%, 0%),
|
||||
-0.125em -0.125em 0.125em hsl(var(--hue), 10%, 5%) inset;
|
||||
}
|
||||
|
||||
.switch__base-inner {
|
||||
top: 0.375em;
|
||||
left: 0.375em;
|
||||
|
||||
width: 4.25em;
|
||||
height: 2.25em;
|
||||
|
||||
border-radius: 1.125em;
|
||||
box-shadow:
|
||||
-0.25em -0.25em 0.25em hsl(var(--hue), 10%, 30%) inset,
|
||||
0.0625em 0.0625em 0.125em hsla(var(--hue), 10%, 30%),
|
||||
0.125em 0.25em 0.25em hsl(var(--hue), 10%, 5%) inset,
|
||||
-0.0625em -0.0625em 0.125em hsla(var(--hue), 10%, 5%);
|
||||
}
|
||||
|
||||
.switch__base-neon {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
overflow: visible;
|
||||
display: block;
|
||||
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.switch__base-neon path {
|
||||
stroke-dasharray: 0 104.26 0;
|
||||
transition: stroke-dasharray var(--trans-dur) var(--trans-timing);
|
||||
}
|
||||
|
||||
.switch__input {
|
||||
position: relative;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
appearance: none;
|
||||
outline: transparent;
|
||||
}
|
||||
|
||||
.switch__input::before {
|
||||
content: '';
|
||||
|
||||
position: absolute;
|
||||
inset: -0.125em;
|
||||
|
||||
display: block;
|
||||
|
||||
border-radius: 0.125em;
|
||||
box-shadow: 0 0 0 0.125em hsla(var(--hue), 90%, 50%, 0%);
|
||||
|
||||
transition: box-shadow 0.15s linear;
|
||||
}
|
||||
|
||||
.switch__input:focus-visible::before {
|
||||
box-shadow: 0 0 0 0.125em var(--primary);
|
||||
}
|
||||
|
||||
.switch__knob,
|
||||
.switch__knob-container {
|
||||
position: absolute;
|
||||
display: block;
|
||||
border-radius: 1em;
|
||||
}
|
||||
|
||||
.switch__knob {
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
|
||||
background-color: hsl(var(--hue), 10%, 15%);
|
||||
background-image:
|
||||
radial-gradient(
|
||||
88% 88% at 50% 50%,
|
||||
hsl(var(--hue), 10%, 20%) 47%,
|
||||
hsla(var(--hue), 10%, 20%, 0%) 50%
|
||||
),
|
||||
radial-gradient(
|
||||
88% 88% at 47% 47%,
|
||||
hsl(var(--hue), 10%, 85%) 45%,
|
||||
hsla(var(--hue), 10%, 85%, 0%) 50%
|
||||
),
|
||||
radial-gradient(
|
||||
65% 70% at 40% 60%,
|
||||
hsl(var(--hue), 10%, 20%) 46%,
|
||||
hsla(var(--hue), 10%, 20%, 0%) 50%
|
||||
);
|
||||
box-shadow:
|
||||
-0.0625em -0.0625em 0.0625em hsl(var(--hue), 10%, 15%) inset,
|
||||
-0.125em -0.125em 0.0625em hsl(var(--hue), 10%, 5%) inset,
|
||||
0.75em 0.25em 0.125em hsla(0deg, 0%, 0%, 80%);
|
||||
|
||||
transition: transform var(--trans-dur) var(--trans-timing);
|
||||
}
|
||||
|
||||
.switch__knob-container {
|
||||
top: 0.5em;
|
||||
left: 0.5em;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
width: 4em;
|
||||
height: 2em;
|
||||
}
|
||||
|
||||
.switch__knob-neon {
|
||||
display: block;
|
||||
width: 2em;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.switch__knob-neon circle {
|
||||
opacity: 0;
|
||||
stroke-dasharray: 0 90.32 0 54.19;
|
||||
transition:
|
||||
opacity var(--trans-dur) steps(1, end),
|
||||
stroke-dasharray var(--trans-dur) var(--trans-timing);
|
||||
}
|
||||
|
||||
.switch__knob-shadow {
|
||||
position: absolute;
|
||||
top: 0.5em;
|
||||
left: 0.5em;
|
||||
|
||||
display: block;
|
||||
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
|
||||
border-radius: 50%;
|
||||
box-shadow: 0.125em 0.125em 0.125em hsla(0deg, 0%, 0%, 90%);
|
||||
|
||||
transition: transform var(--trans-dur) var(--trans-timing);
|
||||
}
|
||||
|
||||
.switch__led {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
display: block;
|
||||
|
||||
width: 0.25em;
|
||||
height: 0.25em;
|
||||
|
||||
background-color: hsl(var(--off-hue), 90%, 70%);
|
||||
border-radius: 50%;
|
||||
box-shadow:
|
||||
0 -0.0625em 0.0625em hsl(var(--off-hue), 90%, 40%) inset,
|
||||
0 0 0.125em hsla(var(--off-hue), 90%, 70%, 30%),
|
||||
0 0 0.125em hsla(var(--off-hue), 90%, 70%, 30%),
|
||||
0.125em 0.125em 0.125em hsla(0deg, 0%, 0%, 50%);
|
||||
|
||||
transition:
|
||||
background-color var(--trans-dur) var(--trans-timing),
|
||||
box-shadow var(--trans-dur) var(--trans-timing);
|
||||
}
|
||||
|
||||
.switch__text {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.switch__input:checked ~ .switch__led {
|
||||
background-color: hsl(var(--on-hue1), 90%, 70%);
|
||||
box-shadow:
|
||||
0 -0.0625em 0.0625em hsl(var(--on-hue1), 90%, 40%) inset,
|
||||
0 -0.125em 0.125em hsla(var(--on-hue1), 90%, 70%, 30%),
|
||||
0 0.125em 0.125em hsla(var(--on-hue1), 90%, 70%, 30%),
|
||||
0.125em 0.125em 0.125em hsla(0deg, 0%, 0%, 50%);
|
||||
}
|
||||
|
||||
.switch__input:checked ~ .switch__base-neon path {
|
||||
stroke-dasharray: 52.13 0 52.13;
|
||||
}
|
||||
|
||||
.switch__input:checked ~ .switch__knob-shadow,
|
||||
.switch__input:checked ~ .switch__knob-container .switch__knob {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
|
||||
.switch__input:checked ~ .switch__knob-container .switch__knob-neon circle {
|
||||
opacity: 1;
|
||||
stroke-dasharray: 45.16 0 45.16 54.19;
|
||||
transition-timing-function: steps(1, start), var(--trans-timing);
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
import { memo } from 'react';
|
||||
|
||||
import './index.css';
|
||||
|
||||
interface SyncSwitchProps {
|
||||
onChange?: (checked: boolean) => void;
|
||||
value?: boolean;
|
||||
}
|
||||
const SyncSwitch = memo<SyncSwitchProps>(({ value, onChange }) => {
|
||||
return (
|
||||
<div className={'wrapper'}>
|
||||
<label className="switch">
|
||||
<input
|
||||
checked={value}
|
||||
className="switch__input"
|
||||
onChange={(e) => {
|
||||
onChange?.(e.target.checked);
|
||||
}}
|
||||
role="switch"
|
||||
type="checkbox"
|
||||
/>
|
||||
<span className="switch__base-outer" />
|
||||
<span className="switch__base-inner" />
|
||||
<svg className="switch__base-neon" height="24px" viewBox="0 0 40 24" width="40px">
|
||||
<defs>
|
||||
<filter id="switch-glow">
|
||||
<feGaussianBlur result="coloredBlur" stdDeviation="1" />
|
||||
<feMerge>
|
||||
<feMergeNode in="coloredBlur" />
|
||||
<feMergeNode in="SourceGraphic" />
|
||||
</feMerge>
|
||||
</filter>
|
||||
<linearGradient id="switch-gradient1" x1="0" x2="1" y1="0" y2="0">
|
||||
<stop offset="0%" stopColor="hsl(var(--on-hue1),90%,70%)" />
|
||||
<stop offset="100%" stopColor="hsl(var(--on-hue2),90%,70%)" />
|
||||
</linearGradient>
|
||||
<linearGradient id="switch-gradient2" x1="0.7" x2="0.3" y1="0" y2="1">
|
||||
<stop offset="25%" stopColor="hsla(var(--on-hue1),90%,70%,0)" />
|
||||
<stop offset="50%" stopColor="hsla(var(--on-hue1),90%,70%,0.3)" />
|
||||
<stop offset="100%" stopColor="hsla(var(--on-hue2),90%,70%,0.3)" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path
|
||||
d="m.5,12C.5,5.649,5.649.5,12,.5h16c6.351,0,11.5,5.149,11.5,11.5s-5.149,11.5-11.5,11.5H12C5.649,23.5.5,18.351.5,12Z"
|
||||
fill="none"
|
||||
filter="url(#switch-glow)"
|
||||
stroke="url(#switch-gradient1)"
|
||||
strokeDasharray="0 104.26 0"
|
||||
strokeDashoffset="0.01"
|
||||
strokeLinecap="round"
|
||||
strokeWidth="1"
|
||||
/>
|
||||
</svg>
|
||||
<span className="switch__knob-shadow" />
|
||||
<span className="switch__knob-container">
|
||||
<span className="switch__knob">
|
||||
<svg className="switch__knob-neon" height="48px" viewBox="0 0 48 48" width="48px">
|
||||
<circle
|
||||
cx="24"
|
||||
cy="24"
|
||||
fill="none"
|
||||
r="23"
|
||||
stroke="url(#switch-gradient2)"
|
||||
strokeDasharray="0 90.32 0 54.19"
|
||||
strokeLinecap="round"
|
||||
strokeWidth="1"
|
||||
transform="rotate(-112.5,24,24)"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
<span className="switch__led" />
|
||||
<span className="switch__text">Power</span>
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
export default SyncSwitch;
|
||||
@@ -1,4 +0,0 @@
|
||||
export const generateRandomRoomName = async () => {
|
||||
const { generate } = await import('random-words');
|
||||
return (generate(3) as string[]).join('-');
|
||||
};
|
||||
@@ -1,103 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { SiWebrtc } from '@icons-pack/react-simple-icons';
|
||||
import { Form, type FormGroupItemType, Input, InputPassword, Text, Tooltip } from '@lobehub/ui';
|
||||
import { Form as AntForm, Switch } from 'antd';
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import { useSyncSettings } from '@/app/[variants]/(main)/settings/hooks/useSyncSettings';
|
||||
import { FORM_STYLE } from '@/const/layoutTokens';
|
||||
import SyncStatusInspector from '@/features/SyncStatusInspector';
|
||||
import { useUserStore } from '@/store/user';
|
||||
|
||||
import ChannelNameInput from './ChannelNameInput';
|
||||
|
||||
const WebRTC = memo(() => {
|
||||
const { t } = useTranslation('setting');
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const [setSettings] = useUserStore((s) => [s.setSettings]);
|
||||
|
||||
useSyncSettings(form);
|
||||
|
||||
const channelName = AntForm.useWatch(['sync', 'webrtc', 'channelName'], form);
|
||||
const signaling = AntForm.useWatch(['sync', 'webrtc', 'signaling'], form);
|
||||
|
||||
const config: FormGroupItemType = {
|
||||
children: [
|
||||
{
|
||||
children: <Input placeholder={t('sync.webrtc.signaling.placeholder')} />,
|
||||
desc: t('sync.webrtc.signaling.desc'),
|
||||
label: t('sync.webrtc.signaling.title'),
|
||||
name: ['sync', 'webrtc', 'signaling'],
|
||||
},
|
||||
{
|
||||
children: <ChannelNameInput form={form} />,
|
||||
desc: t('sync.webrtc.channelName.desc'),
|
||||
label: t('sync.webrtc.channelName.title'),
|
||||
name: ['sync', 'webrtc', 'channelName'],
|
||||
},
|
||||
{
|
||||
children: (
|
||||
<InputPassword
|
||||
autoComplete={'nw-password'}
|
||||
placeholder={t('sync.webrtc.channelPassword.placeholder')}
|
||||
/>
|
||||
),
|
||||
desc: t('sync.webrtc.channelPassword.desc'),
|
||||
label: t('sync.webrtc.channelPassword.title'),
|
||||
name: ['sync', 'webrtc', 'channelPassword'],
|
||||
},
|
||||
{
|
||||
children:
|
||||
!channelName || !signaling ? (
|
||||
<Tooltip title={t('sync.webrtc.enabled.invalid')}>
|
||||
<Switch disabled />
|
||||
</Tooltip>
|
||||
) : (
|
||||
<Switch />
|
||||
),
|
||||
|
||||
label: t('sync.webrtc.enabled.title'),
|
||||
minWidth: undefined,
|
||||
name: ['sync', 'webrtc', 'enabled'],
|
||||
},
|
||||
],
|
||||
extra: (
|
||||
<div
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
>
|
||||
<SyncStatusInspector hiddenActions hiddenEnableGuide />
|
||||
</div>
|
||||
),
|
||||
title: (
|
||||
<Flexbox align={'center'} gap={12} horizontal wrap={'wrap'}>
|
||||
<Flexbox align={'center'} gap={8} horizontal>
|
||||
<SiWebrtc style={{ flex: 'none' }} />
|
||||
{t('sync.webrtc.title')}
|
||||
</Flexbox>
|
||||
<Text style={{ fontWeight: 'normal' }} type={'secondary'}>
|
||||
{t('sync.webrtc.desc')}
|
||||
</Text>
|
||||
</Flexbox>
|
||||
),
|
||||
};
|
||||
|
||||
return (
|
||||
<Form
|
||||
form={form}
|
||||
items={[config]}
|
||||
itemsType={'group'}
|
||||
onFinish={setSettings}
|
||||
onValuesChange={setSettings}
|
||||
variant={'borderless'}
|
||||
{...FORM_STYLE}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
export default WebRTC;
|
||||
@@ -1,17 +0,0 @@
|
||||
import Alert from './features/Alert';
|
||||
import DeviceInfo from './features/DeviceInfo';
|
||||
import WebRTC from './features/WebRTC';
|
||||
|
||||
const Page = ({ browser, os, mobile }: { browser?: string; mobile?: boolean; os?: string }) => {
|
||||
return (
|
||||
<>
|
||||
<DeviceInfo browser={browser} os={os} />
|
||||
<WebRTC />
|
||||
<Alert mobile={mobile} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Page.displayName = 'SyncSetting';
|
||||
|
||||
export default Page;
|
||||
@@ -1,29 +0,0 @@
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
import { serverFeatureFlags } from '@/config/featureFlags';
|
||||
import { metadataModule } from '@/server/metadata';
|
||||
import { translation } from '@/server/translation';
|
||||
import { DynamicLayoutProps } from '@/types/next';
|
||||
import { gerServerDeviceInfo } from '@/utils/server/responsive';
|
||||
import { RouteVariants } from '@/utils/server/routeVariants';
|
||||
|
||||
import Page from './index';
|
||||
|
||||
export const generateMetadata = async (props: DynamicLayoutProps) => {
|
||||
const locale = await RouteVariants.getLocale(props);
|
||||
const { t } = await translation('setting', locale);
|
||||
return metadataModule.generate({
|
||||
description: t('header.desc'),
|
||||
title: t('tab.sync'),
|
||||
url: '/settings/sync',
|
||||
});
|
||||
};
|
||||
export default async (props: DynamicLayoutProps) => {
|
||||
const enableWebrtc = serverFeatureFlags().enableWebrtc;
|
||||
if (!enableWebrtc) return notFound();
|
||||
|
||||
const isMobile = await RouteVariants.getIsMobile(props);
|
||||
const { os, browser } = await gerServerDeviceInfo();
|
||||
|
||||
return <Page browser={browser} mobile={isMobile} os={os} />;
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
// @ts-nocheck
|
||||
import { ModelProvider } from '@lobechat/model-runtime';
|
||||
import { Aws } from '@lobehub/icons';
|
||||
import { Button, Icon, InputPassword, Select } from '@lobehub/ui';
|
||||
@@ -15,6 +16,7 @@ const BedrockForm = memo<{ description: string }>(({ description }) => {
|
||||
const [showRegion, setShow] = useState(false);
|
||||
const [showSessionToken, setShowSessionToken] = useState(false);
|
||||
|
||||
// TODO: need ai provider config
|
||||
const [accessKeyId, secretAccessKey, sessionToken, region, setConfig] = useUserStore((s) => [
|
||||
keyVaultsConfigSelectors.bedrockConfig(s).accessKeyId,
|
||||
keyVaultsConfigSelectors.bedrockConfig(s).secretAccessKey,
|
||||
|
||||
@@ -2,22 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref https://docs.ai21.com/reference/jamba-15-api-ref
|
||||
const Ai21: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 256_000,
|
||||
displayName: 'Jamba 1.5 Mini',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'jamba-1.5-mini',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 256_000,
|
||||
displayName: 'Jamba 1.5 Large',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'jamba-1.5-large',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'jamba-mini',
|
||||
description: 'AI21 Labs 为企业构建基础模型和人工智能系统,加速生成性人工智能在生产中的应用。',
|
||||
id: 'ai21',
|
||||
|
||||
@@ -2,38 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://ai.360.cn/platform/docs/overview
|
||||
const Ai360: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description:
|
||||
'360gpt2-o1 使用树搜索构建思维链,并引入了反思机制,使用强化学习训练,模型具备自我反思与纠错的能力。',
|
||||
displayName: '360GPT2 o1',
|
||||
enabled: true,
|
||||
id: '360gpt2-o1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description: '360智脑系列效果最好的主力千亿级大模型,广泛适用于各领域复杂任务场景。',
|
||||
displayName: '360GPT2 Pro',
|
||||
enabled: true,
|
||||
id: '360gpt2-pro',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description: '360智脑系列效果最好的主力千亿级大模型,广泛适用于各领域复杂任务场景。',
|
||||
displayName: '360GPT Pro',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: '360gpt-pro',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 7000,
|
||||
description: '兼顾性能和效果的百亿级大模型,适合对性能/成本要求较高 的场景。',
|
||||
displayName: '360GPT Turbo',
|
||||
enabled: true,
|
||||
id: '360gpt-turbo',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: '360gpt-turbo',
|
||||
description:
|
||||
'360 AI 是 360 公司推出的 AI 模型和服务平台,提供多种先进的自然语言处理模型,包括 360GPT2 Pro、360GPT Pro、360GPT Turbo 和 360GPT Turbo Responsibility 8K。这些模型结合了大规模参数和多模态能力,广泛应用于文本生成、语义理解、对话系统与代码生成等领域。通过灵活的定价策略,360 AI 满足多样化用户需求,支持开发者集成,推动智能化应用的革新和发展。',
|
||||
|
||||
@@ -2,129 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://docs.anthropic.com/en/docs/about-claude/models#model-names
|
||||
const Anthropic: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 4 Opus 是 Anthropic 最强大的下一代模型,具有卓越的推理能力和创造力,适用于最复杂的任务和高级分析。',
|
||||
displayName: 'Claude 4 Opus',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'claude-opus-4-20250514',
|
||||
maxOutput: 32_000,
|
||||
releasedAt: '2025-05-14',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 4 Sonnet 提供了优异的性能和速度平衡,是新一代模型中的理想选择,适用于广泛的企业和创意任务。',
|
||||
displayName: 'Claude 4 Sonnet',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'claude-sonnet-4-20250514',
|
||||
maxOutput: 64_000,
|
||||
releasedAt: '2025-05-14',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.7 sonnet 是 Anthropic 最快的下一代模型。与 Claude 3 Haiku 相比,Claude 3.7 Sonnet 在各项技能上都有所提升,并在许多智力基准测试中超越了上一代最大的模型 Claude 3 Opus。',
|
||||
displayName: 'Claude 3.7 Sonnet',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'claude-3-7-sonnet-20250219',
|
||||
maxOutput: 64_000,
|
||||
releasedAt: '2025-02-24',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.5 Haiku 是 Anthropic 最快的下一代模型。与 Claude 3 Haiku 相比,Claude 3.5 Haiku 在各项技能上都有所提升,并在许多智力基准测试中超越了上一代最大的模型 Claude 3 Opus。',
|
||||
displayName: 'Claude 3.5 Haiku',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'claude-3-5-haiku-20241022',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2024-11-05',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.5 Sonnet 提供了超越 Opus 的能力和比 Sonnet 更快的速度,同时保持与 Sonnet 相同的价格。Sonnet 特别擅长编程、数据科学、视觉处理、代理任务。',
|
||||
displayName: 'Claude 3.5 Sonnet',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'claude-3-5-sonnet-20241022',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2024-10-22',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.5 Sonnet 提供了超越 Opus 的能力和比 Sonnet 更快的速度,同时保持与 Sonnet 相同的价格。Sonnet 特别擅长编程、数据科学、视觉处理、代理任务。',
|
||||
displayName: 'Claude 3.5 Sonnet 0620',
|
||||
functionCall: true,
|
||||
id: 'claude-3-5-sonnet-20240620',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2024-06-20',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3 Haiku 是 Anthropic 的最快且最紧凑的模型,旨在实现近乎即时的响应。它具有快速且准确的定向性能。',
|
||||
displayName: 'Claude 3 Haiku',
|
||||
functionCall: true,
|
||||
id: 'claude-3-haiku-20240307',
|
||||
maxOutput: 4096,
|
||||
releasedAt: '2024-03-07',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3 Sonnet 在智能和速度方面为企业工作负载提供了理想的平衡。它以更低的价格提供最大效用,可靠且适合大规模部署。',
|
||||
displayName: 'Claude 3 Sonnet',
|
||||
functionCall: true,
|
||||
id: 'claude-3-sonnet-20240229',
|
||||
maxOutput: 4096,
|
||||
releasedAt: '2024-02-29',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3 Opus 是 Anthropic 用于处理高度复杂任务的最强大模型。它在性能、智能、流畅性和理解力方面表现卓越。',
|
||||
displayName: 'Claude 3 Opus',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'claude-3-opus-20240229',
|
||||
maxOutput: 4096,
|
||||
releasedAt: '2024-02-29',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 2 为企业提供了关键能力的进步,包括业界领先的 200K token 上下文、大幅降低模型幻觉的发生率、系统提示以及一个新的测试功能:工具调用。',
|
||||
displayName: 'Claude 2.1',
|
||||
id: 'claude-2.1',
|
||||
maxOutput: 4096,
|
||||
releasedAt: '2023-11-21',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 100_000,
|
||||
description:
|
||||
'Claude 2 为企业提供了关键能力的进步,包括业界领先的 200K token 上下文、大幅降低模型幻觉的发生率、系统提示以及一个新的测试功能:工具调用。',
|
||||
displayName: 'Claude 2.0',
|
||||
id: 'claude-2.0',
|
||||
maxOutput: 4096,
|
||||
releasedAt: '2023-07-11',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'claude-3-haiku-20240307',
|
||||
description:
|
||||
'Anthropic 是一家专注于人工智能研究和开发的公司,提供了一系列先进的语言模型,如 Claude 3.5 Sonnet、Claude 3 Sonnet、Claude 3 Opus 和 Claude 3 Haiku。这些模型在智能、速度和成本之间取得了理想的平衡,适用于从企业级工作负载到快速响应的各种应用场景。Claude 3.5 Sonnet 作为其最新模型,在多项评估中表现优异,同时保持了较高的性价比。',
|
||||
|
||||
@@ -2,57 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://learn.microsoft.com/azure/ai-services/openai/concepts/models
|
||||
const Azure: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 16_385,
|
||||
deploymentName: 'gpt-35-turbo',
|
||||
description:
|
||||
'GPT 3.5 Turbo,OpenAI提供的高效模型,适用于聊天和文本生成任务,支持并行函数调用。',
|
||||
displayName: 'GPT 3.5 Turbo',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gpt-35-turbo',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
deploymentName: 'gpt-35-turbo-16k',
|
||||
description: 'GPT 3.5 Turbo 16k,高容量文本生成模型,适合复杂任务。',
|
||||
displayName: 'GPT 3.5 Turbo',
|
||||
functionCall: true,
|
||||
id: 'gpt-35-turbo-16k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
deploymentName: 'gpt-4-turbo',
|
||||
description: 'GPT 4 Turbo,多模态模型,提供杰出的语言理解和生成能力,同时支持图像输入。',
|
||||
displayName: 'GPT 4 Turbo',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gpt-4',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
deploymentName: 'gpt-4o-mini',
|
||||
description: 'GPT-4o Mini,小型高效模型,具备与GPT-4o相似的卓越性能。',
|
||||
displayName: 'GPT 4o Mini',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gpt-4o-mini',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
deploymentName: 'gpt-4o',
|
||||
description: 'GPT-4o 是最新的多模态模型,结合高级文本和图像处理能力。',
|
||||
displayName: 'GPT 4o',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gpt-4o',
|
||||
vision: true,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
defaultShowBrowserRequest: true,
|
||||
description:
|
||||
'Azure 提供多种先进的AI模型,包括GPT-3.5和最新的GPT-4系列,支持多种数据类型和复杂任务,致力于安全、可靠和可持续的AI解决方案。',
|
||||
|
||||
@@ -2,63 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://platform.baichuan-ai.com/price
|
||||
const Baichuan: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'模型能力国内第一,在知识百科、长文本、生成创作等中文任务上超越国外主流模型。还具备行业领先的多模态能力,多项权威评测基准表现优异。',
|
||||
displayName: 'Baichuan 4',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'Baichuan4',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'模型能力国内第一,在知识百科、长文本、生成创作等中文任务上超越国外主流模型。还具备行业领先的多模态能力,多项权威评测基准表现优异。',
|
||||
displayName: 'Baichuan 4 Turbo',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'Baichuan4-Turbo',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'模型能力国内第一,在知识百科、长文本、生成创作等中文任务上超越国外主流模型。还具备行业领先的多模态能力,多项权威评测基准表现优异。',
|
||||
displayName: 'Baichuan 4 Air',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'Baichuan4-Air',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'针对企业高频场景优化,效果大幅提升,高性价比。相对于Baichuan2模型,内容创作提升20%,知识问答提升17%, 角色扮演能力提升40%。整体效果比GPT3.5更优。',
|
||||
displayName: 'Baichuan 3 Turbo',
|
||||
functionCall: true,
|
||||
id: 'Baichuan3-Turbo',
|
||||
maxOutput: 8192,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'具备 128K 超长上下文窗口,针对企业高频场景优化,效果大幅提升,高性价比。相对于Baichuan2模型,内容创作提升20%,知识问答提升17%, 角色扮演能力提升40%。整体效果比GPT3.5更优。',
|
||||
displayName: 'Baichuan 3 Turbo 128k',
|
||||
id: 'Baichuan3-Turbo-128k',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'采用搜索增强技术实现大模型与领域知识、全网知识的全面链接。支持PDF、Word等多种文档上传及网址输入,信息获取及时、全面,输出结果准确、专业。',
|
||||
displayName: 'Baichuan 2 Turbo',
|
||||
id: 'Baichuan2-Turbo',
|
||||
maxOutput: 8192,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'Baichuan3-Turbo',
|
||||
description:
|
||||
'百川智能是一家专注于人工智能大模型研发的公司,其模型在国内知识百科、长文本处理和生成创作等中文任务上表现卓越,超越了国外主流模型。百川智能还具备行业领先的多模态能力,在多项权威评测中表现优异。其模型包括 Baichuan 4、Baichuan 3 Turbo 和 Baichuan 3 Turbo 128k 等,分别针对不同应用场景进行优化,提供高性价比的解决方案。',
|
||||
|
||||
@@ -4,282 +4,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
// ref :https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/models
|
||||
// ref :https://us-west-2.console.aws.amazon.com/bedrock/home?region=us-west-2#/models
|
||||
const Bedrock: ModelProviderCard = {
|
||||
chatModels: [
|
||||
/*
|
||||
// TODO: Not support for now
|
||||
{
|
||||
description: '亚马逊 Titan Text Lite 是一款轻量级高效模型,非常适合对英语任务进行微调,包括总结和文案编写等,客户希望有一个更小、更经济的模型,同时也非常可定制。',
|
||||
displayName: 'Titan Text G1 - Lite',
|
||||
id: 'amazon.titan-text-lite-v1',
|
||||
tokens: 4000,
|
||||
},
|
||||
{
|
||||
description: '亚马逊 Titan Text Express 的上下文长度可达 8,000 个标记,非常适合广泛的高级通用语言任务,如开放式文本生成和对话聊天,以及在检索增强生成 (RAG) 中的支持。在推出时,该模型针对英语进行了优化,预览版还支持其他 100 多种语言。',
|
||||
displayName: 'Titan Text G1 - Express',
|
||||
id: 'amazon.titan-text-express-v1',
|
||||
tokens: 8000,
|
||||
},
|
||||
{
|
||||
description: 'Titan Text Premier 是 Titan Text 系列中一款强大的先进模型,旨在为广泛的企业应用提供卓越的性能。凭借其尖端能力,它提供了更高的准确性和卓越的结果,是寻求一流文本处理解决方案的组织的绝佳选择。',
|
||||
displayName: 'Titan Text G1 - Premier',
|
||||
id: 'amazon.titan-text-premier-v1:0',
|
||||
tokens: 32_000,
|
||||
},
|
||||
*/
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.7 sonnet 是 Anthropic 最快的下一代模型。与 Claude 3 Haiku 相比,Claude 3.7 Sonnet 在各项技能上都有所提升,并在许多智力基准测试中超越了上一代最大的模型 Claude 3 Opus。',
|
||||
displayName: 'Claude 3.7 Sonnet',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'us.anthropic.claude-3-7-sonnet-20250219-v1:0',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2025-02-24',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.7 sonnet Extended thinking 是 Anthropic 最快的下一代模型。与 Claude 3 Haiku 相比,Claude 3.7 Sonnet 在各项技能上都有所提升,并在许多智力基准测试中超越了上一代最大的模型 Claude 3 Opus。',
|
||||
displayName: 'Claude 3.7 Sonnet Extended thinking',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'us.anthropic.claude-3-7-sonnet-20250219-v1:0',
|
||||
maxOutput: 64_000,
|
||||
releasedAt: '2025-02-24',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.5 Haiku 是 Anthropic 最快的下一代模型。与 Claude 3 Haiku 相比,Claude 3.5 Haiku 在各项技能上都有所提升,并在许多智力基准测试中超越了上一代最大的模型 Claude 3 Opus。',
|
||||
displayName: 'Claude 3.5 Haiku',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'anthropic.claude-3-5-haiku-20241022-v1:0',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2024-11-05',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.5 Sonnet 提升了行业标准,性能超过竞争对手模型和 Claude 3 Opus,在广泛的评估中表现出色,同时具有我们中等层级模型的速度和成本。',
|
||||
displayName: 'Claude 3.5 Sonnet',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'anthropic.claude-3-5-sonnet-20241022-v2:0',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.5 Sonnet 提升了行业标准,性能超过竞争对手模型和 Claude 3 Opus,在广泛的评估中表现出色,同时具有我们中等层级模型的速度和成本。',
|
||||
displayName: 'Claude 3.5 Sonnet v2 (Inference profile)',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'us.anthropic.claude-3-5-sonnet-20241022-v2:0',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.5 Sonnet 提升了行业标准,性能超过竞争对手模型和 Claude 3 Opus,在广泛的评估中表现出色,同时具有我们中等层级模型的速度和成本。',
|
||||
displayName: 'Claude 3.5 Sonnet 0620',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'anthropic.claude-3-5-sonnet-20240620-v1:0',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3 Haiku 是 Anthropic 最快、最紧凑的模型,提供近乎即时的响应速度。它可以快速回答简单的查询和请求。客户将能够构建模仿人类互动的无缝 AI 体验。Claude 3 Haiku 可以处理图像并返回文本输出,具有 200K 的上下文窗口。',
|
||||
displayName: 'Claude 3 Haiku',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'anthropic.claude-3-haiku-20240307-v1:0',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Anthropic 的 Claude 3 Sonnet 在智能和速度之间达到了理想的平衡——特别适合企业工作负载。它以低于竞争对手的价格提供最大的效用,并被设计成为可靠的、高耐用的主力机,适用于规模化的 AI 部署。Claude 3 Sonnet 可以处理图像并返回文本输出,具有 200K 的上下文窗口。',
|
||||
displayName: 'Claude 3 Sonnet',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'anthropic.claude-3-sonnet-20240229-v1:0',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3 Opus 是 Anthropic 最强大的 AI 模型,具有在高度复杂任务上的最先进性能。它可以处理开放式提示和未见过的场景,具有出色的流畅性和类人的理解能力。Claude 3 Opus 展示了生成 AI 可能性的前沿。Claude 3 Opus 可以处理图像并返回文本输出,具有 200K 的上下文窗口。',
|
||||
displayName: 'Claude 3 Opus',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'anthropic.claude-3-opus-20240229-v1:0',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 2 的更新版,具有双倍的上下文窗口,以及在长文档和 RAG 上下文中的可靠性、幻觉率和基于证据的准确性的改进。',
|
||||
displayName: 'Claude 2.1',
|
||||
id: 'anthropic.claude-v2:1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 100_000,
|
||||
description:
|
||||
'Anthropic 在从复杂对话和创意内容生成到详细指令跟随的广泛任务中都表现出高度能力的模型。',
|
||||
displayName: 'Claude 2.0',
|
||||
id: 'anthropic.claude-v2',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 100_000,
|
||||
description:
|
||||
'一款快速、经济且仍然非常有能力的模型,可以处理包括日常对话、文本分析、总结和文档问答在内的一系列任务。',
|
||||
displayName: 'Claude Instant',
|
||||
id: 'anthropic.claude-instant-v1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Meta Llama 3.1 8B Instruct 的更新版,包括扩展的 128K 上下文长度、多语言性和改进的推理能力。Llama 3.1 提供的多语言大型语言模型 (LLMs) 是一组预训练的、指令调整的生成模型,包括 8B、70B 和 405B 大小 (文本输入/输出)。Llama 3.1 指令调整的文本模型 (8B、70B、405B) 专为多语言对话用例进行了优化,并在常见的行业基准测试中超过了许多可用的开源聊天模型。Llama 3.1 旨在用于多种语言的商业和研究用途。指令调整的文本模型适用于类似助手的聊天,而预训练模型可以适应各种自然语言生成任务。Llama 3.1 模型还支持利用其模型的输出来改进其他模型,包括合成数据生成和精炼。Llama 3.1 是使用优化的变压器架构的自回归语言模型。调整版本使用监督微调 (SFT) 和带有人类反馈的强化学习 (RLHF) 来符合人类对帮助性和安全性的偏好。',
|
||||
displayName: 'Llama 3.1 8B Instruct',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'meta.llama3-1-8b-instruct-v1:0',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Meta Llama 3.1 70B Instruct 的更新版,包括扩展的 128K 上下文长度、多语言性和改进的推理能力。Llama 3.1 提供的多语言大型语言模型 (LLMs) 是一组预训练的、指令调整的生成模型,包括 8B、70B 和 405B 大小 (文本输入/输出)。Llama 3.1 指令调整的文本模型 (8B、70B、405B) 专为多语言对话用例进行了优化,并在常见的行业基准测试中超过了许多可用的开源聊天模型。Llama 3.1 旨在用于多种语言的商业和研究用途。指令调整的文本模型适用于类似助手的聊天,而预训练模型可以适应各种自然语言生成任务。Llama 3.1 模型还支持利用其模型的输出来改进其他模型,包括合成数据生成和精炼。Llama 3.1 是使用优化的变压器架构的自回归语言模型。调整版本使用监督微调 (SFT) 和带有人类反馈的强化学习 (RLHF) 来符合人类对帮助性和安全性的偏好。',
|
||||
displayName: 'Llama 3.1 70B Instruct',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'meta.llama3-1-70b-instruct-v1:0',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Meta Llama 3.1 405B Instruct 是 Llama 3.1 Instruct 模型中最大、最强大的模型,是一款高度先进的对话推理和合成数据生成模型,也可以用作在特定领域进行专业持续预训练或微调的基础。Llama 3.1 提供的多语言大型语言模型 (LLMs) 是一组预训练的、指令调整的生成模型,包括 8B、70B 和 405B 大小 (文本输入/输出)。Llama 3.1 指令调整的文本模型 (8B、70B、405B) 专为多语言对话用例进行了优化,并在常见的行业基准测试中超过了许多可用的开源聊天模型。Llama 3.1 旨在用于多种语言的商业和研究用途。指令调整的文本模型适用于类似助手的聊天,而预训练模型可以适应各种自然语言生成任务。Llama 3.1 模型还支持利用其模型的输出来改进其他模型,包括合成数据生成和精炼。Llama 3.1 是使用优化的变压器架构的自回归语言模型。调整版本使用监督微调 (SFT) 和带有人类反馈的强化学习 (RLHF) 来符合人类对帮助性和安全性的偏好。',
|
||||
displayName: 'Llama 3.1 405B Instruct',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'meta.llama3-1-405b-instruct-v1:0',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description:
|
||||
'Meta Llama 3 是一款面向开发者、研究人员和企业的开放大型语言模型 (LLM),旨在帮助他们构建、实验并负责任地扩展他们的生成 AI 想法。作为全球社区创新的基础系统的一部分,它非常适合计算能力和资源有限、边缘设备和更快的训练时间。',
|
||||
displayName: 'Llama 3 8B Instruct',
|
||||
id: 'meta.llama3-8b-instruct-v1:0',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description:
|
||||
'Meta Llama 3 是一款面向开发者、研究人员和企业的开放大型语言模型 (LLM),旨在帮助他们构建、实验并负责任地扩展他们的生成 AI 想法。作为全球社区创新的基础系统的一部分,它非常适合内容创建、对话 AI、语言理解、研发和企业应用。',
|
||||
displayName: 'Llama 3 70B Instruct',
|
||||
id: 'meta.llama3-70b-instruct-v1:0',
|
||||
},
|
||||
/*
|
||||
// TODO: Not support for now
|
||||
{
|
||||
description: 'A 7B dense Transformer, fast-deployed and easily customisable. Small, yet powerful for a variety of use cases. Supports English and code, and a 32k context window.',
|
||||
displayName: 'Mistral 7B Instruct',
|
||||
enabled: true,
|
||||
id: 'mistral.mistral-7b-instruct-v0:2',
|
||||
tokens: 32_000,
|
||||
},
|
||||
{
|
||||
description: 'A 7B sparse Mixture-of-Experts model with stronger capabilities than Mistral 7B. Uses 12B active parameters out of 45B total. Supports multiple languages, code and 32k context window.',
|
||||
displayName: 'Mixtral 8X7B Instruct',
|
||||
enabled: true,
|
||||
id: 'mistral.mixtral-8x7b-instruct-v0:1',
|
||||
tokens: 32_000,
|
||||
},
|
||||
{
|
||||
description: 'Mistral Small is perfectly suited for straightforward tasks that can be performed in bulk, such as classification, customer support, or text generation. It provides outstanding performance at a cost-effective price point.',
|
||||
displayName: 'Mistral Small',
|
||||
functionCall: true,
|
||||
id: 'mistral.mistral-small-2402-v1:0',
|
||||
tokens: 32_000,
|
||||
},
|
||||
{
|
||||
description: 'Mistral Large 2407 is an advanced Large Language Model (LLM) that supports dozens of languages and is trained on 80+ coding languages. It has best-in-class agentic capabilities with native function calling JSON outputting and reasoning capabilities.',
|
||||
displayName: 'Mistral Large 2 (24.07)',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'mistral.mistral-large-2407-v1:0',
|
||||
tokens: 128_000,
|
||||
},
|
||||
{
|
||||
description: 'The most advanced Mistral AI Large Language model capable of handling any language task including complex multilingual reasoning, text understanding, transformation, and code generation.',
|
||||
displayName: 'Mistral Large',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'mistral.mistral-large-2402-v1:0',
|
||||
tokens: 32_000,
|
||||
},
|
||||
*/
|
||||
/*
|
||||
// TODO: Not support for now
|
||||
{
|
||||
description: 'Command R+ is a highly performant generative language model optimized for large scale production workloads.',
|
||||
displayName: 'Command R+',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'cohere.command-r-plus-v1:0',
|
||||
tokens: 128_000,
|
||||
},
|
||||
{
|
||||
description: 'Command R is a generative language model optimized for long-context tasks and large scale production workloads.',
|
||||
displayName: 'Command R',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'cohere.command-r-v1:0',
|
||||
tokens: 128_000,
|
||||
},
|
||||
*/
|
||||
/*
|
||||
// Cohere Command (Text) and AI21 Labs Jurassic-2 (Text) don't support chat with the Converse API
|
||||
{
|
||||
description: 'Command is Cohere flagship text generation model. It is trained to follow user commands and to be instantly useful in practical business applications.',
|
||||
displayName: 'Command',
|
||||
id: 'cohere.command-text-v14',
|
||||
tokens: 4000,
|
||||
},
|
||||
{
|
||||
description: 'Cohere Command-Light is a generative model that responds well with instruction-like prompts. This model provides customers with an unbeatable balance of quality, cost-effectiveness, and low-latency inference.',
|
||||
displayName: 'Command Light',
|
||||
id: 'cohere.command-light-text-v14',
|
||||
tokens: 4000,
|
||||
},
|
||||
*/
|
||||
/*
|
||||
// TODO: Not support for now
|
||||
{
|
||||
description: 'The latest Foundation Model from AI21 Labs, Jamba-Instruct offers an impressive 256K context window and delivers the best value per price on core text generation, summarization, and question answering tasks for the enterprise.',
|
||||
displayName: 'Jamba-Instruct',
|
||||
id: 'ai21.jamba-instruct-v1:0',
|
||||
tokens: 256_000,
|
||||
},
|
||||
*/
|
||||
/*
|
||||
// Cohere Command (Text) and AI21 Labs Jurassic-2 (Text) don't support chat with the Converse API
|
||||
{
|
||||
description: 'Jurassic-2 Mid is less powerful than Ultra, yet carefully designed to strike the right balance between exceptional quality and affordability. Jurassic-2 Mid can be applied to any language comprehension or generation task including question answering, summarization, long-form copy generation, advanced information extraction and many others.',
|
||||
displayName: 'Jurassic-2 Mid',
|
||||
id: 'ai21.j2-mid-v1',
|
||||
tokens: 8191,
|
||||
},
|
||||
{
|
||||
description: 'Jurassic-2 Ultra is AI21’s most powerful model for complex tasks that require advanced text generation and comprehension. Popular use cases include question answering, summarization, long-form copy generation, advanced information extraction, and more.',
|
||||
displayName: 'Jurassic-2 Ultra',
|
||||
id: 'ai21.j2-ultra-v1',
|
||||
tokens: 8191,
|
||||
},
|
||||
*/
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'anthropic.claude-instant-v1',
|
||||
description:
|
||||
'Bedrock 是亚马逊 AWS 提供的一项服务,专注于为企业提供先进的 AI 语言模型和视觉模型。其模型家族包括 Anthropic 的 Claude 系列、Meta 的 Llama 3.1 系列等,涵盖从轻量级到高性能的多种选择,支持文本生成、对话、图像处理等多种任务,适用于不同规模和需求的企业应用。',
|
||||
|
||||
@@ -3,70 +3,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
// ref https://developers.cloudflare.com/workers-ai/models/#text-generation
|
||||
// api https://developers.cloudflare.com/workers-ai/configuration/open-ai-compatibility
|
||||
const Cloudflare: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
displayName: 'DeepSeek R1 (Distill Qwen 32B)',
|
||||
enabled: true,
|
||||
id: '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 2048,
|
||||
displayName: 'gemma-7b-it',
|
||||
id: '@hf/google/gemma-7b-it',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
displayName: 'hermes-2-pro-mistral-7b',
|
||||
// functionCall: true,
|
||||
id: '@hf/nousresearch/hermes-2-pro-mistral-7b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
displayName: 'llama 3.3 70b',
|
||||
id: '@cf/meta/llama-3.3-70b-instruct-fp8-fast',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
displayName: 'mistral-7b-instruct-v0.2',
|
||||
id: '@hf/mistral/mistral-7b-instruct-v0.2',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
displayName: 'neural-chat-7b-v3-1-awq',
|
||||
id: '@hf/thebloke/neural-chat-7b-v3-1-awq',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
displayName: 'openchat-3.5-0106',
|
||||
id: '@cf/openchat/openchat-3.5-0106',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
displayName: 'openhermes-2.5-mistral-7b-awq',
|
||||
id: '@hf/thebloke/openhermes-2.5-mistral-7b-awq',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
displayName: 'qwen1.5-14b-chat-awq',
|
||||
enabled: true,
|
||||
id: '@cf/qwen/qwen1.5-14b-chat-awq',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
displayName: 'starling-lm-7b-beta',
|
||||
id: '@hf/nexusflow/starling-lm-7b-beta',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
displayName: 'zephyr-7b-beta-awq',
|
||||
id: '@hf/thebloke/zephyr-7b-beta-awq',
|
||||
},
|
||||
{
|
||||
displayName: 'meta-llama-3-8b-instruct',
|
||||
id: '@hf/meta-llama/meta-llama-3-8b-instruct',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: '@hf/meta-llama/meta-llama-3-8b-instruct',
|
||||
description: '在 Cloudflare 的全球网络上运行由无服务器 GPU 驱动的机器学习模型。',
|
||||
disableBrowserRequest: true,
|
||||
|
||||
@@ -2,27 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://platform.deepseek.com/api-docs/pricing
|
||||
const DeepSeek: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'最新模型 DeepSeek-V3 多项评测成绩超越 Qwen2.5-72B 和 Llama-3.1-405B 等开源模型,性能对齐领军闭源模型 GPT-4o 与 Claude-3.5-Sonnet。',
|
||||
displayName: 'DeepSeek V3',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'deepseek-chat',
|
||||
releasedAt: '2024-12-26',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek 推出的推理模型。在输出最终回答之前,模型会先输出一段思维链内容,以提升最终答案的准确性。',
|
||||
displayName: 'DeepSeek R1',
|
||||
enabled: true,
|
||||
id: 'deepseek-reasoner',
|
||||
releasedAt: '2025-01-20',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'deepseek-chat',
|
||||
description:
|
||||
'DeepSeek 是一家专注于人工智能技术研究和应用的公司,其最新模型 DeepSeek-V3 多项评测成绩超越 Qwen2.5-72B 和 Llama-3.1-405B 等开源模型,性能对齐领军闭源模型 GPT-4o 与 Claude-3.5-Sonnet。',
|
||||
|
||||
@@ -3,180 +3,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
// ref: https://fireworks.ai/models?show=Serverless
|
||||
// ref: https://fireworks.ai/pricing
|
||||
const FireworksAI: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Llama 3.3 70B Instruct 是 Llama 3.1 70B 的 12 月更新版本。该模型在 Llama 3.1 70B(于 2024 年 7 月发布)的基础上进行了改进,增强了工具调用、多语言文本支持、数学和编程能力。该模型在推理、数学和指令遵循方面达到了行业领先水平,并且能够提供与 3.1 405B 相似的性能,同时在速度和成本上具有显著优势。',
|
||||
displayName: 'Llama 3.3 70B Instruct',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/llama-v3p3-70b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Llama 3.2 3B Instruct 是 Meta 推出的轻量级多语言模型。该模型专为高效运行而设计,相较于更大型的模型,具有显著的延迟和成本优势。其典型应用场景包括查询和提示重写,以及写作辅助。',
|
||||
displayName: 'Llama 3.2 3B Instruct',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/llama-v3p2-3b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Meta 推出的指令微调图像推理模型,拥有 110 亿参数。该模型针对视觉识别、图像推理、图片字幕生成以及图片相关的常规问答进行了优化。它能够理解视觉数据,如图表和图形,并通过生成文本描述图像细节,弥合视觉与语言之间的鸿沟。',
|
||||
displayName: 'Llama 3.2 11B Vision Instruct',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/llama-v3p2-11b-vision-instruct',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Meta 推出的指令微调图像推理模型,拥有 900 亿参数。该模型针对视觉识别、图像推理、图片字幕生成以及图片相关的常规问答进行了优化。它能够理解视觉数据,如图表和图形,并通过生成文本描述图像细节,弥合视觉与语言之间的鸿沟。注意:该模型目前作为无服务器模型进行实验性提供。如果用于生产环境,请注意 Fireworks 可能会在短时间内取消部署该模型。',
|
||||
displayName: 'Llama 3.2 90B Vision Instruct',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/llama-v3p2-90b-vision-instruct',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Meta Llama 3.1 系列是多语言大语言模型(LLM)集合,包含 8B、70B 和 405B 三种参数规模的预训练和指令微调生成模型。Llama 3.1 指令微调文本模型(8B、70B、405B)专为多语言对话应用优化,并在常见的行业基准测试中优于许多现有的开源和闭源聊天模型。',
|
||||
displayName: 'Llama 3.1 8B Instruct',
|
||||
id: 'accounts/fireworks/models/llama-v3p1-8b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Meta Llama 3.1 系列是多语言大语言模型(LLM)集合,包含 8B、70B 和 405B 三种参数规模的预训练和指令微调生成模型。Llama 3.1 指令微调文本模型(8B、70B、405B)专为多语言对话应用优化,并在常见的行业基准测试中优于许多现有的开源和闭源聊天模型。',
|
||||
displayName: 'Llama 3.1 70B Instruct',
|
||||
functionCall: true,
|
||||
id: 'accounts/fireworks/models/llama-v3p1-70b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Meta Llama 3.1 系列是多语言大语言模型(LLM)集合,包含 8B、70B 和 405B 参数规模的预训练和指令微调生成模型。Llama 3.1 指令微调文本模型(8B、70B、405B)专为多语言对话场景优化,在常见的行业基准测试中优于许多现有的开源和闭源聊天模型。405B 是 Llama 3.1 家族中能力最强的模型。该模型采用 FP8 进行推理,与参考实现高度匹配。',
|
||||
displayName: 'Llama 3.1 405B Instruct',
|
||||
functionCall: true,
|
||||
id: 'accounts/fireworks/models/llama-v3p1-405b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Meta 开发并发布了 Meta Llama 3 系列大语言模型(LLM),这是一个包含 8B 和 70B 参数规模的预训练和指令微调生成文本模型的集合。Llama 3 指令微调模型专为对话应用场景优化,并在常见的行业基准测试中优于许多现有的开源聊天模型。',
|
||||
displayName: 'Llama 3 8B Instruct',
|
||||
id: 'accounts/fireworks/models/llama-v3-8b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Meta 开发并发布了 Meta Llama 3 系列大语言模型(LLM),该系列包含 8B 和 70B 参数规模的预训练和指令微调生成文本模型。Llama 3 指令微调模型专为对话应用场景优化,并在常见的行业基准测试中优于许多现有的开源聊天模型。',
|
||||
displayName: 'Llama 3 70B Instruct',
|
||||
id: 'accounts/fireworks/models/llama-v3-70b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Meta Llama 3 指令微调模型专为对话应用场景优化,并在常见的行业基准测试中优于许多现有的开源聊天模型。Llama 3 8B Instruct(HF 版本)是 Llama 3 8B Instruct 的原始 FP16 版本,其结果应与官方 Hugging Face 实现一致。',
|
||||
displayName: 'Llama 3 8B Instruct (HF version)',
|
||||
id: 'accounts/fireworks/models/llama-v3-8b-instruct-hf',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: '24B 参数模型,具备与更大型模型相当的最先进能力。',
|
||||
displayName: 'Mistral Small 3 Instruct',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/mistral-small-24b-instruct-2501',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Mixtral MoE 8x7B Instruct 是 Mixtral MoE 8x7B 的指令微调版本,已启用聊天完成功能 API。',
|
||||
displayName: 'Mixtral MoE 8x7B Instruct',
|
||||
id: 'accounts/fireworks/models/mixtral-8x7b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'Mixtral MoE 8x22B Instruct v0.1 是 Mixtral MoE 8x22B v0.1 的指令微调版本,已启用聊天完成功能 API。',
|
||||
displayName: 'Mixtral MoE 8x22B Instruct',
|
||||
functionCall: true,
|
||||
id: 'accounts/fireworks/models/mixtral-8x22b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_064,
|
||||
description:
|
||||
'Phi-3-Vision-128K-Instruct 是一个轻量级的、最先进的开放多模态模型,基于包括合成数据和筛选后的公开网站数据集构建,重点关注文本和视觉方面的高质量、推理密集型数据。该模型属于 Phi-3 模型家族,其多模态版本支持 128K 上下文长度(以标记为单位)。该模型经过严格的增强过程,包括监督微调和直接偏好优化,以确保精确的指令遵循和强大的安全措施。',
|
||||
displayName: 'Phi 3.5 Vision Instruct',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/phi-3-vision-128k-instruct',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'MythoMix 的改进版,可能是其更为完善的变体,是 MythoLogic-L2 和 Huginn 的合并,采用了高度实验性的张量类型合并技术。由于其独特的性质,该模型在讲故事和角色扮演方面表现出色。',
|
||||
displayName: 'MythoMax L2 13b',
|
||||
id: 'accounts/fireworks/models/mythomax-l2-13b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Deepseek 提供的强大 Mixture-of-Experts (MoE) 语言模型,总参数量为 671B,每个标记激活 37B 参数。',
|
||||
displayName: 'Deepseek V3',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/deepseek-v3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 163_840,
|
||||
description:
|
||||
'DeepSeek-R1 是一款最先进的大型语言模型,经过强化学习和冷启动数据的优化,具有出色的推理、数学和编程性能。',
|
||||
displayName: 'Deepseek R1',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/deepseek-r1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen QwQ 模型专注于推动 AI 推理,并展示了开放模型在推理能力上与闭源前沿模型匹敌的力量。QwQ-32B-Preview 是一个实验性发布版本,在 GPQA、AIME、MATH-500 和 LiveCodeBench 基准测试中,在分析和推理能力上可与 o1 相媲美,并超越 GPT-4o 和 Claude 3.5 Sonnet。注意:该模型目前作为无服务器模型进行实验性提供。如果用于生产环境,请注意 Fireworks 可能会在短时间内取消部署该模型。',
|
||||
displayName: 'Qwen Qwq 32b Preview',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/qwen-qwq-32b-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5 是由 Qwen 团队和阿里云开发的一系列仅解码语言模型,提供 0.5B、1.5B、3B、7B、14B、32B 和 72B 不同参数规模,并包含基础版和指令微调版。',
|
||||
displayName: 'Qwen2.5 72B Instruct',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/qwen2p5-72b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Qwen-VL 模型的 72B 版本是阿里巴巴最新迭代的成果,代表了近一年的创新。',
|
||||
displayName: 'Qwen2 VL 72B Instruct',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/qwen2-vl-72b-instruct',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-Coder 是最新一代专为代码设计的 Qwen 大型语言模型(前称为 CodeQwen)。注意:该模型目前作为无服务器模型进行实验性提供。如果用于生产环境,请注意 Fireworks 可能会在短时间内取消部署该模型。',
|
||||
displayName: 'Qwen2.5-Coder-32B-Instruct',
|
||||
enabled: true,
|
||||
id: 'accounts/fireworks/models/qwen2p5-coder-32b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Yi-Large 是顶尖的大型语言模型之一,在 LMSYS 基准测试排行榜上,其表现仅次于 GPT-4、Gemini 1.5 Pro 和 Claude 3 Opus。它在多语言能力方面表现卓越,特别是在西班牙语、中文、日语、德语和法语方面。Yi-Large 还具有用户友好性,采用与 OpenAI 相同的 API 定义,便于集成。',
|
||||
displayName: 'Yi-Large',
|
||||
enabled: true,
|
||||
id: 'accounts/yi-01-ai/models/yi-large',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'accounts/fireworks/models/llama-v3p2-3b-instruct',
|
||||
description:
|
||||
'Fireworks AI 是一家领先的高级语言模型服务商,专注于功能调用和多模态处理。其最新模型 Firefunction V2 基于 Llama-3,优化用于函数调用、对话及指令跟随。视觉语言模型 FireLLaVA-13B 支持图像和文本混合输入。其他 notable 模型包括 Llama 系列和 Mixtral 系列,提供高效的多语言指令跟随与生成支持。',
|
||||
|
||||
@@ -2,141 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://ai.gitee.com/serverless-api/packages/1910
|
||||
const GiteeAI: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 16_000,
|
||||
description:
|
||||
'Qwen2.5-72B-Instruct 支持 16k 上下文, 生成长文本超过 8K 。支持 function call 与外部系统无缝交互,极大提升了灵活性和扩展性。模型知识明显增加,并且大大提高了编码和数学能力, 多语言支持超过 29 种',
|
||||
displayName: 'Qwen2.5 72B Instruct',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'Qwen2.5-72B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'Qwen2.5-32B-Instruct 是一款 320 亿参数的大语言模型,性能表现均衡,优化中文和多语言场景,支持智能问答、内容生成等应用。',
|
||||
displayName: 'Qwen2.5 32B Instruct',
|
||||
enabled: true,
|
||||
id: 'Qwen2.5-32B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 24_000,
|
||||
description:
|
||||
'Qwen2.5-14B-Instruct 是一款 140 亿参数的大语言模型,性能表现优秀,优化中文和多语言场景,支持智能问答、内容生成等应用。',
|
||||
displayName: 'Qwen2.5 14B Instruct',
|
||||
enabled: true,
|
||||
id: 'Qwen2.5-14B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'Qwen2.5-7B-Instruct 是一款 70 亿参数的大语言模型,支持 function call 与外部系统无缝交互,极大提升了灵活性和扩展性。优化中文和多语言场景,支持智能问答、内容生成等应用。',
|
||||
displayName: 'Qwen2.5 7B Instruct',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'Qwen2.5-7B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'Qwen2 是 Qwen 模型的最新系列,对比当前最优的开源模型,Qwen2-72B 在自然语言理解、知识、代码、数学及多语言等多项能力上均显著超越当前领先的模型。',
|
||||
displayName: 'Qwen2 72B Instruct',
|
||||
id: 'Qwen2-72B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 24_000,
|
||||
description:
|
||||
'Qwen2 是 Qwen 模型的最新系列,能够超越同等规模的最优开源模型甚至更大规模的模型,Qwen2 7B 在多个评测上取得显著的优势,尤其是代码及中文理解上。',
|
||||
displayName: 'Qwen2 7B Instruct',
|
||||
id: 'Qwen2-7B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'Qwen2.5-Coder-32B-Instruct 是一款专为代码生成、代码理解和高效开发场景设计的大型语言模型,采用了业界领先的32B参数规模,能够满足多样化的编程需求。',
|
||||
displayName: 'Qwen2.5 Coder 32B Instruct',
|
||||
enabled: true,
|
||||
id: 'Qwen2.5-Coder-32B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 24_000,
|
||||
description:
|
||||
'Qwen2.5-Coder-14B-Instruct 是一款基于大规模预训练的编程指令模型,具备强大的代码理解和生成能力,能够高效地处理各种编程任务,特别适合智能代码编写、自动化脚本生成和编程问题解答。',
|
||||
displayName: 'Qwen2.5 Coder 14B Instruct',
|
||||
enabled: true,
|
||||
id: 'Qwen2.5-Coder-14B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'Qwen2-VL-72B是一款强大的视觉语言模型,支持图像与文本的多模态处理,能够精确识别图像内容并生成相关描述或回答。',
|
||||
displayName: 'Qwen2 VL 72B',
|
||||
enabled: true,
|
||||
id: 'Qwen2-VL-72B',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'InternVL2.5-26B是一款强大的视觉语言模型,支持图像与文本的多模态处理,能够精确识别图像内容并生成相关描述或回答。',
|
||||
displayName: 'InternVL2.5 26B',
|
||||
enabled: true,
|
||||
id: 'InternVL2.5-26B',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'InternVL2-8B 是一款强大的视觉语言模型,支持图像与文本的多模态处理,能够精确识别图像内容并生成相关描述或回答。',
|
||||
displayName: 'InternVL2 8B',
|
||||
enabled: true,
|
||||
id: 'InternVL2-8B',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'GLM-4-9B-Chat 在语义、数学、推理、代码和知识等多方面均表现出较高性能。还具备网页浏览、代码执行、自定义工具调用和长文本推理。 支持包括日语,韩语,德语在内的 26 种语言。',
|
||||
displayName: 'GLM4 9B Chat',
|
||||
enabled: true,
|
||||
id: 'glm-4-9b-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4000,
|
||||
description:
|
||||
'Yi-1.5-34B-Chat 在保持原系列模型优秀的通用语言能力的前提下,通过增量训练 5 千亿高质量 token,大幅提高了数学逻辑、代码能力。',
|
||||
displayName: 'Yi 34B Chat',
|
||||
enabled: true,
|
||||
id: 'Yi-34B-Chat',
|
||||
},
|
||||
/*
|
||||
// not compatible with OpenAI SDK
|
||||
{
|
||||
description:
|
||||
'代码小浣熊是基于商汤大语言模型的软件智能研发助手,覆盖软件需求分析、架构设计、代码编写、软件测试等环节,满足用户代码编写、编程学习等各类需求。代码小浣熊支持 Python、Java、JavaScript、C++、Go、SQL 等 90+主流编程语言和 VS Code、IntelliJ IDEA 等主流 IDE。在实际应用中,代码小浣熊可帮助开发者提升编程效率超 50%。',
|
||||
displayName: 'Code Raccoon v1',
|
||||
enabled: true,
|
||||
id: 'code-raccoon-v1',
|
||||
},
|
||||
*/
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description:
|
||||
'DeepSeek Coder 33B 是一个代码语言模型, 基于 2 万亿数据训练而成,其中 87% 为代码, 13% 为中英文语言。模型引入 16K 窗口大小和填空任务,提供项目级别的代码补全和片段填充功能。',
|
||||
displayName: 'DeepSeek Coder 33B Instruct',
|
||||
enabled: true,
|
||||
id: 'deepseek-coder-33B-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'CodeGeeX4-ALL-9B 是一个多语言代码生成模型,支持包括代码补全和生成、代码解释器、网络搜索、函数调用、仓库级代码问答在内的全面功能,覆盖软件开发的各种场景。是参数少于 10B 的顶尖代码生成模型。',
|
||||
displayName: 'CodeGeeX4 All 9B',
|
||||
enabled: true,
|
||||
id: 'codegeex4-all-9b',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'Qwen2.5-72B-Instruct',
|
||||
description: 'Gitee AI 的 Serverless API 为 AI 开发者提供开箱即用的大模型推理 API 服务。',
|
||||
disableBrowserRequest: true,
|
||||
|
||||
@@ -2,260 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://github.com/marketplace/models
|
||||
const Github: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'专注于高级推理和解决复杂问题,包括数学和科学任务。非常适合需要深入上下文理解和代理工作流程的应用程序。',
|
||||
displayName: 'OpenAI o1',
|
||||
enabled: true,
|
||||
functionCall: false,
|
||||
id: 'o1',
|
||||
maxOutput: 100_000,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: '比 o1-preview 更小、更快,成本低80%,在代码生成和小上下文操作方面表现良好。',
|
||||
displayName: 'OpenAI o1-mini',
|
||||
enabled: true,
|
||||
functionCall: false,
|
||||
id: 'o1-mini',
|
||||
maxOutput: 65_536,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'专注于高级推理和解决复杂问题,包括数学和科学任务。非常适合需要深度上下文理解和自主工作流程的应用。',
|
||||
displayName: 'OpenAI o1-preview',
|
||||
enabled: true,
|
||||
functionCall: false,
|
||||
id: 'o1-preview',
|
||||
maxOutput: 32_768,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 134_144,
|
||||
description: '一种经济高效的AI解决方案,适用于多种文本和图像任务。',
|
||||
displayName: 'OpenAI GPT-4o mini',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gpt-4o-mini',
|
||||
maxOutput: 4096,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 134_144,
|
||||
description: 'OpenAI GPT-4系列中最先进的多模态模型,可以处理文本和图像输入。',
|
||||
displayName: 'OpenAI GPT-4o',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gpt-4o',
|
||||
maxOutput: 16_384,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
displayName: 'DeepSeek R1',
|
||||
id: 'DeepSeek-R1',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 262_144,
|
||||
description:
|
||||
'一个52B参数(12B活跃)的多语言模型,提供256K长上下文窗口、函数调用、结构化输出和基于事实的生成。',
|
||||
displayName: 'AI21 Jamba 1.5 Mini',
|
||||
functionCall: true,
|
||||
id: 'ai21-jamba-1.5-mini',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 262_144,
|
||||
description:
|
||||
'一个398B参数(94B活跃)的多语言模型,提供256K长上下文窗口、函数调用、结构化输出和基于事实的生成。',
|
||||
displayName: 'AI21 Jamba 1.5 Large',
|
||||
functionCall: true,
|
||||
id: 'ai21-jamba-1.5-large',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Command R是一个可扩展的生成模型,旨在针对RAG和工具使用,使企业能够实现生产级AI。',
|
||||
displayName: 'Cohere Command R',
|
||||
id: 'cohere-command-r',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: 'Command R+是一个最先进的RAG优化模型,旨在应对企业级工作负载。',
|
||||
displayName: 'Cohere Command R+',
|
||||
id: 'cohere-command-r-plus',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Mistral Nemo是一种尖端的语言模型(LLM),在其尺寸类别中拥有最先进的推理、世界知识和编码能力。',
|
||||
displayName: 'Mistral Nemo',
|
||||
id: 'mistral-nemo',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: 'Mistral Small可用于任何需要高效率和低延迟的基于语言的任务。',
|
||||
displayName: 'Mistral Small',
|
||||
id: 'mistral-small',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Mistral的旗舰模型,适合需要大规模推理能力或高度专业化的复杂任务(合成文本生成、代码生成、RAG或代理)。',
|
||||
displayName: 'Mistral Large',
|
||||
id: 'mistral-large',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 262_144,
|
||||
displayName: 'Codestral',
|
||||
id: 'Codestral-2501',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '在高分辨率图像上表现出色的图像推理能力,适用于视觉理解应用。',
|
||||
displayName: 'Llama 3.2 11B Vision',
|
||||
id: 'llama-3.2-11b-vision-instruct',
|
||||
maxOutput: 4096,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '适用于视觉理解代理应用的高级图像推理能力。',
|
||||
displayName: 'Llama 3.2 90B Vision',
|
||||
id: 'llama-3.2-90b-vision-instruct',
|
||||
maxOutput: 4096,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Llama 3.3 是 Llama 系列最先进的多语言开源大型语言模型,以极低成本体验媲美 405B 模型的性能。基于 Transformer 结构,并通过监督微调(SFT)和人类反馈强化学习(RLHF)提升有用性和安全性。其指令调优版本专为多语言对话优化,在多项行业基准上表现优于众多开源和封闭聊天模型。知识截止日期为 2023 年 12 月',
|
||||
displayName: 'Llama 3.3 70B Instruct',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'llama-3.3-70b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Llama 3.1指令调优的文本模型,针对多语言对话用例进行了优化,在许多可用的开源和封闭聊天模型中,在常见行业基准上表现优异。',
|
||||
displayName: 'Meta Llama 3.1 8B',
|
||||
id: 'meta-llama-3.1-8b-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Llama 3.1指令调优的文本模型,针对多语言对话用例进行了优化,在许多可用的开源和封闭聊天模型中,在常见行业基准上表现优异。',
|
||||
displayName: 'Meta Llama 3.1 70B',
|
||||
id: 'meta-llama-3.1-70b-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Llama 3.1指令调优的文本模型,针对多语言对话用例进行了优化,在许多可用的开源和封闭聊天模型中,在常见行业基准上表现优异。',
|
||||
displayName: 'Meta Llama 3.1 405B',
|
||||
id: 'meta-llama-3.1-405b-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: '一个多功能的80亿参数模型,针对对话和文本生成任务进行了优化。',
|
||||
displayName: 'Meta Llama 3 8B',
|
||||
id: 'meta-llama-3-8b-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: '一个强大的700亿参数模型,在推理、编码和广泛的语言应用方面表现出色。',
|
||||
displayName: 'Meta Llama 3 70B',
|
||||
id: 'meta-llama-3-70b-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
displayName: 'Phi 4',
|
||||
id: 'Phi-4',
|
||||
maxOutput: 16_384,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
displayName: 'Phi 3.5 MoE',
|
||||
id: 'Phi-3.5-MoE-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: 'Phi-3-mini模型的更新版。',
|
||||
displayName: 'Phi-3.5-mini 128K',
|
||||
id: 'Phi-3.5-mini-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: 'Phi-3-vision模型的更新版。',
|
||||
displayName: 'Phi-3.5-vision 128K',
|
||||
id: 'Phi-3.5-vision-instrust',
|
||||
maxOutput: 4096,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'Phi-3家族中最小的成员,针对质量和低延迟进行了优化。',
|
||||
displayName: 'Phi-3-mini 4K',
|
||||
id: 'Phi-3-mini-4k-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '相同的Phi-3-mini模型,但具有更大的上下文大小,适用于RAG或少量提示。',
|
||||
displayName: 'Phi-3-mini 128K',
|
||||
id: 'Phi-3-mini-128k-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: '一个70亿参数模型,质量优于Phi-3-mini,重点关注高质量、推理密集型数据。',
|
||||
displayName: 'Phi-3-small 8K',
|
||||
id: 'Phi-3-small-8k-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '相同的Phi-3-small模型,但具有更大的上下文大小,适用于RAG或少量提示。',
|
||||
displayName: 'Phi-3-small 128K',
|
||||
id: 'Phi-3-small-128k-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: '一个140亿参数模型,质量优于Phi-3-mini,重点关注高质量、推理密集型数据。',
|
||||
displayName: 'Phi-3-medium 4K',
|
||||
id: 'Phi-3-medium-4k-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '相同的Phi-3-medium模型,但具有更大的上下文大小,适用于RAG或少量提示。',
|
||||
displayName: 'Phi-3-medium 128K',
|
||||
id: 'Phi-3-medium-128k-instruct',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'microsoft/Phi-3-mini-4k-instruct',
|
||||
// Ref: https://github.blog/news-insights/product-news/introducing-github-models/
|
||||
description: '通过GitHub模型,开发人员可以成为AI工程师,并使用行业领先的AI模型进行构建。',
|
||||
|
||||
@@ -2,136 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://ai.google.dev/gemini-api/docs/models/gemini
|
||||
const Google: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 1_048_576 + 65_536,
|
||||
description:
|
||||
'Gemini 2.5 Pro Experimental 是 Google 最先进的思维模型,能够对代码、数学和STEM领域的复杂问题进行推理,以及使用长上下文分析大型数据集、代码库和文档。',
|
||||
displayName: 'Gemini 2.5 Pro Experimental 03-25',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gemini-2.5-pro-exp-03-25',
|
||||
maxOutput: 65_536,
|
||||
releasedAt: '2025-03-25',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 2_097_152 + 8192,
|
||||
description:
|
||||
'Gemini 2.0 Pro Experimental 是 Google 最新的实验性多模态AI模型,与历史版本相比有一定的质量提升,特别是对于世界知识、代码和长上下文。',
|
||||
displayName: 'Gemini 2.0 Pro Experimental 02-05',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gemini-2.0-pro-exp-02-05',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2025-02-05',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_048_576 + 8192,
|
||||
description:
|
||||
'Gemini 2.0 Flash 提供下一代功能和改进,包括卓越的速度、原生工具使用、多模态生成和1M令牌上下文窗口。',
|
||||
displayName: 'Gemini 2.0 Flash',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gemini-2.0-flash',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2025-02-05',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_048_576 + 8192,
|
||||
description:
|
||||
'Gemini 2.0 Flash 提供下一代功能和改进,包括卓越的速度、原生工具使用、多模态生成和1M令牌上下文窗口。',
|
||||
displayName: 'Gemini 2.0 Flash 001',
|
||||
functionCall: true,
|
||||
id: 'gemini-2.0-flash-001',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2025-02-05',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_048_576 + 8192,
|
||||
description: '一个 Gemini 2.0 Flash 模型,针对成本效益和低延迟等目标进行了优化。',
|
||||
displayName: 'Gemini 2.0 Flash-Lite Preview 02-05',
|
||||
id: 'gemini-2.0-flash-lite-preview-02-05',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2025-02-05',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_048_576 + 65_536,
|
||||
description:
|
||||
'Gemini 2.0 Flash Thinking Exp 是 Google 的实验性多模态推理AI模型,能对复杂问题进行推理,拥有新的思维能力。',
|
||||
displayName: 'Gemini 2.0 Flash Thinking Experimental 01-21',
|
||||
enabled: true,
|
||||
id: 'gemini-2.0-flash-thinking-exp-01-21',
|
||||
maxOutput: 65_536,
|
||||
releasedAt: '2025-01-21',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 40_959,
|
||||
description:
|
||||
'LearnLM 是一个实验性的、特定于任务的语言模型,经过训练以符合学习科学原则,可在教学和学习场景中遵循系统指令,充当专家导师等。',
|
||||
displayName: 'LearnLM 1.5 Pro Experimental',
|
||||
functionCall: true,
|
||||
id: 'learnlm-1.5-pro-experimental',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2024-11-19',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_008_192,
|
||||
description: 'Gemini 1.5 Flash 002 是一款高效的多模态模型,支持广泛应用的扩展。',
|
||||
displayName: 'Gemini 1.5 Flash 002',
|
||||
functionCall: true,
|
||||
id: 'gemini-1.5-flash-002',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2024-09-25',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_008_192,
|
||||
description: 'Gemini 1.5 Flash 001 是一款高效的多模态模型,支持广泛应用的扩展。',
|
||||
displayName: 'Gemini 1.5 Flash 001',
|
||||
functionCall: true,
|
||||
id: 'gemini-1.5-flash-001',
|
||||
maxOutput: 8192,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 2_008_192,
|
||||
description:
|
||||
'Gemini 1.5 Pro 002 是最新的生产就绪模型,提供更高质量的输出,特别在数学、长上下文和视觉任务方面有显著提升。',
|
||||
displayName: 'Gemini 1.5 Pro 002',
|
||||
functionCall: true,
|
||||
id: 'gemini-1.5-pro-002',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2024-09-24',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 2_008_192,
|
||||
description: 'Gemini 1.5 Pro 001 是可扩展的多模态AI解决方案,支持广泛的复杂任务。',
|
||||
displayName: 'Gemini 1.5 Pro 001',
|
||||
functionCall: true,
|
||||
id: 'gemini-1.5-pro-001',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2024-02-15',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_008_192,
|
||||
description: 'Gemini 1.5 Flash 8B 是一款高效的多模态模型,支持广泛应用的扩展。',
|
||||
displayName: 'Gemini 1.5 Flash 8B',
|
||||
functionCall: true,
|
||||
id: 'gemini-1.5-flash-8b',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2024-10-03',
|
||||
vision: true,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'gemini-2.0-flash',
|
||||
description:
|
||||
'Google 的 Gemini 系列是其最先进、通用的 AI模型,由 Google DeepMind 打造,专为多模态设计,支持文本、代码、图像、音频和视频的无缝理解与处理。适用于从数据中心到移动设备的多种环境,极大提升了AI模型的效率与应用广泛性。',
|
||||
|
||||
@@ -2,125 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref https://console.groq.com/docs/tool-use
|
||||
const Groq: ModelProviderCard = {
|
||||
chatModels: [
|
||||
// TODO: During preview launch, Groq is limiting 3.2 models to max_tokens of 8k.
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Meta Llama 3.3 多语言大语言模型 ( LLM ) 是 70B(文本输入/文本输出)中的预训练和指令调整生成模型。 Llama 3.3 指令调整的纯文本模型针对多语言对话用例进行了优化,并且在常见行业基准上优于许多可用的开源和封闭式聊天模型。',
|
||||
displayName: 'Llama 3.3 70B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'llama-3.3-70b-versatile',
|
||||
maxOutput: 8192,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Llama 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。',
|
||||
displayName: 'Llama 3.2 11B Vision (Preview)',
|
||||
enabled: true,
|
||||
id: 'llama-3.2-11b-vision-preview',
|
||||
maxOutput: 8192,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Llama 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。',
|
||||
displayName: 'Llama 3.2 90B Vision (Preview)',
|
||||
enabled: true,
|
||||
id: 'llama-3.2-90b-vision-preview',
|
||||
maxOutput: 8192,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Llama 3.1 8B 是一款高效能模型,提供了快速的文本生成能力,非常适合需要大规模效率和成本效益的应用场景。',
|
||||
displayName: 'Llama 3.1 8B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'llama-3.1-8b-instant',
|
||||
maxOutput: 8192,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Llama 3.1 70B 提供更强大的AI推理能力,适合复杂应用,支持超多的计算处理并保证高效和准确率。',
|
||||
displayName: 'Llama 3.1 70B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'llama-3.1-70b-versatile',
|
||||
maxOutput: 8192,
|
||||
},
|
||||
/*
|
||||
// Offline due to overwhelming demand! Stay tuned for updates.
|
||||
{
|
||||
displayName: 'Llama 3.1 405B',
|
||||
functionCall: true,
|
||||
id: 'llama-3.1-405b-reasoning',
|
||||
tokens: 8_192,
|
||||
},
|
||||
*/
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Llama 3 Groq 8B Tool Use 是针对高效工具使用优化的模型,支持快速并行计算。',
|
||||
displayName: 'Llama 3 Groq 8B Tool Use (Preview)',
|
||||
functionCall: true,
|
||||
id: 'llama3-groq-8b-8192-tool-use-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Llama 3 Groq 70B Tool Use 提供强大的工具调用能力,支持复杂任务的高效处理。',
|
||||
displayName: 'Llama 3 Groq 70B Tool Use (Preview)',
|
||||
functionCall: true,
|
||||
id: 'llama3-groq-70b-8192-tool-use-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Meta Llama 3 8B 带来优质的推理效能,适合多场景应用需求。',
|
||||
displayName: 'Meta Llama 3 8B',
|
||||
functionCall: true,
|
||||
id: 'llama3-8b-8192',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Meta Llama 3 70B 提供无与伦比的复杂性处理能力,为高要求项目量身定制。',
|
||||
displayName: 'Meta Llama 3 70B',
|
||||
functionCall: true,
|
||||
id: 'llama3-70b-8192',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Gemma 2 9B 是一款优化用于特定任务和工具整合的模型。',
|
||||
displayName: 'Gemma 2 9B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gemma2-9b-it',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Gemma 7B 适合中小规模任务处理,兼具成本效益。',
|
||||
displayName: 'Gemma 7B',
|
||||
functionCall: true,
|
||||
id: 'gemma-7b-it',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Mixtral 8x7B 提供高容错的并行计算能力,适合复杂任务。',
|
||||
displayName: 'Mixtral 8x7B',
|
||||
functionCall: true,
|
||||
id: 'mixtral-8x7b-32768',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'LLaVA 1.5 7B 提供视觉处理能力融合,通过视觉信息输入生成复杂输出。',
|
||||
displayName: 'LLaVA 1.5 7B',
|
||||
id: 'llava-v1.5-7b-4096-preview',
|
||||
vision: true,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'llama-3.1-8b-instant',
|
||||
description:
|
||||
'Groq 的 LPU 推理引擎在最新的独立大语言模型(LLM)基准测试中表现卓越,以其惊人的速度和效率重新定义了 AI 解决方案的标准。Groq 是一种即时推理速度的代表,在基于云的部署中展现了良好的性能。',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,60 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
const HuggingFace: ModelProviderCard = {
|
||||
apiKeyUrl: 'https://huggingface.co/settings/tokens',
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Mistral AI的指令调优模型',
|
||||
displayName: 'Mistral 7B Instruct v0.3',
|
||||
id: 'mistralai/Mistral-7B-Instruct-v0.3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Google的轻量级指令调优模型',
|
||||
displayName: 'Gemma 2 2B Instruct',
|
||||
id: 'google/gemma-2-2b-it',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: '阿里云通义千问团队开发的大型语言模型',
|
||||
displayName: 'Qwen 2.5 72B Instruct',
|
||||
id: 'Qwen/Qwen2.5-72B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Qwen2.5-Coder 专注于代码编写',
|
||||
displayName: 'Qwen 2.5 Coder 32B Instruct',
|
||||
id: 'Qwen/Qwen2.5-Coder-32B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Qwen QwQ 是由 Qwen 团队开发的实验研究模型,专注于提升AI推理能力。',
|
||||
displayName: 'QwQ 32B Preview',
|
||||
enabled: true,
|
||||
id: 'Qwen/QwQ-32B-Preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
displayName: 'Phi 3.5 mini instruct',
|
||||
id: 'microsoft/Phi-3.5-mini-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
displayName: 'Hermes 3 Llama 3.1 8B',
|
||||
id: 'NousResearch/Hermes-3-Llama-3.1-8B',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
displayName: 'DeepSeek R1 (Distill Qwen 32B)',
|
||||
id: 'deepseek-ai/DeepSeek-R1-Distill-Qwen-32B',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
displayName: 'DeepSeek R1',
|
||||
enabled: true,
|
||||
id: 'deepseek-ai/DeepSeek-R1',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'mistralai/Mistral-7B-Instruct-v0.2',
|
||||
description:
|
||||
'HuggingFace Inference API 提供了一种快速且免费的方式,让您可以探索成千上万种模型,适用于各种任务。无论您是在为新应用程序进行原型设计,还是在尝试机器学习的功能,这个 API 都能让您即时访问多个领域的高性能模型。',
|
||||
|
||||
@@ -2,89 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref https://cloud.tencent.com/document/product/1729/104753
|
||||
const Hunyuan: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 256_000,
|
||||
description:
|
||||
'升级为 MOE 结构,上下文窗口为 256k ,在 NLP,代码,数学,行业等多项评测集上领先众多开源模型。',
|
||||
displayName: 'Hunyuan Lite',
|
||||
enabled: true,
|
||||
id: 'hunyuan-lite',
|
||||
maxOutput: 6000,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'采用更优的路由策略,同时缓解了负载均衡和专家趋同的问题。长文方面,大海捞针指标达到99.9%。MOE-32K 性价比相对更高,在平衡效果、价格的同时,可对实现对长文本输入的处理。',
|
||||
displayName: 'Hunyuan Standard',
|
||||
enabled: true,
|
||||
id: 'hunyuan-standard',
|
||||
maxOutput: 2000,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 256_000,
|
||||
description:
|
||||
'采用更优的路由策略,同时缓解了负载均衡和专家趋同的问题。长文方面,大海捞针指标达到99.9%。MOE-256K 在长度和效果上进一步突破,极大的扩展了可输入长度。',
|
||||
displayName: 'Hunyuan Standard 256K',
|
||||
enabled: true,
|
||||
id: 'hunyuan-standard-256K',
|
||||
maxOutput: 6000,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'混元全新一代大语言模型的预览版,采用全新的混合专家模型(MoE)结构,相比hunyuan-pro推理效率更快,效果表现更强。',
|
||||
displayName: 'Hunyuan Turbo',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'hunyuan-turbo',
|
||||
maxOutput: 4000,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'万亿级参数规模 MOE-32K 长文模型。在各种 benchmark 上达到绝对领先的水平,复杂指令和推理,具备复杂数学能力,支持 functioncall,在多语言翻译、金融法律医疗等领域应用重点优化。',
|
||||
displayName: 'Hunyuan Pro',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'hunyuan-pro',
|
||||
maxOutput: 4000,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description: '混元最新多模态模型,支持图片+文本输入生成文本内容。',
|
||||
displayName: 'Hunyuan Vision',
|
||||
enabled: true,
|
||||
id: 'hunyuan-vision',
|
||||
maxOutput: 4000,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description:
|
||||
'混元最新代码生成模型,经过 200B 高质量代码数据增训基座模型,迭代半年高质量 SFT 数据训练,上下文长窗口长度增大到 8K,五大语言代码生成自动评测指标上位居前列;五大语言10项考量各方面综合代码任务人工高质量评测上,性能处于第一梯队',
|
||||
displayName: 'Hunyuan Code',
|
||||
id: 'hunyuan-code',
|
||||
maxOutput: 4000,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'混元最新 MOE 架构 FunctionCall 模型,经过高质量的 FunctionCall 数据训练,上下文窗口达 32K,在多个维度的评测指标上处于领先。',
|
||||
displayName: 'Hunyuan FunctionCall',
|
||||
functionCall: true,
|
||||
id: 'hunyuan-functioncall',
|
||||
maxOutput: 4000,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description:
|
||||
'混元最新版角色扮演模型,混元官方精调训练推出的角色扮演模型,基于混元模型结合角色扮演场景数据集进行增训,在角色扮演场景具有更好的基础效果。',
|
||||
displayName: 'Hunyuan Role',
|
||||
id: 'hunyuan-role',
|
||||
maxOutput: 4000,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'hunyuan-lite',
|
||||
description:
|
||||
'由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChatModelCard, ModelProviderCard } from '@/types/llm';
|
||||
import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
import Ai21Provider from './ai21';
|
||||
import Ai302Provider from './ai302';
|
||||
@@ -59,61 +59,6 @@ import XinferenceProvider from './xinference';
|
||||
import ZeroOneProvider from './zeroone';
|
||||
import ZhiPuProvider from './zhipu';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
export const LOBE_DEFAULT_MODEL_LIST: ChatModelCard[] = [
|
||||
OpenAIProvider.chatModels,
|
||||
QwenProvider.chatModels,
|
||||
ZhiPuProvider.chatModels,
|
||||
BedrockProvider.chatModels,
|
||||
DeepSeekProvider.chatModels,
|
||||
GoogleProvider.chatModels,
|
||||
GroqProvider.chatModels,
|
||||
GithubProvider.chatModels,
|
||||
MinimaxProvider.chatModels,
|
||||
MistralProvider.chatModels,
|
||||
ModelScopeProvider.chatModels,
|
||||
MoonshotProvider.chatModels,
|
||||
OllamaProvider.chatModels,
|
||||
VLLMProvider.chatModels,
|
||||
XinferenceProvider.chatModels,
|
||||
OpenRouterProvider.chatModels,
|
||||
TogetherAIProvider.chatModels,
|
||||
FireworksAIProvider.chatModels,
|
||||
PerplexityProvider.chatModels,
|
||||
AnthropicProvider.chatModels,
|
||||
HuggingFaceProvider.chatModels,
|
||||
XAIProvider.chatModels,
|
||||
JinaProvider.chatModels,
|
||||
SambaNovaProvider.chatModels,
|
||||
CohereProvider.chatModels,
|
||||
V0Provider.chatModels,
|
||||
ZeroOneProvider.chatModels,
|
||||
StepfunProvider.chatModels,
|
||||
NovitaProvider.chatModels,
|
||||
NvidiaProvider.chatModels,
|
||||
BaichuanProvider.chatModels,
|
||||
TaichuProvider.chatModels,
|
||||
CloudflareProvider.chatModels,
|
||||
Ai360Provider.chatModels,
|
||||
AiHubMixProvider.chatModels,
|
||||
SiliconCloudProvider.chatModels,
|
||||
GiteeAIProvider.chatModels,
|
||||
UpstageProvider.chatModels,
|
||||
SparkProvider.chatModels,
|
||||
Ai21Provider.chatModels,
|
||||
HunyuanProvider.chatModels,
|
||||
WenxinProvider.chatModels,
|
||||
SenseNovaProvider.chatModels,
|
||||
InternLMProvider.chatModels,
|
||||
HigressProvider.chatModels,
|
||||
PPIOProvider.chatModels,
|
||||
Search1APIProvider.chatModels,
|
||||
InfiniAIProvider.chatModels,
|
||||
QiniuProvider.chatModels,
|
||||
].flat();
|
||||
|
||||
export const DEFAULT_MODEL_PROVIDER_LIST = [
|
||||
OpenAIProvider,
|
||||
{ ...AzureProvider, chatModels: [] },
|
||||
|
||||
@@ -3,104 +3,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
// https://cloud.infini-ai.com/genstudio/model
|
||||
// All models are currently free
|
||||
const InfiniAI: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek-R1 是一个专注于推理能力的大语言模型,通过创新的训练流程实现了与 OpenAI-o1 相当的数学、代码和推理任务表现。该模型采用了冷启动数据和大规模强化学习相结合的方式进行训练。',
|
||||
displayName: 'DeepSeek R1',
|
||||
enabled: true,
|
||||
id: 'deepseek-r1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek-V3 是一个强大的专家混合(MoE)语言模型,总参数量为 671B,每个 Token 激活 37B 参数。该模型采用多头潜在注意力(MLA)和 DeepSeekMoE 架构,实现了高效推理和经济训练。',
|
||||
displayName: 'DeepSeek V3',
|
||||
enabled: true,
|
||||
id: 'deepseek-v3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'QwQ 是 Qwen 系列的推理模型,相比传统指令调优模型,QwQ 具备思考和推理能力,在下游任务尤其是难题上能取得显著性能提升。QwQ-32B 是一款中等规模的推理模型,其性能可与最先进的推理模型相媲美,例如 DeepSeek-R1 和 o1-mini。',
|
||||
displayName: 'QwQ',
|
||||
enabled: true,
|
||||
id: 'qwq-32b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Qwen-32B 是基于 DeepSeek-R1 蒸馏而来的模型,在 Qwen2.5-32B 的基础上使用 DeepSeek-R1 生成的样本进行微调。该模型在各种基准测试中表现出色,保持了强大的推理能力。',
|
||||
displayName: 'DeepSeek R1 Distill Qwen 32B',
|
||||
enabled: true,
|
||||
id: 'deepseek-r1-distill-qwen-32b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5 是 Qwen 大型语言模型系列的最新成果。Qwen2.5 发布了从 0.5 到 720 亿参数不等的基础语言模型及指令调优语言模型。Qwen2.5 相比 Qwen2 带来了以下改进:\n显著增加知识量,在编程与数学领域的能力得到极大提升。\n在遵循指令、生成长文本、理解结构化数据 (例如,表格) 以及生成结构化输出特别是 JSON 方面有显著提升。对系统提示的多样性更具韧性,增强了聊天机器人中的角色扮演实现和条件设定。\n支持长上下文处理。\n支持超过 29 种语言的多语言功能,包括中文、英语、法语、西班牙语、葡萄牙语、德语、意大利语、俄语、日语、韩语、越南语、泰语、阿拉伯语等。',
|
||||
displayName: 'Qwen2.5 72B Instruct',
|
||||
enabled: true,
|
||||
id: 'qwen2.5-72b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5 是 Qwen 大型语言模型系列的最新成果。Qwen2.5 发布了从 0.5 到 720 亿参数不等的基础语言模型及指令调优语言模型。Qwen2.5 相比 Qwen2 带来了以下改进:\n显著增加知识量,在编程与数学领域的能力得到极大提升。\n在遵循指令、生成长文本、理解结构化数据 (例如,表格) 以及生成结构化输出特别是 JSON 方面有显著提升。对系统提示的多样性更具韧性,增强了聊天机器人中的角色扮演实现和条件设定。\n支持长上下文处理。\n支持超过 29 种语言的多语言功能,包括中文、英语、法语、西班牙语、葡萄牙语、德语、意大利语、俄语、日语、韩语、越南语、泰语、阿拉伯语等。',
|
||||
displayName: 'Qwen2.5 32B Instruct',
|
||||
enabled: true,
|
||||
id: 'qwen2.5-32b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-Coder 是最新的代码专用 Qwen 大型语言模型系列。Qwen2.5-Coder 在 CodeQwen1.5 的基础上带来了以下改进:\n显著提升代码生成、代码推理和代码修复能力。\n支持真实世界应用,例如代码代理,增强编码能力和数学及一般能力。\n支持长上下文处理。',
|
||||
displayName: 'Qwen2.5 Coder 32B Instruct',
|
||||
enabled: true,
|
||||
id: 'qwen2.5-coder-32b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5 是 Qwen 大型语言模型系列的最新成果。Qwen2.5 发布了从 0.5 到 720 亿参数不等的基础语言模型及指令调优语言模型。Qwen2.5 相比 Qwen2 带来了以下改进:\n显著增加知识量,在编程与数学领域的能力得到极大提升。\n在遵循指令、生成长文本、理解结构化数据 (例如,表格) 以及生成结构化输出特别是 JSON 方面有显著提升。对系统提示的多样性更具韧性,增强了聊天机器人中的角色扮演实现和条件设定。\n支持长上下文处理。\n支持超过 29 种语言的多语言功能,包括中文、英语、法语、西班牙语、葡萄牙语、德语、意大利语、俄语、日语、韩语、越南语、泰语、阿拉伯语等。',
|
||||
displayName: 'Qwen2.5 14B Instruct',
|
||||
enabled: true,
|
||||
id: 'qwen2.5-14b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5 是 Qwen 大型语言模型系列的最新成果。Qwen2.5 发布了从 0.5 到 720 亿参数不等的基础语言模型及指令调优语言模型。Qwen2.5 相比 Qwen2 带来了以下改进:\n显著增加知识量,在编程与数学领域的能力得到极大提升。\n在遵循指令、生成长文本、理解结构化数据 (例如,表格) 以及生成结构化输出特别是 JSON 方面有显著提升。对系统提示的多样性更具韧性,增强了聊天机器人中的角色扮演实现和条件设定。\n支持长上下文处理。\n支持超过 29 种语言的多语言功能,包括中文、英语、法语、西班牙语、葡萄牙语、德语、意大利语、俄语、日语、韩语、越南语、泰语、阿拉伯语等。',
|
||||
displayName: 'Qwen2.5 7B Instruct',
|
||||
enabled: true,
|
||||
id: 'qwen2.5-7b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2 是 Qwen 团队推出的新一代大型语言模型系列。它基于 Transformer 架构,并采用 SwiGLU 激活函数、注意力 QKV 偏置(attention QKV bias)、群组查询注意力(group query attention)、滑动窗口注意力(mixture of sliding window attention)与全注意力的混合等技术。此外,Qwen 团队还改进了适应多种自然语言和代码的分词器。',
|
||||
displayName: 'Qwen 2 72B Instruct',
|
||||
enabled: true,
|
||||
id: 'qwen2-72b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2 是 Qwen 团队推出的新一代大型语言模型系列。它基于 Transformer 架构,并采用 SwiGLU 激活函数、注意力 QKV 偏置(attention QKV bias)、群组查询注意力(group query attention)、滑动窗口注意力(mixture of sliding window attention)与全注意力的混合等技术。此外,Qwen 团队还改进了适应多种自然语言和代码的分词器。',
|
||||
displayName: 'Qwen 2 7B Instruct',
|
||||
enabled: true,
|
||||
id: 'qwen2-7b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description:
|
||||
'Yi-1.5 是 Yi 的升级版本。 它使用 500B Tokens 的高质量语料库在 Yi 上持续进行预训练,并在 3M 个多样化的微调样本上进行微调。',
|
||||
displayName: 'Yi-1.5 34B Chat',
|
||||
enabled: true,
|
||||
id: 'yi-1.5-34b-chat',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'qwen2.5-7b-instruct',
|
||||
description:
|
||||
'为应用开发者提供高性能、易上手、安全可靠的大模型服务,覆盖从大模型开发到大模型服务化部署的全流程。',
|
||||
|
||||
@@ -1,26 +1,7 @@
|
||||
import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
const InternLM: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'我们最新的模型系列,有着卓越的推理性能,支持 1M 的上下文长度以及更强的指令跟随和工具调用能力。',
|
||||
displayName: 'InternLM2.5',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'internlm2.5-latest',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: '我们仍在维护的老版本模型,有 7B、20B 多种模型参数量可选。',
|
||||
displayName: 'InternLM2 Pro Chat',
|
||||
functionCall: true,
|
||||
id: 'internlm2-pro-chat',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'internlm2.5-latest',
|
||||
description:
|
||||
'致力于大模型研究与开发工具链的开源组织。为所有 AI 开发者提供高效、易用的开源平台,让最前沿的大模型与算法技术触手可及',
|
||||
|
||||
@@ -2,44 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://platform.minimaxi.com/document/Models
|
||||
const Minimax: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 245_760,
|
||||
description: '适用于广泛的自然语言处理任务,包括文本生成、对话系统等。',
|
||||
displayName: 'abab6.5s',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'abab6.5s-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: '专为多语种人设对话设计,支持英文及其他多种语言的高质量对话生成。',
|
||||
displayName: 'abab6.5g',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'abab6.5g-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: '针对中文人设对话场景优化,提供流畅且符合中文表达习惯的对话生成能力。',
|
||||
displayName: 'abab6.5t',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'abab6.5t-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description: '面向生产力场景,支持复杂任务处理和高效文本生成,适用于专业领域应用。',
|
||||
displayName: 'abab5.5',
|
||||
id: 'abab5.5-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: '专为中文人设对话场景设计,提供高质量的中文对话生成能力,适用于多种应用场景。',
|
||||
displayName: 'abab5.5s',
|
||||
id: 'abab5.5s-chat',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'abab6.5s-chat',
|
||||
description:
|
||||
'MiniMax 是 2021 年成立的通用人工智能科技公司,致力于与用户共创智能。MiniMax 自主研发了不同模态的通用大模型,其中包括万亿参数的 MoE 文本大模型、语音大模型以及图像大模型。并推出了海螺 AI 等应用。',
|
||||
|
||||
@@ -3,101 +3,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
// ref: https://docs.mistral.ai/getting-started/models/
|
||||
// ref: https://docs.mistral.ai/capabilities/function_calling/
|
||||
const Mistral: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Mistral Nemo是一个与Nvidia合作开发的12B模型,提供出色的推理和编码性能,易于集成和替换。',
|
||||
displayName: 'Mistral Nemo',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'open-mistral-nemo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Mistral Small是成本效益高、快速且可靠的选项,适用于翻译、摘要和情感分析等用例。',
|
||||
displayName: 'Mistral Small',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'mistral-small-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Mistral Large是旗舰大模型,擅长多语言任务、复杂推理和代码生成,是高端应用的理想选择。',
|
||||
displayName: 'Mistral Large',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'mistral-large-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Codestral是专注于代码生成的尖端生成模型,优化了中间填充和代码补全任务。',
|
||||
displayName: 'Codestral',
|
||||
id: 'codestral-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Pixtral Large 是一款拥有 1240 亿参数的开源多模态模型,基于 Mistral Large 2 构建。这是我们多模态家族中的第二款模型,展现了前沿水平的图像理解能力。',
|
||||
displayName: 'Pixtral Large',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'pixtral-large-latest',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Pixtral 模型在图表和图理解、文档问答、多模态推理和指令遵循等任务上表现出强大的能力,能够以自然分辨率和宽高比摄入图像,还能够在长达 128K 令牌的长上下文窗口中处理任意数量的图像。',
|
||||
displayName: 'Pixtral 12B',
|
||||
enabled: true,
|
||||
id: 'pixtral-12b-2409',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Ministral 3B 是Mistral的世界顶级边缘模型。',
|
||||
displayName: 'Ministral 3B',
|
||||
id: 'ministral-3b-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Ministral 8B 是Mistral的性价比极高的边缘模型。',
|
||||
displayName: 'Ministral 8B',
|
||||
id: 'ministral-8b-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Mistral 7B是一款紧凑但高性能的模型,擅长批量处理和简单任务,如分类和文本生成,具有良好的推理能力。',
|
||||
displayName: 'Mistral 7B',
|
||||
id: 'open-mistral-7b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Mixtral 8x7B是一个稀疏专家模型,利用多个参数提高推理速度,适合处理多语言和代码生成任务。',
|
||||
displayName: 'Mixtral 8x7B',
|
||||
id: 'open-mixtral-8x7b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'Mixtral 8x22B是一个更大的专家模型,专注于复杂任务,提供出色的推理能力和更高的吞吐量。',
|
||||
displayName: 'Mixtral 8x22B',
|
||||
functionCall: true,
|
||||
id: 'open-mixtral-8x22b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 256_000,
|
||||
description:
|
||||
'Codestral Mamba是专注于代码生成的Mamba 2语言模型,为先进的代码和推理任务提供强力支持。',
|
||||
displayName: 'Codestral Mamba',
|
||||
id: 'open-codestral-mamba',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'ministral-3b-latest',
|
||||
description:
|
||||
'Mistral 提供先进的通用、专业和研究型模型,广泛应用于复杂推理、多语言任务、代码生成等领域,通过功能调用接口,用户可以集成自定义功能,实现特定应用。',
|
||||
|
||||
@@ -2,49 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://modelscope.cn/docs/model-service/API-Inference/intro
|
||||
const ModelScope: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek R1 通过利用增加的计算资源和在后训练过程中引入算法优化机制,显著提高了其推理和推断能力的深度。该模型在各种基准评估中表现出色,包括数学、编程和一般逻辑方面。其整体性能现已接近领先模型,如 O3 和 Gemini 2.5 Pro。',
|
||||
displayName: 'DeepSeek-R1-0528',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'deepseek-ai/DeepSeek-R1-0528',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: 'DeepSeek-V3是DeepSeek第三代模型的最新版本,具有强大的推理和对话能力。',
|
||||
displayName: 'DeepSeek-V3',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'deepseek-ai/DeepSeek-V3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: 'DeepSeek-R1是DeepSeek最新的推理模型,专注于复杂推理任务。',
|
||||
displayName: 'DeepSeek-R1',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'deepseek-ai/DeepSeek-R1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: 'Qwen3-235B-A22B是通义千问3代超大规模模型,提供顶级的AI能力。',
|
||||
displayName: 'Qwen3-235B-A22B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'Qwen/Qwen3-235B-A22B',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: 'Qwen3-32B是通义千问3代模型,具有强大的推理和对话能力。',
|
||||
displayName: 'Qwen3-32B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'Qwen/Qwen3-32B',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'Qwen/Qwen3-32B',
|
||||
description: 'ModelScope是阿里云推出的模型即服务平台,提供丰富的AI模型和推理服务。',
|
||||
id: 'modelscope',
|
||||
|
||||
@@ -2,35 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://platform.moonshot.cn/docs/intro#模型列表
|
||||
const Moonshot: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Moonshot V1 8K 专为生成短文本任务设计,具有高效的处理性能,能够处理8,192个tokens,非常适合简短对话、速记和快速内容生成。',
|
||||
displayName: 'Moonshot V1 8K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'moonshot-v1-8k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Moonshot V1 32K 提供中等长度的上下文处理能力,能够处理32,768个tokens,特别适合生成各种长文档和复杂对话,应用于内容创作、报告生成和对话系统等领域。',
|
||||
displayName: 'Moonshot V1 32K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'moonshot-v1-32k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Moonshot V1 128K 是一款拥有超长上下文处理能力的模型,适用于生成超长文本,满足复杂的生成任务需求,能够处理多达128,000个tokens的内容,非常适合科研、学术和大型文档生成等应用场景。',
|
||||
displayName: 'Moonshot V1 128K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'moonshot-v1-128k',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'kimi-latest',
|
||||
description:
|
||||
'Moonshot 是由北京月之暗面科技有限公司推出的开源平台,提供多种自然语言处理模型,应用领域广泛,包括但不限于内容创作、学术研究、智能推荐、医疗诊断等,支持长文本处理和复杂生成任务。',
|
||||
|
||||
@@ -2,111 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://novita.ai/model-api/product/llm-api
|
||||
const Novita: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Llama 3.1 8B Instruct 是 Meta 推出的最新版本,优化了高质量对话场景,表现优于许多领先的闭源模型。',
|
||||
displayName: 'Llama 3.1 8B Instruct',
|
||||
enabled: true,
|
||||
id: 'meta-llama/llama-3.1-8b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Llama 3.1 70B Instruct 专为高质量对话而设计,在人类评估中表现突出,特别适合高交互场景。',
|
||||
displayName: 'Llama 3.1 70B Instruct',
|
||||
enabled: true,
|
||||
id: 'meta-llama/llama-3.1-70b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Llama 3.1 405B Instruct 是 Meta最新推出的版本,优化用于生成高质量对话,超越了许多领导闭源模型。',
|
||||
displayName: 'Llama 3.1 405B Instruct',
|
||||
enabled: true,
|
||||
id: 'meta-llama/llama-3.1-405b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Llama 3 8B Instruct 优化了高质量对话场景,性能优于许多闭源模型。',
|
||||
displayName: 'Llama 3 8B Instruct',
|
||||
id: 'meta-llama/llama-3-8b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Llama 3 70B Instruct 优化用于高质量对话场景,在各类人类评估中表现优异。',
|
||||
displayName: 'Llama 3 70B Instruct',
|
||||
id: 'meta-llama/llama-3-70b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Gemma 2 9B 是谷歌的一款开源语言模型,以其在效率和性能方面设立了新的标准。',
|
||||
displayName: 'Gemma 2 9B',
|
||||
enabled: true,
|
||||
id: 'google/gemma-2-9b-it',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Mistral Nemo 是多语言支持和高性能编程的7.3B参数模型。',
|
||||
displayName: 'Mistral Nemo',
|
||||
enabled: true,
|
||||
id: 'mistralai/mistral-nemo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Mistral 7B Instruct 是一款兼有速度优化和长上下文支持的高性能行业标准模型。',
|
||||
displayName: 'Mistral 7B Instruct',
|
||||
enabled: true,
|
||||
id: 'mistralai/mistral-7b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'WizardLM 2 7B 是微软AI最新的快速轻量化模型,性能接近于现有开源领导模型的10倍。',
|
||||
displayName: 'WizardLM 2 7B',
|
||||
enabled: true,
|
||||
id: 'microsoft/wizardlm 2-7b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_535,
|
||||
description: 'WizardLM-2 8x22B 是微软AI最先进的Wizard模型,显示出极其竞争力的表现。',
|
||||
displayName: 'WizardLM-2 8x22B',
|
||||
enabled: true,
|
||||
id: 'microsoft/wizardlm-2-8x22b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_000,
|
||||
description: 'Dolphin Mixtral 8x22B 是一款为指令遵循、对话和编程设计的模型。',
|
||||
displayName: 'Dolphin Mixtral 8x22B',
|
||||
id: 'cognitivecomputations/dolphin-mixtral-8x22b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Hermes 2 Pro Llama 3 8B 是 Nous Hermes 2的升级版本,包含最新的内部开发的数据集。',
|
||||
displayName: 'Hermes 2 Pro Llama 3 8B',
|
||||
id: 'nousresearch/hermes-2-pro-llama-3-8b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Hermes 2 Mixtral 8x7B DPO 是一款高度灵活的多模型合并,旨在提供卓越的创造性体验。',
|
||||
displayName: 'Hermes 2 Mixtral 8x7B DPO',
|
||||
id: 'Nous-Hermes-2-Mixtral-8x7B-DPO',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'MythoMax l2 13B 是一款合并了多个顶尖模型的创意与智能相结合的语言模型。',
|
||||
displayName: 'MythoMax l2 13B',
|
||||
id: 'gryphe/mythomax-l2-13b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'OpenChat 7B 是经过“C-RLFT(条件强化学习微调)”策略精调的开源语言模型库。',
|
||||
displayName: 'OpenChat 7B',
|
||||
id: 'openchat/openchat-7b',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'meta-llama/llama-3.1-8b-instruct',
|
||||
description:
|
||||
'Novita AI 是一个提供多种大语言模型与 AI 图像生成的 API 服务的平台,灵活、可靠且具有成本效益。它支持 Llama3、Mistral 等最新的开源模型,并为生成式 AI 应用开发提供了全面、用户友好且自动扩展的 API 解决方案,适合 AI 初创公司的快速发展。',
|
||||
|
||||
@@ -1,331 +1,7 @@
|
||||
import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
const Ollama: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Llama 3.1 是 Meta 推出的领先模型,支持高达 405B 参数,可应用于复杂对话、多语言翻译和数据分析领域。',
|
||||
displayName: 'Llama 3.1 8B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'llama3.1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Llama 3.1 是 Meta 推出的领先模型,支持高达 405B 参数,可应用于复杂对话、多语言翻译和数据分析领域。',
|
||||
displayName: 'Llama 3.1 70B',
|
||||
id: 'llama3.1:70b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Llama 3.1 是 Meta 推出的领先模型,支持高达 405B 参数,可应用于复杂对话、多语言翻译和数据分析领域。',
|
||||
displayName: 'Llama 3.1 405B',
|
||||
id: 'llama3.1:405b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description:
|
||||
'Code Llama 是一款专注于代码生成和讨论的 LLM,结合广泛的编程语言支持,适用于开发者环境。',
|
||||
displayName: 'Code Llama 7B',
|
||||
enabled: true,
|
||||
id: 'codellama',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description:
|
||||
'Code Llama 是一款专注于代码生成和讨论的 LLM,结合广泛的编程语言支持,适用于开发者环境。',
|
||||
displayName: 'Code Llama 13B',
|
||||
id: 'codellama:13b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description:
|
||||
'Code Llama 是一款专注于代码生成和讨论的 LLM,结合广泛的编程语言支持,适用于开发者环境。',
|
||||
displayName: 'Code Llama 34B',
|
||||
id: 'codellama:34b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description:
|
||||
'Code Llama 是一款专注于代码生成和讨论的 LLM,结合广泛的编程语言支持,适用于开发者环境。',
|
||||
displayName: 'Code Llama 70B',
|
||||
id: 'codellama:70b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'QwQ 是一个实验研究模型,专注于提高 AI 推理能力。',
|
||||
displayName: 'QwQ 32B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'qwq',
|
||||
releasedAt: '2024-11-28',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Qwen2.5 是阿里巴巴的新一代大规模语言模型,以优异的性能支持多元化的应用需求。',
|
||||
displayName: 'Qwen2.5 0.5B',
|
||||
id: 'qwen2.5:0.5b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Qwen2.5 是阿里巴巴的新一代大规模语言模型,以优异的性能支持多元化的应用需求。',
|
||||
displayName: 'Qwen2.5 1.5B',
|
||||
id: 'qwen2.5:1.5b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Qwen2.5 是阿里巴巴的新一代大规模语言模型,以优异的性能支持多元化的应用需求。',
|
||||
displayName: 'Qwen2.5 7B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'qwen2.5',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Qwen2.5 是阿里巴巴的新一代大规模语言模型,以优异的性能支持多元化的应用需求。',
|
||||
displayName: 'Qwen2.5 72B',
|
||||
id: 'qwen2.5:72b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description: 'CodeQwen1.5 是基于大量代码数据训练的大型语言模型,专为解决复杂编程任务。',
|
||||
displayName: 'CodeQwen1.5 7B',
|
||||
functionCall: true,
|
||||
id: 'codeqwen',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Qwen2 是阿里巴巴的新一代大规模语言模型,以优异的性能支持多元化的应用需求。',
|
||||
displayName: 'Qwen2 0.5B',
|
||||
functionCall: true,
|
||||
id: 'qwen2:0.5b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Qwen2 是阿里巴巴的新一代大规模语言模型,以优异的性能支持多元化的应用需求。',
|
||||
displayName: 'Qwen2 1.5B',
|
||||
functionCall: true,
|
||||
id: 'qwen2:1.5b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Qwen2 是阿里巴巴的新一代大规模语言模型,以优异的性能支持多元化的应用需求。',
|
||||
displayName: 'Qwen2 7B',
|
||||
functionCall: true,
|
||||
id: 'qwen2',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Qwen2 是阿里巴巴的新一代大规模语言模型,以优异的性能支持多元化的应用需求。',
|
||||
displayName: 'Qwen2 72B',
|
||||
functionCall: true,
|
||||
id: 'qwen2:72b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Gemma 2 是 Google 推出的高效模型,涵盖从小型应用到复杂数据处理的多种应用场景。',
|
||||
displayName: 'Gemma 2 2B',
|
||||
id: 'gemma2:2b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Gemma 2 是 Google 推出的高效模型,涵盖从小型应用到复杂数据处理的多种应用场景。',
|
||||
displayName: 'Gemma 2 9B',
|
||||
id: 'gemma2',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Gemma 2 是 Google 推出的高效模型,涵盖从小型应用到复杂数据处理的多种应用场景。',
|
||||
displayName: 'Gemma 2 27B',
|
||||
id: 'gemma2:27b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'CodeGemma 专用于不同编程任务的轻量级语言模型,支持快速迭代和集成。',
|
||||
displayName: 'CodeGemma 2B',
|
||||
id: 'codegemma:2b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'CodeGemma 专用于不同编程任务的轻量级语言模型,支持快速迭代和集成。',
|
||||
displayName: 'CodeGemma 7B',
|
||||
id: 'codegemma',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Phi-3 是微软推出的轻量级开放模型,适用于高效集成和大规模知识推理。',
|
||||
displayName: 'Phi-3 3.8B',
|
||||
enabled: true,
|
||||
id: 'phi3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Phi-3 是微软推出的轻量级开放模型,适用于高效集成和大规模知识推理。',
|
||||
displayName: 'Phi-3 14B',
|
||||
id: 'phi3:14b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'WizardLM 2 是微软AI提供的语言模型,在复杂对话、多语言、推理和智能助手领域表现尤为出色。',
|
||||
displayName: 'WizardLM 2 7B',
|
||||
enabled: true,
|
||||
id: 'wizardlm2',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'WizardLM 2 是微软AI提供的语言模型,在复杂对话、多语言、推理和智能助手领域表现尤为出色。',
|
||||
displayName: 'WizardLM 2 8x22B',
|
||||
id: 'wizardlm2:8x22b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'MathΣtral 专为科学研究和数学推理设计,提供有效的计算能力和结果解释。',
|
||||
displayName: 'MathΣtral 7B',
|
||||
enabled: true,
|
||||
id: 'mathstral',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Mistral 是 Mistral AI 发布的 7B 模型,适合多变的语言处理需求。',
|
||||
displayName: 'Mistral 7B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'mistral',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Mixtral 是 Mistral AI 的专家模型,具有开源权重,并在代码生成和语言理解方面提供支持。',
|
||||
displayName: 'Mixtral 8x7B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'mixtral',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'Mixtral 是 Mistral AI 的专家模型,具有开源权重,并在代码生成和语言理解方面提供支持。',
|
||||
displayName: 'Mixtral 8x22B',
|
||||
functionCall: true,
|
||||
id: 'mixtral:8x22b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'Mixtral Large 是 Mistral 的旗舰模型,结合代码生成、数学和推理的能力,支持 128k 上下文窗口。',
|
||||
displayName: 'Mixtral Large 123B',
|
||||
enabled: true,
|
||||
id: 'mistral-large',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'Mistral Nemo 由 Mistral AI 和 NVIDIA 合作推出,是高效性能的 12B 模型。',
|
||||
displayName: 'Mixtral Nemo 12B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'mistral-nemo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Codestral 是 Mistral AI 的首款代码模型,为代码生成任务提供优异支持。',
|
||||
displayName: 'Codestral 22B',
|
||||
enabled: true,
|
||||
id: 'codestral',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Aya 23 是 Cohere 推出的多语言模型,支持 23 种语言,为多元化语言应用提供便利。',
|
||||
displayName: 'Aya 23 8B',
|
||||
enabled: true,
|
||||
id: 'aya',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Aya 23 是 Cohere 推出的多语言模型,支持 23 种语言,为多元化语言应用提供便利。',
|
||||
displayName: 'Aya 23 35B',
|
||||
id: 'aya:35b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: 'Command R 是优化用于对话和长上下文任务的LLM,特别适合动态交互与知识管理。',
|
||||
displayName: 'Command R 35B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'command-r',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: 'Command R+ 是一款高性能的大型语言模型,专为真实企业场景和复杂应用而设计。',
|
||||
displayName: 'Command R+ 104B',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'command-r-plus',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'DeepSeek V2 是高效的 Mixture-of-Experts 语言模型,适用于经济高效的处理需求。',
|
||||
displayName: 'DeepSeek V2 16B',
|
||||
enabled: true,
|
||||
id: 'deepseek-v2',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'DeepSeek V2 236B 是 DeepSeek 的设计代码模型,提供强大的代码生成能力。',
|
||||
displayName: 'DeepSeek V2 236B',
|
||||
id: 'deepseek-v2:236b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'DeepSeek Coder V2 是开源的混合专家代码模型,在代码任务方面表现优异,与 GPT4-Turbo 相媲美。',
|
||||
displayName: 'DeepSeek Coder V2 16B',
|
||||
enabled: true,
|
||||
id: 'deepseek-coder-v2',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'DeepSeek Coder V2 是开源的混合专家代码模型,在代码任务方面表现优异,与 GPT4-Turbo 相媲美。',
|
||||
displayName: 'DeepSeek Coder V2 236B',
|
||||
id: 'deepseek-coder-v2:236b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'LLaVA 是结合视觉编码器和 Vicuna 的多模态模型,用于强大的视觉和语言理解。',
|
||||
displayName: 'LLaVA 7B',
|
||||
enabled: true,
|
||||
id: 'llava',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'LLaVA 是结合视觉编码器和 Vicuna 的多模态模型,用于强大的视觉和语言理解。',
|
||||
displayName: 'LLaVA 13B',
|
||||
id: 'llava:13b',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'LLaVA 是结合视觉编码器和 Vicuna 的多模态模型,用于强大的视觉和语言理解。',
|
||||
displayName: 'LLaVA 34B',
|
||||
id: 'llava:34b',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'MiniCPM-V 是 OpenBMB 推出的新一代多模态大模型,具备卓越的 OCR 识别和多模态理解能力,支持广泛的应用场景。',
|
||||
displayName: 'MiniCPM-V 8B',
|
||||
enabled: true,
|
||||
id: 'minicpm-v',
|
||||
vision: true,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'deepseek-r1',
|
||||
defaultShowBrowserRequest: true,
|
||||
description:
|
||||
|
||||
@@ -2,250 +2,8 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://platform.openai.com/docs/deprecations
|
||||
const OpenAI: ModelProviderCard = {
|
||||
apiKeyUrl: 'https://platform.openai.com/api-keys?utm_source=lobehub',
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 400_000,
|
||||
description:
|
||||
'更快、更经济高效的 GPT-5 版本,适用于明确定义的任务。在保持高质量输出的同时,提供更快的响应速度。',
|
||||
displayName: 'GPT-5 mini',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gpt-5-mini',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput_cacheRead', rate: 0.03, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-08-07',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_047_576,
|
||||
description:
|
||||
'GPT-4.1 mini 提供了智能、速度和成本之间的平衡,使其成为许多用例中有吸引力的模型。',
|
||||
displayName: 'GPT-4.1 mini',
|
||||
functionCall: true,
|
||||
id: 'gpt-4.1-mini',
|
||||
maxOutput: 32_768,
|
||||
releasedAt: '2025-04-14',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'o1-mini是一款针对编程、数学和科学应用场景而设计的快速、经济高效的推理模型。该模型具有128K上下文和2023年10月的知识截止日期。',
|
||||
displayName: 'OpenAI o1-mini',
|
||||
enabled: true,
|
||||
id: 'o1-mini',
|
||||
maxOutput: 65_536,
|
||||
releasedAt: '2024-09-12',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'o1是OpenAI新的推理模型,支持图文输入并输出文本,适用于需要广泛通用知识的复杂任务。该模型具有200K上下文和2023年10月的知识截止日期。',
|
||||
displayName: 'OpenAI o1',
|
||||
enabled: true,
|
||||
id: 'o1-2024-12-17',
|
||||
maxOutput: 100_000,
|
||||
releasedAt: '2024-12-17',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'o1是OpenAI新的推理模型,适用于需要广泛通用知识的复杂任务。该模型具有128K上下文和2023年10月的知识截止日期。',
|
||||
displayName: 'OpenAI o1-preview',
|
||||
enabled: true,
|
||||
id: 'o1-preview',
|
||||
maxOutput: 32_768,
|
||||
releasedAt: '2024-09-12',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'GPT-4o mini是OpenAI在GPT-4 Omni之后推出的最新模型,支持图文输入并输出文本。作为他们最先进的小型模型,它比其他近期的前沿模型便宜很多,并且比GPT-3.5 Turbo便宜超过60%。它保持了最先进的智能,同时具有显著的性价比。GPT-4o mini在MMLU测试中获得了 82% 的得分,目前在聊天偏好上排名高于 GPT-4。',
|
||||
displayName: 'GPT-4o mini',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gpt-4o-mini',
|
||||
maxOutput: 16_385,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'GPT-4o mini search preview 是一个专门为搜索功能优化的预览版本,具有增强的网络搜索能力和实时信息检索功能。',
|
||||
displayName: 'GPT-4o mini Search Preview',
|
||||
functionCall: true,
|
||||
id: 'gpt-4o-mini-search-preview',
|
||||
maxOutput: 16_384,
|
||||
releasedAt: '2024-12-01',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'ChatGPT-4o 是一款动态模型,实时更新以保持当前最新版本。它结合了强大的语言理解与生成能力,适合于大规模应用场景,包括客户服务、教育和技术支持。',
|
||||
displayName: 'GPT-4o 1120',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gpt-4o-2024-11-20',
|
||||
releasedAt: '2024-11-20',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'ChatGPT-4o 是一款动态模型,实时更新以保持当前最新版本。它结合了强大的语言理解与生成能力,适合于大规模应用场景,包括客户服务、教育和技术支持。',
|
||||
displayName: 'GPT-4o',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'gpt-4o',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'ChatGPT-4o 是一款动态模型,实时更新以保持当前最新版本。它结合了强大的语言理解与生成能力,适合于大规模应用场景,包括客户服务、教育和技术支持。',
|
||||
displayName: 'GPT-4o 0806',
|
||||
functionCall: true,
|
||||
id: 'gpt-4o-2024-08-06',
|
||||
releasedAt: '2024-08-06',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'ChatGPT-4o 是一款动态模型,实时更新以保持当前最新版本。它结合了强大的语言理解与生成能力,适合于大规模应用场景,包括客户服务、教育和技术支持。',
|
||||
displayName: 'GPT-4o 0513',
|
||||
functionCall: true,
|
||||
id: 'gpt-4o-2024-05-13',
|
||||
releasedAt: '2024-05-13',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'ChatGPT-4o 是一款动态模型,实时更新以保持当前最新版本。它结合了强大的语言理解与生成能力,适合于大规模应用场景,包括客户服务、教育和技术支持。',
|
||||
displayName: 'ChatGPT-4o',
|
||||
enabled: true,
|
||||
id: 'chatgpt-4o-latest',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'最新的 GPT-4 Turbo 模型具备视觉功能。现在,视觉请求可以使用 JSON 模式和函数调用。 GPT-4 Turbo 是一个增强版本,为多模态任务提供成本效益高的支持。它在准确性和效率之间找到平衡,适合需要进行实时交互的应用程序场景。',
|
||||
displayName: 'GPT-4 Turbo',
|
||||
functionCall: true,
|
||||
id: 'gpt-4-turbo',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'最新的 GPT-4 Turbo 模型具备视觉功能。现在,视觉请求可以使用 JSON 模式和函数调用。 GPT-4 Turbo 是一个增强版本,为多模态任务提供成本效益高的支持。它在准确性和效率之间找到平衡,适合需要进行实时交互的应用程序场景。',
|
||||
displayName: 'GPT-4 Turbo Vision 0409',
|
||||
functionCall: true,
|
||||
id: 'gpt-4-turbo-2024-04-09',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'最新的 GPT-4 Turbo 模型具备视觉功能。现在,视觉请求可以使用 JSON 模式和函数调用。 GPT-4 Turbo 是一个增强版本,为多模态任务提供成本效益高的支持。它在准确性和效率之间找到平衡,适合需要进行实时交互的应用程序场景。',
|
||||
displayName: 'GPT-4 Turbo Preview',
|
||||
functionCall: true,
|
||||
id: 'gpt-4-turbo-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'最新的 GPT-4 Turbo 模型具备视觉功能。现在,视觉请求可以使用 JSON 模式和函数调用。 GPT-4 Turbo 是一个增强版本,为多模态任务提供成本效益高的支持。它在准确性和效率之间找到平衡,适合需要进行实时交互的应用程序场景。',
|
||||
displayName: 'GPT-4 Turbo Preview 0125',
|
||||
functionCall: true,
|
||||
id: 'gpt-4-0125-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'最新的 GPT-4 Turbo 模型具备视觉功能。现在,视觉请求可以使用 JSON 模式和函数调用。 GPT-4 Turbo 是一个增强版本,为多模态任务提供成本效益高的支持。它在准确性和效率之间找到平衡,适合需要进行实时交互的应用程序场景。',
|
||||
displayName: 'GPT-4 Turbo Preview 1106',
|
||||
functionCall: true,
|
||||
id: 'gpt-4-1106-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'GPT-4 提供了一个更大的上下文窗口,能够处理更长的文本输入,适用于需要广泛信息整合和数据分析的场景。',
|
||||
displayName: 'GPT-4',
|
||||
functionCall: true,
|
||||
id: 'gpt-4',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'GPT-4 提供了一个更大的上下文窗口,能够处理更长的文本输入,适用于需要广泛信息整合和数据分析的场景。',
|
||||
displayName: 'GPT-4 0613',
|
||||
functionCall: true,
|
||||
id: 'gpt-4-0613',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'GPT-4 提供了一个更大的上下文窗口,能够处理更长的文本输入,适用于需要广泛信息整合和数据分析的场景。',
|
||||
// Will be discontinued on June 6, 2025
|
||||
displayName: 'GPT-4 32K',
|
||||
functionCall: true,
|
||||
id: 'gpt-4-32k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
// Will be discontinued on June 6, 2025
|
||||
description:
|
||||
'GPT-4 提供了一个更大的上下文窗口,能够处理更长的文本输入,适用于需要广泛信息整合和数据分析的场景。',
|
||||
displayName: 'GPT-4 32K 0613',
|
||||
functionCall: true,
|
||||
id: 'gpt-4-32k-0613',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_385,
|
||||
description:
|
||||
'GPT 3.5 Turbo,适用于各种文本生成和理解任务,Currently points to gpt-3.5-turbo-0125',
|
||||
displayName: 'GPT-3.5 Turbo',
|
||||
functionCall: true,
|
||||
id: 'gpt-3.5-turbo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_385,
|
||||
description:
|
||||
'GPT 3.5 Turbo,适用于各种文本生成和理解任务,Currently points to gpt-3.5-turbo-0125',
|
||||
displayName: 'GPT-3.5 Turbo 0125',
|
||||
functionCall: true,
|
||||
id: 'gpt-3.5-turbo-0125',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_385,
|
||||
description:
|
||||
'GPT 3.5 Turbo,适用于各种文本生成和理解任务,Currently points to gpt-3.5-turbo-0125',
|
||||
displayName: 'GPT-3.5 Turbo 1106',
|
||||
functionCall: true,
|
||||
id: 'gpt-3.5-turbo-1106',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description:
|
||||
'GPT 3.5 Turbo,适用于各种文本生成和理解任务,Currently points to gpt-3.5-turbo-0125',
|
||||
displayName: 'GPT-3.5 Turbo Instruct',
|
||||
id: 'gpt-3.5-turbo-instruct',
|
||||
},
|
||||
],
|
||||
checkModel: 'gpt-5-nano',
|
||||
chatModels: [],
|
||||
checkModel: 'gpt-4.1-nano',
|
||||
description:
|
||||
'OpenAI 是全球领先的人工智能研究机构,其开发的模型如GPT系列推动了自然语言处理的前沿。OpenAI 致力于通过创新和高效的AI解决方案改变多个行业。他们的产品具有显著的性能和经济性,广泛用于研究、商业和创新应用。',
|
||||
enabled: true,
|
||||
|
||||
@@ -2,246 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref :https://openrouter.ai/docs#models
|
||||
const OpenRouter: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'根据上下文长度、主题和复杂性,你的请求将发送到 Llama 3 70B Instruct、Claude 3.5 Sonnet(自我调节)或 GPT-4o。',
|
||||
displayName: 'Auto (best for prompt)',
|
||||
enabled: true,
|
||||
functionCall: false,
|
||||
id: 'openrouter/auto',
|
||||
vision: false,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'o1-mini是一款针对编程、数学和科学应用场景而设计的快速、经济高效的推理模型。该模型具有128K上下文和2023年10月的知识截止日期。',
|
||||
displayName: 'OpenAI o1-mini',
|
||||
enabled: true,
|
||||
id: 'openai/o1-mini',
|
||||
maxOutput: 65_536,
|
||||
releasedAt: '2024-09-12',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'o1是OpenAI新的推理模型,支持图文输入并输出文本,适用于需要广泛通用知识的复杂任务。该模型具有200K上下文和2023年10月的知识截止日期。',
|
||||
displayName: 'OpenAI o1',
|
||||
enabled: true,
|
||||
id: 'openai/o1',
|
||||
maxOutput: 100_000,
|
||||
releasedAt: '2024-12-17',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'o1是OpenAI新的推理模型,适用于需要广泛通用知识的复杂任务。该模型具有128K上下文和2023年10月的知识截止日期。',
|
||||
displayName: 'OpenAI o1-preview',
|
||||
enabled: true,
|
||||
id: 'openai/o1-preview',
|
||||
maxOutput: 32_768,
|
||||
releasedAt: '2024-09-12',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'GPT-4o mini是OpenAI在GPT-4 Omni之后推出的最新模型,支持图文输入并输出文本。作为他们最先进的小型模型,它比其他近期的前沿模型便宜很多,并且比GPT-3.5 Turbo便宜超过60%。它保持了最先进的智能,同时具有显著的性价比。GPT-4o mini在MMLU测试中获得了 82% 的得分,目前在聊天偏好上排名高于 GPT-4。',
|
||||
displayName: 'GPT-4o mini',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'openai/gpt-4o-mini',
|
||||
maxOutput: 16_385,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'ChatGPT-4o 是一款动态模型,实时更新以保持当前最新版本。它结合了强大的语言理解与生成能力,适合于大规模应用场景,包括客户服务、教育和技术支持。',
|
||||
displayName: 'GPT-4o',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'openai/gpt-4o',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3 Haiku 是 Anthropic 的最快且最紧凑的模型,旨在实现近乎即时的响应。它具有快速且准确的定向性能。',
|
||||
displayName: 'Claude 3 Haiku',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'anthropic/claude-3-haiku',
|
||||
maxOutput: 4096,
|
||||
releasedAt: '2024-03-07',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.5 Haiku 是 Anthropic 最快的下一代模型。与 Claude 3 Haiku 相比,Claude 3.5 Haiku 在各项技能上都有所提升,并在许多智力基准测试中超越了上一代最大的模型 Claude 3 Opus。',
|
||||
displayName: 'Claude 3.5 Haiku',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'anthropic/claude-3.5-haiku',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2024-11-05',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3.5 Sonnet 提供了超越 Opus 的能力和比 Sonnet 更快的速度,同时保持与 Sonnet 相同的价格。Sonnet 特别擅长编程、数据科学、视觉处理、代理任务。',
|
||||
displayName: 'Claude 3.5 Sonnet',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'anthropic/claude-3.5-sonnet',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2024-06-20',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description:
|
||||
'Claude 3 Opus 是 Anthropic 用于处理高度复杂任务的最强大模型。它在性能、智能、流畅性和理解力方面表现卓越。',
|
||||
displayName: 'Claude 3 Opus',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'anthropic/claude-3-opus',
|
||||
maxOutput: 4096,
|
||||
releasedAt: '2024-02-29',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_000_000 + 8192,
|
||||
description: 'Gemini 1.5 Flash 提供了优化后的多模态处理能力,适用多种复杂任务场景。',
|
||||
displayName: 'Gemini 1.5 Flash',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'google/gemini-flash-1.5',
|
||||
maxOutput: 8192,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_048_576 + 8192,
|
||||
description:
|
||||
'Gemini 2.0 Flash 提供下一代功能和改进,包括卓越的速度、原生工具使用、多模态生成和1M令牌上下文窗口。',
|
||||
displayName: 'Gemini 2.0 Flash',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'google/gemini-2.0-flash-001',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2025-02-05',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 2_000_000 + 8192,
|
||||
description: 'Gemini 1.5 Pro 结合最新优化技术,带来更高效的多模态数据处理能力。',
|
||||
displayName: 'Gemini 1.5 Pro',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'google/gemini-pro-1.5',
|
||||
maxOutput: 8192,
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'融合通用与代码能力的全新开源模型, 不仅保留了原有 Chat 模型的通用对话能力和 Coder 模型的强大代码处理能力,还更好地对齐了人类偏好。此外,DeepSeek-V2.5 在写作任务、指令跟随等多个方面也实现了大幅提升。',
|
||||
displayName: 'DeepSeek V2.5',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'deepseek/deepseek-chat',
|
||||
releasedAt: '2024-09-05',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 163_840,
|
||||
description: 'DeepSeek-R1',
|
||||
displayName: 'DeepSeek R1',
|
||||
enabled: true,
|
||||
functionCall: false,
|
||||
id: 'deepseek/deepseek-r1',
|
||||
releasedAt: '2025-01-20',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 163_840,
|
||||
description: 'DeepSeek-R1',
|
||||
displayName: 'DeepSeek R1 (Free)',
|
||||
enabled: true,
|
||||
functionCall: false,
|
||||
id: 'deepseek/deepseek-r1:free',
|
||||
releasedAt: '2025-01-20',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'LLaMA 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。',
|
||||
displayName: 'Llama 3.2 11B Vision',
|
||||
enabled: true,
|
||||
id: 'meta-llama/llama-3.2-11b-vision-instruct',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'LLaMA 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。',
|
||||
displayName: 'Llama 3.2 90B Vision',
|
||||
enabled: true,
|
||||
id: 'meta-llama/llama-3.2-90b-vision-instruct',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Llama 3.3 是 Llama 系列最先进的多语言开源大型语言模型,以极低成本体验媲美 405B 模型的性能。基于 Transformer 结构,并通过监督微调(SFT)和人类反馈强化学习(RLHF)提升有用性和安全性。其指令调优版本专为多语言对话优化,在多项行业基准上表现优于众多开源和封闭聊天模型。知识截止日期为 2023 年 12 月',
|
||||
displayName: 'Llama 3.3 70B Instruct',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'meta-llama/llama-3.3-70b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Llama 3.3 是 Llama 系列最先进的多语言开源大型语言模型,以极低成本体验媲美 405B 模型的性能。基于 Transformer 结构,并通过监督微调(SFT)和人类反馈强化学习(RLHF)提升有用性和安全性。其指令调优版本专为多语言对话优化,在多项行业基准上表现优于众多开源和封闭聊天模型。知识截止日期为 2023 年 12 月',
|
||||
displayName: 'Llama 3.3 70B Instruct (Free)',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'meta-llama/llama-3.3-70b-instruct:free',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Qwen2 是全新的大型语言模型系列,具有更强的理解和生成能力。',
|
||||
displayName: 'Qwen2 7B (Free)',
|
||||
enabled: true,
|
||||
id: 'qwen/qwen-2-7b-instruct:free',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'LLaMA 3.1 提供多语言支持,是业界领先的生成模型之一。',
|
||||
displayName: 'Llama 3.1 8B (Free)',
|
||||
enabled: true,
|
||||
id: 'meta-llama/llama-3.1-8b-instruct:free',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Gemma 2 是Google轻量化的开源文本模型系列。',
|
||||
displayName: 'Gemma 2 9B (Free)',
|
||||
enabled: true,
|
||||
id: 'google/gemma-2-9b-it:free',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 2_097_152 + 8192,
|
||||
description:
|
||||
'Gemini 2.0 Pro Experimental 是 Google 最新的实验性多模态AI模型,与历史版本相比有一定的质量提升,特别是对于世界知识、代码和长上下文。',
|
||||
displayName: 'Gemini 2.0 Pro Experimental 02-05 (Free)',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'google/gemini-2.0-pro-exp-02-05:free',
|
||||
maxOutput: 8192,
|
||||
releasedAt: '2025-02-05',
|
||||
vision: true,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'google/gemma-2-9b-it:free',
|
||||
description:
|
||||
'OpenRouter 是一个提供多种前沿大模型接口的服务平台,支持 OpenAI、Anthropic、LLaMA 及更多,适合多样化的开发和应用需求。用户可根据自身需求灵活选择最优的模型和价格,助力AI体验的提升。',
|
||||
|
||||
@@ -2,51 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref :https://docs.perplexity.ai/docs/model-cards
|
||||
const Perplexity: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 127_072,
|
||||
description: '由 DeepSeek 推理模型提供支持的新 API 产品。',
|
||||
displayName: 'Sonar Reasoning',
|
||||
enabled: true,
|
||||
id: 'sonar-reasoning',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description: '支持搜索上下文的高级搜索产品,支持高级查询和跟进。',
|
||||
displayName: 'Sonar Pro',
|
||||
enabled: true,
|
||||
id: 'sonar-pro',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 127_072,
|
||||
description: '基于搜索上下文的轻量级搜索产品,比 Sonar Pro 更快、更便宜。',
|
||||
displayName: 'Sonar',
|
||||
enabled: true,
|
||||
id: 'sonar',
|
||||
},
|
||||
// The following will be deprecated on 02-22
|
||||
{
|
||||
contextWindowTokens: 127_072,
|
||||
description:
|
||||
'Llama 3.1 Sonar Small Online 模型,具备8B参数,支持约127,000个标记的上下文长度,专为在线聊天设计,能高效处理各种文本交互。',
|
||||
displayName: 'Llama 3.1 Sonar Small Online',
|
||||
id: 'llama-3.1-sonar-small-128k-online',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 127_072,
|
||||
description:
|
||||
'Llama 3.1 Sonar Large Online 模型,具备70B参数,支持约127,000个标记的上下文长度,适用于高容量和多样化聊天任务。',
|
||||
displayName: 'Llama 3.1 Sonar Large Online',
|
||||
id: 'llama-3.1-sonar-large-128k-online',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 127_072,
|
||||
description:
|
||||
'Llama 3.1 Sonar Huge Online 模型,具备405B参数,支持约127,000个标记的上下文长度,设计用于复杂的在线聊天应用。',
|
||||
displayName: 'Llama 3.1 Sonar Huge Online',
|
||||
id: 'llama-3.1-sonar-huge-128k-online',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'sonar',
|
||||
description:
|
||||
'Perplexity 是一家领先的对话生成模型提供商,提供多种先进的Llama 3.1模型,支持在线和离线应用,特别适用于复杂的自然语言处理任务。',
|
||||
|
||||
@@ -1,158 +1,7 @@
|
||||
import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
const PPIO: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 64_000,
|
||||
description:
|
||||
'DeepSeek R1是DeepSeek团队发布的最新开源模型,具备非常强悍的推理性能,尤其在数学、编程和推理任务上达到了与OpenAI的o1模型相当的水平。',
|
||||
displayName: 'DeepSeek: DeepSeek R1 (community)',
|
||||
enabled: true,
|
||||
id: 'deepseek/deepseek-r1/community',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 64_000,
|
||||
description:
|
||||
'DeepSeek-V3在推理速度方面实现了比之前模型的重大突破。在开源模型中排名第一,并可与全球最先进的闭源模型相媲美。DeepSeek-V3 采用了多头潜在注意力 (MLA) 和 DeepSeekMoE 架构,这些架构在 DeepSeek-V2 中得到了全面验证。此外,DeepSeek-V3 开创了一种用于负载均衡的辅助无损策略,并设定了多标记预测训练目标以获得更强的性能。',
|
||||
displayName: 'DeepSeek: DeepSeek V3 (community)',
|
||||
enabled: true,
|
||||
id: 'deepseek/deepseek-v3/community',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 64_000,
|
||||
description:
|
||||
'DeepSeek R1是DeepSeek团队发布的最新开源模型,具备非常强悍的推理性能,尤其在数学、编程和推理任务上达到了与OpenAI的o1模型相当的水平。',
|
||||
displayName: 'DeepSeek R1',
|
||||
enabled: true,
|
||||
id: 'deepseek/deepseek-r1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 64_000,
|
||||
description:
|
||||
'DeepSeek-V3在推理速度方面实现了比之前模型的重大突破。在开源模型中排名第一,并可与全球最先进的闭源模型相媲美。DeepSeek-V3 采用了多头潜在注意力 (MLA) 和 DeepSeekMoE 架构,这些架构在 DeepSeek-V2 中得到了全面验证。此外,DeepSeek-V3 开创了一种用于负载均衡的辅助无损策略,并设定了多标记预测训练目标以获得更强的性能。',
|
||||
displayName: 'DeepSeek V3',
|
||||
enabled: true,
|
||||
id: 'deepseek/deepseek-v3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'DeepSeek R1 Distill Llama 70B是基于Llama3.3 70B的大型语言模型,该模型利用DeepSeek R1输出的微调,实现了与大型前沿模型相当的竞争性能。',
|
||||
displayName: 'DeepSeek R1 Distill Llama 70B',
|
||||
enabled: true,
|
||||
id: 'deepseek/deepseek-r1-distill-llama-70b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 64_000,
|
||||
description:
|
||||
'DeepSeek R1 Distill Qwen 32B 是一种基于 Qwen 2.5 32B 的蒸馏大语言模型,通过使用 DeepSeek R1 的输出进行训练而得。该模型在多个基准测试中超越了 OpenAI 的 o1-mini,取得了密集模型(dense models)的最新技术领先成果(state-of-the-art)。以下是一些基准测试的结果:\nAIME 2024 pass@1: 72.6\nMATH-500 pass@1: 94.3\nCodeForces Rating: 1691\n该模型通过从 DeepSeek R1 的输出中进行微调,展现了与更大规模的前沿模型相当的竞争性能。',
|
||||
displayName: 'DeepSeek: DeepSeek R1 Distill Qwen 32B',
|
||||
enabled: true,
|
||||
id: 'deepseek/deepseek-r1-distill-qwen-32b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 64_000,
|
||||
description:
|
||||
'DeepSeek R1 Distill Qwen 14B 是一种基于 Qwen 2.5 14B 的蒸馏大语言模型,通过使用 DeepSeek R1 的输出进行训练而得。该模型在多个基准测试中超越了 OpenAI 的 o1-mini,取得了密集模型(dense models)的最新技术领先成果(state-of-the-art)。以下是一些基准测试的结果:\nAIME 2024 pass@1: 69.7\nMATH-500 pass@1: 93.9\nCodeForces Rating: 1481\n该模型通过从 DeepSeek R1 的输出中进行微调,展现了与更大规模的前沿模型相当的竞争性能。',
|
||||
displayName: 'DeepSeek: DeepSeek R1 Distill Qwen 14B',
|
||||
enabled: true,
|
||||
id: 'deepseek/deepseek-r1-distill-qwen-14b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'DeepSeek R1 Distill Llama 8B 是一种基于 Llama-3.1-8B-Instruct 的蒸馏大语言模型,通过使用 DeepSeek R1 的输出进行训练而得。',
|
||||
displayName: 'DeepSeek: DeepSeek R1 Distill Llama 8B',
|
||||
enabled: true,
|
||||
id: 'deepseek/deepseek-r1-distill-llama-8b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-72B-Instruct 是阿里云发布的最新大语言模型系列之一。该 72B 模型在编码和数学等领域具有显著改进的能力。该模型还提供了多语言支持,覆盖超过 29 种语言,包括中文、英文等。模型在指令跟随、理解结构化数据以及生成结构化输出(尤其是 JSON)方面都有显著提升。',
|
||||
displayName: 'qwen/qwen-2.5-72b-instruct',
|
||||
enabled: true,
|
||||
id: 'qwen/qwen-2.5-72b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2-VL 是 Qwen-VL 模型的最新迭代版本,在视觉理解基准测试中达到了最先进的性能,包括 MathVista、DocVQA、RealWorldQA 和 MTVQA 等。Qwen2-VL 能够理解超过 20 分钟的视频,用于高质量的基于视频的问答、对话和内容创作。它还具备复杂推理和决策能力,可以与移动设备、机器人等集成,基于视觉环境和文本指令进行自动操作。除了英语和中文,Qwen2-VL 现在还支持理解图像中不同语言的文本,包括大多数欧洲语言、日语、韩语、阿拉伯语和越南语等',
|
||||
displayName: 'qwen/qwen-2-vl-72b-instruct',
|
||||
enabled: true,
|
||||
id: 'qwen/qwen-2-vl-72b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'meta-llama/llama-3.2-3b-instruct',
|
||||
displayName: 'meta-llama/llama-3.2-3b-instruct',
|
||||
enabled: true,
|
||||
id: 'meta-llama/llama-3.2-3b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'Qwen2.5-32B-Instruct 是阿里云发布的最新大语言模型系列之一。该 32B 模型在编码和数学等领域具有显著改进的能力。该模型提供了多语言支持,覆盖超过 29 种语言,包括中文、英文等。模型在指令跟随、理解结构化数据以及生成结构化输出(尤其是 JSON)方面都有显著提升。',
|
||||
displayName: 'qwen/qwen2.5-32b-instruct',
|
||||
enabled: true,
|
||||
id: 'qwen/qwen2.5-32b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 14_336,
|
||||
description:
|
||||
'Baichuan-13B 百川智能开发的包含 130 亿参数的开源可商用的大规模语言模型,在权威的中文和英文 benchmark 上均取得同尺寸最好的效果',
|
||||
displayName: 'baichuan/baichuan2-13b-chat',
|
||||
enabled: true,
|
||||
id: 'baichuan/baichuan2-13b-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Meta最新一代的Llama 3.1模型系列,70B(700亿参数)的指令微调版本针对高质量对话场景进行了优化。在业界评估中,与领先的闭源模型相比,它展现出了强劲的性能。(仅针对企业实名认证通过主体开放)',
|
||||
displayName: 'meta-llama/llama-3.1-70b-instruct',
|
||||
enabled: true,
|
||||
id: 'meta-llama/llama-3.1-70b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Meta最新一代的Llama 3.1模型系列,8B(80亿参数)的指令微调版本特别快速高效。在业界评估中,表现出强劲的性能,超越了很多领先的闭源模型。(仅针对企业实名认证通过主体开放)',
|
||||
displayName: 'meta-llama/llama-3.1-8b-instruct',
|
||||
enabled: true,
|
||||
id: 'meta-llama/llama-3.1-8b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description:
|
||||
'零一万物,最新开源微调模型,340亿参数,微调支持多种对话场景,高质量训练数据,对齐人类偏好。',
|
||||
displayName: '01-ai/yi-1.5-34b-chat',
|
||||
enabled: true,
|
||||
id: '01-ai/yi-1.5-34b-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description:
|
||||
'零一万物,最新开源微调模型,90亿参数,微调支持多种对话场景,高质量训练数据,对齐人类偏好。',
|
||||
displayName: '01-ai/yi-1.5-9b-chat',
|
||||
enabled: true,
|
||||
id: '01-ai/yi-1.5-9b-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: '智谱AI发布的GLM-4系列最新一代预训练模型的开源版本。',
|
||||
displayName: 'thudm/glm-4-9b-chat',
|
||||
enabled: true,
|
||||
id: 'thudm/glm-4-9b-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2是全新的Qwen大型语言模型系列。Qwen2 7B是一个基于transformer的模型,在语言理解、多语言能力、编程、数学和推理方面表现出色。',
|
||||
displayName: 'qwen/qwen-2-7b-instruct',
|
||||
enabled: true,
|
||||
id: 'qwen/qwen-2-7b-instruct',
|
||||
},
|
||||
], // Will be updated with model list
|
||||
chatModels: [],
|
||||
checkModel: 'deepseek/deepseek-r1-distill-qwen-32b',
|
||||
description:
|
||||
'PPIO 派欧云提供稳定、高性价比的开源模型 API 服务,支持 DeepSeek 全系列、Llama、Qwen 等行业领先大模型。',
|
||||
|
||||
@@ -2,24 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://developer.qiniu.com/aitokenapi
|
||||
const Qiniu: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'推理速度大幅提升,位居开源模型之首,媲美顶尖闭源模型。采用负载均衡辅助策略和多标记预测训练,性能显著增强。',
|
||||
displayName: 'DeepSeek V3',
|
||||
enabled: true,
|
||||
id: 'deepseek-v3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek R1 是 DeepSeek 团队发布的最新开源模型,具备非常强悍的推理性能,尤其在数学、编程和推理任务上达到了与 OpenAI 的 o1 模型相当的水平',
|
||||
displayName: 'DeepSeek R1',
|
||||
enabled: true,
|
||||
id: 'deepseek-r1',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'deepseek-r1',
|
||||
description: '七牛作为老牌云服务厂商,提供高性价比稳定的实时、批量 AI 推理服务,简单易用。',
|
||||
id: 'qiniu',
|
||||
|
||||
@@ -2,252 +2,8 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://help.aliyun.com/zh/model-studio/getting-started/models
|
||||
const Qwen: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 1_000_000,
|
||||
description: '通义千问超大规模语言模型,支持中文、英文等不同语言输入。',
|
||||
displayName: 'Qwen Turbo',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'qwen-turbo-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '通义千问超大规模语言模型增强版,支持中文、英文等不同语言输入。',
|
||||
displayName: 'Qwen Plus',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'qwen-plus-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'通义千问千亿级别超大规模语言模型,支持中文、英文等不同语言输入,当前通义千问2.5产品版本背后的API模型。',
|
||||
displayName: 'Qwen Max',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'qwen-max-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_000_000,
|
||||
description:
|
||||
'通义千问超大规模语言模型,支持长文本上下文,以及基于长文档、多文档等多个场景的对话功能。',
|
||||
displayName: 'Qwen Long',
|
||||
id: 'qwen-long',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description:
|
||||
'通义千问大规模视觉语言模型增强版。大幅提升细节识别能力和文字识别能力,支持超百万像素分辨率和任意长宽比规格的图像。',
|
||||
displayName: 'Qwen VL Plus',
|
||||
enabled: true,
|
||||
id: 'qwen-vl-plus-latest',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'通义千问超大规模视觉语言模型。相比增强版,再次提升视觉推理能力和指令遵循能力,提供更高的视觉感知和认知水平。',
|
||||
displayName: 'Qwen VL Max',
|
||||
enabled: true,
|
||||
id: 'qwen-vl-max-latest',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 34_096,
|
||||
description:
|
||||
'通义千问OCR是文字提取专有模型,专注于文档、表格、试题、手写体文字等类型图像的文字提取能力。它能够识别多种文字,目前支持的语言有:汉语、英语、法语、日语、韩语、德语、俄语、意大利语、越南语、阿拉伯语。',
|
||||
displayName: 'Qwen VL OCR',
|
||||
id: 'qwen-vl-ocr-latest',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: '通义千问数学模型是专门用于数学解题的语言模型。',
|
||||
displayName: 'Qwen Math Turbo',
|
||||
id: 'qwen-math-turbo-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: '通义千问数学模型是专门用于数学解题的语言模型。',
|
||||
displayName: 'Qwen Math Plus',
|
||||
id: 'qwen-math-plus-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '通义千问代码模型。',
|
||||
displayName: 'Qwen Coder Turbo',
|
||||
id: 'qwen-coder-turbo-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '通义千问代码模型。',
|
||||
displayName: 'Qwen Coder Plus',
|
||||
id: 'qwen-coder-plus-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'QwQ模型是由 Qwen 团队开发的实验性研究模型,专注于增强 AI 推理能力。',
|
||||
displayName: 'QwQ 32B Preview',
|
||||
id: 'qwq-32b-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'QVQ模型是由 Qwen 团队开发的实验性研究模型,专注于提升视觉推理能力,尤其在数学推理领域。',
|
||||
displayName: 'QVQ 72B Preview',
|
||||
id: 'qvq-72b-preview',
|
||||
releasedAt: '2024-12-25',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '通义千问2.5对外开源的7B规模的模型。',
|
||||
displayName: 'Qwen2.5 7B',
|
||||
functionCall: true,
|
||||
id: 'qwen2.5-7b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '通义千问2.5对外开源的14B规模的模型。',
|
||||
displayName: 'Qwen2.5 14B',
|
||||
functionCall: true,
|
||||
id: 'qwen2.5-14b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '通义千问2.5对外开源的32B规模的模型。',
|
||||
displayName: 'Qwen2.5 32B',
|
||||
functionCall: true,
|
||||
id: 'qwen2.5-32b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '通义千问2.5对外开源的72B规模的模型。',
|
||||
displayName: 'Qwen2.5 72B',
|
||||
functionCall: true,
|
||||
id: 'qwen2.5-72b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_000_000,
|
||||
description: '通义千问2.5对外开源的72B规模的模型。',
|
||||
displayName: 'Qwen2.5 14B 1M',
|
||||
functionCall: true,
|
||||
id: 'qwen2.5-14b-instruct-1m',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'Qwen-Math 模型具有强大的数学解题能力。',
|
||||
displayName: 'Qwen2.5 Math 7B',
|
||||
id: 'qwen2.5-math-7b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'Qwen-Math 模型具有强大的数学解题能力。',
|
||||
displayName: 'Qwen2.5 Math 72B',
|
||||
id: 'qwen2.5-math-72b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '通义千问代码模型开源版。',
|
||||
displayName: 'Qwen2.5 Coder 7B',
|
||||
id: 'qwen2.5-coder-7b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '通义千问代码模型开源版。',
|
||||
displayName: 'Qwen2.5 Coder 32B',
|
||||
id: 'qwen2.5-coder-32b-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description: '以 Qwen-7B 语言模型初始化,添加图像模型,图像输入分辨率为448的预训练模型。',
|
||||
displayName: 'Qwen VL',
|
||||
id: 'qwen-vl-v1',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description: '通义千问VL支持灵活的交互方式,包括多图、多轮问答、创作等能力的模型。',
|
||||
displayName: 'Qwen VL Chat',
|
||||
id: 'qwen-vl-chat-v1',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'指令跟随、数学、解题、代码整体提升,万物识别能力提升,支持多样格式直接精准定位视觉元素,支持对长视频文件(最长10分钟)进行理解和秒级别的事件时刻定位,能理解时间先后和快慢,基于解析和定位能力支持操控OS或Mobile的Agent,关键信息抽取能力和Json格式输出能力强,此版本为72B版本,本系列能力最强的版本。',
|
||||
displayName: 'Qwen2.5 VL 72B',
|
||||
id: 'qwen2.5-vl-72b-instruct',
|
||||
releasedAt: '2025-01-26',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek-R1 在后训练阶段大规模使用了强化学习技术,在仅有极少标注数据的情况下,极大提升了模型推理能力。在数学、代码、自然语言推理等任务上,性能较高,能力较强。',
|
||||
displayName: 'DeepSeek R1',
|
||||
id: 'deepseek-r1',
|
||||
releasedAt: '2025-01-27',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek-V3 为自研 MoE 模型,671B 参数,激活 37B,在 14.8T token 上进行了预训练,在长文本、代码、数学、百科、中文能力上表现优秀。',
|
||||
displayName: 'DeepSeek V3',
|
||||
id: 'deepseek-v3',
|
||||
releasedAt: '2025-01-27',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Qwen-1.5B 是一个基于 Qwen2.5-Math-1.5B 的蒸馏大型语言模型,使用了 DeepSeek R1 的输出。',
|
||||
displayName: 'DeepSeek R1 Distill Qwen 1.5B',
|
||||
id: 'deepseek-r1-distill-qwen-1.5b',
|
||||
releasedAt: '2025-02-05',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Qwen-7B 是一个基于 Qwen2.5-Math-7B 的蒸馏大型语言模型,使用了 DeepSeek R1 的输出。',
|
||||
displayName: 'DeepSeek R1 Distill Qwen 7B',
|
||||
id: 'deepseek-r1-distill-qwen-7b',
|
||||
releasedAt: '2025-02-05',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Qwen-14B 是一个基于 Qwen2.5-14B 的蒸馏大型语言模型,使用了 DeepSeek R1 的输出。',
|
||||
displayName: 'DeepSeek R1 Distill Qwen 14B',
|
||||
id: 'deepseek-r1-distill-qwen-14b',
|
||||
releasedAt: '2025-02-05',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Qwen-32B 是一个基于 Qwen2.5-32B 的蒸馏大型语言模型,使用了 DeepSeek R1 的输出。',
|
||||
displayName: 'DeepSeek R1 Distill Qwen 32B',
|
||||
id: 'deepseek-r1-distill-qwen-32b',
|
||||
releasedAt: '2025-02-05',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Llama-8B 是一个基于 Llama-3.1-8B 的蒸馏大型语言模型,使用了 DeepSeek R1 的输出。',
|
||||
displayName: 'DeepSeek R1 Distill Llama 8B',
|
||||
id: 'deepseek-r1-distill-llama-8b',
|
||||
releasedAt: '2025-02-05',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Llama-70B 是一个基于 Llama-3.3-70B-Instruct 的蒸馏大型语言模型,使用了 DeepSeek R1 的输出。',
|
||||
displayName: 'DeepSeek R1 Distill Llama 70B',
|
||||
id: 'deepseek-r1-distill-llama-70b',
|
||||
releasedAt: '2025-02-05',
|
||||
},
|
||||
],
|
||||
checkModel: 'qwen-flash-latest',
|
||||
chatModels: [],
|
||||
checkModel: 'qwen-turbo-latest',
|
||||
description:
|
||||
'通义千问是阿里云自主研发的超大规模语言模型,具有强大的自然语言理解和生成能力。它可以回答各种问题、创作文字内容、表达观点看法、撰写代码等,在多个领域发挥作用。',
|
||||
disableBrowserRequest: true,
|
||||
|
||||
@@ -1,40 +1,7 @@
|
||||
import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
const Search1API: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek R1 70B 标准版,支持实时联网搜索,适合需要最新信息的对话和文本处理任务。',
|
||||
displayName: 'DeepSeek R1 70B',
|
||||
enabled: true,
|
||||
id: 'deepseek-r1-70b-online',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek R1 满血版,拥有 671B 参数,支持实时联网搜索,具有更强大的理解和生成能力。',
|
||||
displayName: 'DeepSeek R1',
|
||||
enabled: true,
|
||||
id: 'deepseek-r1-online',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek R1 70B 快速版,支持实时联网搜索,在保持模型性能的同时提供更快的响应速度。',
|
||||
displayName: 'DeepSeek R1 70B Fast',
|
||||
enabled: true,
|
||||
id: 'deepseek-r1-70b-fast-online',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 163_840,
|
||||
description:
|
||||
'DeepSeek R1 满血快速版,支持实时联网搜索,结合了 671B 参数的强大能力和更快的响应速度。',
|
||||
displayName: 'DeepSeek R1 Fast',
|
||||
enabled: false,
|
||||
id: 'deepseek-r1-fast-online',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'deepseek-r1-70b-fast-online',
|
||||
description:
|
||||
'Search1API 提供可根据需要自行联网的 DeepSeek 系列模型的访问,包括标准版和快速版本,支持多种参数规模的模型选择。',
|
||||
|
||||
@@ -3,75 +3,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
// ref https://platform.sensenova.cn/pricing
|
||||
// ref https://platform.sensenova.cn/release?path=/release-202409.md
|
||||
const SenseNova: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'最新版本模型 (V5.5),128K上下文长度,在数学推理、英文对话、指令跟随以及长文本理解等领域能力显著提升,比肩GPT-4o',
|
||||
displayName: 'SenseChat 5.5',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'SenseChat-5',
|
||||
},
|
||||
/*
|
||||
// Not compatible with local mode (Not support Base64 Image)
|
||||
{
|
||||
description: '最新版本模型 (V5.5),16K上下文长度,支持多图的输入,全面实现模型基础能力优化,在对象属性识别、空间关系、动作事件识别、场景理解、情感识别、逻辑常识推理和文本理解生成上都实现了较大提升。',
|
||||
displayName: 'SenseChat 5.5 Vision',
|
||||
enabled: true,
|
||||
id: 'SenseChat-Vision',
|
||||
tokens: 16_384,
|
||||
vision: true,
|
||||
},
|
||||
*/
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: '适用于快速问答、模型微调场景',
|
||||
displayName: 'SenseChat 5.0 Turbo',
|
||||
enabled: true,
|
||||
id: 'SenseChat-Turbo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'32K上下文长度,在粤语的对话理解上超越了GPT-4,在知识、推理、数学及代码编写等多个领域均能与GPT-4 Turbo相媲美',
|
||||
displayName: 'SenseChat 5.0 Cantonese',
|
||||
id: 'SenseChat-5-Cantonese',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description: '基础版本模型 (V4),128K上下文长度,在长文本理解及生成等任务中表现出色',
|
||||
displayName: 'SenseChat 4.0 128K',
|
||||
enabled: true,
|
||||
id: 'SenseChat-128K',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: '基础版本模型 (V4),32K上下文长度,灵活应用于各类场景',
|
||||
displayName: 'SenseChat 4.0 32K',
|
||||
enabled: true,
|
||||
id: 'SenseChat-32K',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: '基础版本模型 (V4),4K上下文长度,通用能力强大',
|
||||
displayName: 'SenseChat 4.0 4K',
|
||||
enabled: true,
|
||||
id: 'SenseChat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: '标准版模型,8K上下文长度,高响应速度',
|
||||
displayName: 'SenseChat Character',
|
||||
id: 'SenseChat-Character',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: '高级版模型,32K上下文长度,能力全面提升,支持中/英文对话',
|
||||
displayName: 'SenseChat Character Pro',
|
||||
id: 'SenseChat-Character-Pro',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'SenseChat-Turbo',
|
||||
description: '商汤日日新,依托商汤大装置的强大的基础支撑,提供高效易用的全栈大模型服务。',
|
||||
disableBrowserRequest: true,
|
||||
|
||||
@@ -2,423 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://siliconflow.cn/zh-cn/pricing
|
||||
const SiliconCloud: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek-R1 是一款强化学习(RL)驱动的推理模型,解决了模型中的重复性和可读性问题。在 RL 之前,DeepSeek-R1 引入了冷启动数据,进一步优化了推理性能。它在数学、代码和推理任务中与 OpenAI-o1 表现相当,并且通过精心设计的训练方法,提升了整体效果。',
|
||||
displayName: 'DeepSeek R1',
|
||||
enabled: true,
|
||||
id: 'deepseek-ai/DeepSeek-R1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek-V3 是一款拥有 6710 亿参数的混合专家(MoE)语言模型,采用多头潜在注意力(MLA)和 DeepSeekMoE 架构,结合无辅助损失的负载平衡策略,优化推理和训练效率。通过在 14.8 万亿高质量tokens上预训练,并进行监督微调和强化学习,DeepSeek-V3 在性能上超越其他开源模型,接近领先闭源模型。',
|
||||
displayName: 'DeepSeek V3',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'deepseek-ai/DeepSeek-V3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek-R1 是一款强化学习(RL)驱动的推理模型,解决了模型中的重复性和可读性问题。在 RL 之前,DeepSeek-R1 引入了冷启动数据,进一步优化了推理性能。它在数学、代码和推理任务中与 OpenAI-o1 表现相当,并且通过精心设计的训练方法,提升了整体效果。',
|
||||
displayName: 'DeepSeek R1 (Pro)',
|
||||
id: 'Pro/deepseek-ai/DeepSeek-R1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek-V3 是一款拥有 6710 亿参数的混合专家(MoE)语言模型,采用多头潜在注意力(MLA)和 DeepSeekMoE 架构,结合无辅助损失的负载平衡策略,优化推理和训练效率。通过在 14.8 万亿高质量tokens上预训练,并进行监督微调和强化学习,DeepSeek-V3 在性能上超越其他开源模型,接近领先闭源模型。',
|
||||
displayName: 'DeepSeek V3 (Pro)',
|
||||
functionCall: true,
|
||||
id: 'Pro/deepseek-ai/DeepSeek-V3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Llama-70B 是基于 Llama-3.3-70B-Instruct 经过蒸馏训练得到的模型。该模型是 DeepSeek-R1 系列的一部分,通过使用 DeepSeek-R1 生成的样本进行微调,在数学、编程和推理等多个领域展现出优秀的性能。模型在 AIME 2024、MATH-500、GPQA Diamond 等多个基准测试中都取得了优异的成绩,显示出强大的推理能力。',
|
||||
displayName: 'DeepSeek R1 Distill Llama 70B',
|
||||
enabled: true,
|
||||
id: 'deepseek-ai/DeepSeek-R1-Distill-Llama-70B',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Qwen-32B 是基于 Qwen2.5-32B 通过知识蒸馏得到的模型。该模型使用 DeepSeek-R1 生成的 80 万个精选样本进行微调,在数学、编程和推理等多个领域展现出卓越的性能。在 AIME 2024、MATH-500、GPQA Diamond 等多个基准测试中都取得了优异成绩,其中在 MATH-500 上达到了 94.3% 的准确率,展现出强大的数学推理能力。',
|
||||
displayName: 'DeepSeek R1 Distill Qwen 32B',
|
||||
enabled: true,
|
||||
id: 'deepseek-ai/DeepSeek-R1-Distill-Qwen-32B',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Qwen-14B 是基于 Qwen2.5-14B 通过知识蒸馏得到的模型。该模型使用 DeepSeek-R1 生成的 80 万个精选样本进行微调,展现出优秀的推理能力。在多个基准测试中表现出色,其中在 MATH-500 上达到了 93.9% 的准确率,在 AIME 2024 上达到了 69.7% 的通过率,在 CodeForces 上获得了 1481 的评分,显示出在数学和编程领域的强大实力。',
|
||||
displayName: 'DeepSeek R1 Distill Qwen 14B',
|
||||
enabled: true,
|
||||
id: 'deepseek-ai/DeepSeek-R1-Distill-Qwen-14B',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Llama-8B 是基于 Llama-3.1-8B 开发的蒸馏模型。该模型使用 DeepSeek-R1 生成的样本进行微调,展现出优秀的推理能力。在多个基准测试中表现不俗,其中在 MATH-500 上达到了 89.1% 的准确率,在 AIME 2024 上达到了 50.4% 的通过率,在 CodeForces 上获得了 1205 的评分,作为 8B 规模的模型展示了较强的数学和编程能力。',
|
||||
displayName: 'DeepSeek R1 Distill Llama 8B (Free)',
|
||||
enabled: true,
|
||||
id: 'deepseek-ai/DeepSeek-R1-Distill-Llama-8B',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Qwen-7B 是基于 Qwen2.5-Math-7B 通过知识蒸馏得到的模型。该模型使用 DeepSeek-R1 生成的 80 万个精选样本进行微调,展现出优秀的推理能力。在多个基准测试中表现出色,其中在 MATH-500 上达到了 92.8% 的准确率,在 AIME 2024 上达到了 55.5% 的通过率,在 CodeForces 上获得了 1189 的评分,作为 7B 规模的模型展示了较强的数学和编程能力。',
|
||||
displayName: 'DeepSeek R1 Distill Qwen 7B (Free)',
|
||||
enabled: true,
|
||||
id: 'deepseek-ai/DeepSeek-R1-Distill-Qwen-7B',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'DeepSeek-R1-Distill-Qwen-1.5B 是基于 Qwen2.5-Math-1.5B 通过知识蒸馏得到的模型。该模型使用 DeepSeek-R1 生成的 80 万个精选样本进行微调,在多个基准测试中展现出不错的性能。作为一个轻量级模型,在 MATH-500 上达到了 83.9% 的准确率,在 AIME 2024 上达到了 28.9% 的通过率,在 CodeForces 上获得了 954 的评分,显示出超出其参数规模的推理能力。',
|
||||
displayName: 'DeepSeek-R1-Distill-Qwen-1.5B (Free)',
|
||||
id: 'deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'DeepSeek-V2.5 是 DeepSeek-V2-Chat 和 DeepSeek-Coder-V2-Instruct 的升级版本,集成了两个先前版本的通用和编码能力。该模型在多个方面进行了优化,包括写作和指令跟随能力,更好地与人类偏好保持一致。DeepSeek-V2.5 在各种评估基准上都取得了显著的提升,如 AlpacaEval 2.0、ArenaHard、AlignBench 和 MT-Bench 等',
|
||||
displayName: 'DeepSeek V2.5',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'deepseek-ai/DeepSeek-V2.5',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description:
|
||||
'DeepSeek-VL2 是一个基于 DeepSeekMoE-27B 开发的混合专家(MoE)视觉语言模型,采用稀疏激活的 MoE 架构,在仅激活 4.5B 参数的情况下实现了卓越性能。该模型在视觉问答、光学字符识别、文档/表格/图表理解和视觉定位等多个任务中表现优异。',
|
||||
displayName: 'DeepSeek VL2',
|
||||
id: 'deepseek-ai/deepseek-vl2',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'QVQ-72B-Preview 是由 Qwen 团队开发的专注于视觉推理能力的研究型模型,其在复杂场景理解和解决视觉相关的数学问题方面具有独特优势。',
|
||||
displayName: 'QVQ 72B Preview',
|
||||
enabled: true,
|
||||
id: 'Qwen/QVQ-72B-Preview',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'QwQ-32B-Preview是Qwen 最新的实验性研究模型,专注于提升AI推理能力。通过探索语言混合、递归推理等复杂机制,主要优势包括强大的推理分析能力、数学和编程能力。与此同时,也存在语言切换问题、推理循环、安全性考虑、其他能力方面的差异。',
|
||||
displayName: 'QwQ 32B Preview',
|
||||
enabled: true,
|
||||
id: 'Qwen/QwQ-32B-Preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-7B-Instruct 是阿里云发布的最新大语言模型系列之一。该 7B 模型在编码和数学等领域具有显著改进的能力。该模型还提供了多语言支持,覆盖超过 29 种语言,包括中文、英文等。模型在指令跟随、理解结构化数据以及生成结构化输出(尤其是 JSON)方面都有显著提升',
|
||||
displayName: 'Qwen2.5 7B Instruct (Free)',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'Qwen/Qwen2.5-7B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-7B-Instruct 是阿里云发布的最新大语言模型系列之一。该 7B 模型在编码和数学等领域具有显著改进的能力。该模型还提供了多语言支持,覆盖超过 29 种语言,包括中文、英文等。模型在指令跟随、理解结构化数据以及生成结构化输出(尤其是 JSON)方面都有显著提升',
|
||||
displayName: 'Qwen2.5 7B Instruct (LoRA)',
|
||||
id: 'LoRA/Qwen/Qwen2.5-7B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-7B-Instruct 是阿里云发布的最新大语言模型系列之一。该 7B 模型在编码和数学等领域具有显著改进的能力。该模型还提供了多语言支持,覆盖超过 29 种语言,包括中文、英文等。模型在指令跟随、理解结构化数据以及生成结构化输出(尤其是 JSON)方面都有显著提升',
|
||||
displayName: 'Qwen2.5 7B Instruct (Pro)',
|
||||
functionCall: true,
|
||||
id: 'Pro/Qwen/Qwen2.5-7B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-14B-Instruct 是阿里云发布的最新大语言模型系列之一。该 14B 模型在编码和数学等领域具有显著改进的能力。该模型还提供了多语言支持,覆盖超过 29 种语言,包括中文、英文等。模型在指令跟随、理解结构化数据以及生成结构化输出(尤其是 JSON)方面都有显著提升',
|
||||
displayName: 'Qwen2.5 14B Instruct',
|
||||
functionCall: true,
|
||||
id: 'Qwen/Qwen2.5-14B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-32B-Instruct 是阿里云发布的最新大语言模型系列之一。该 32B 模型在编码和数学等领域具有显著改进的能力。该模型还提供了多语言支持,覆盖超过 29 种语言,包括中文、英文等。模型在指令跟随、理解结构化数据以及生成结构化输出(尤其是 JSON)方面都有显著提升',
|
||||
displayName: 'Qwen2.5 32B Instruct',
|
||||
functionCall: true,
|
||||
id: 'Qwen/Qwen2.5-32B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-72B-Instruct 是阿里云发布的最新大语言模型系列之一。该 72B 模型在编码和数学等领域具有显著改进的能力。该模型还提供了多语言支持,覆盖超过 29 种语言,包括中文、英文等。模型在指令跟随、理解结构化数据以及生成结构化输出(尤其是 JSON)方面都有显著提升',
|
||||
displayName: 'Qwen2.5 72B Instruct',
|
||||
functionCall: true,
|
||||
id: 'Qwen/Qwen2.5-72B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-72B-Instruct 是阿里云发布的最新大语言模型系列之一。该 72B 模型在编码和数学等领域具有显著改进的能力。该模型还提供了多语言支持,覆盖超过 29 种语言,包括中文、英文等。模型在指令跟随、理解结构化数据以及生成结构化输出(尤其是 JSON)方面都有显著提升',
|
||||
displayName: 'Qwen2.5 72B Instruct (LoRA)',
|
||||
id: 'LoRA/Qwen/Qwen2.5-72B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-72B-Instruct 是阿里云发布的最新大语言模型系列之一。该 72B 模型在编码和数学等领域具有显著改进的能力。该模型还提供了多语言支持,覆盖超过 29 种语言,包括中文、英文等。模型在指令跟随、理解结构化数据以及生成结构化输出(尤其是 JSON)方面都有显著提升',
|
||||
displayName: 'Qwen2.5 72B Instruct (Vendor-A)',
|
||||
functionCall: true,
|
||||
id: 'Vendor-A/Qwen/Qwen2.5-72B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Qwen2.5-72B-Instruct 是阿里云发布的最新大语言模型系列之一。该 72B 模型在编码和数学等领域具有显著改进的能力。它支持长达 128K tokens 的输入,可以生成超过 8K tokens 的长文本。该模型还提供了多语言支持,覆盖超过 29 种语言,包括中文、英文等。模型在指令跟随、理解结构化数据以及生成结构化输出(尤其是 JSON)方面都有显著提升',
|
||||
displayName: 'Qwen2.5 72B Instruct 128K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'Qwen/Qwen2.5-72B-Instruct-128K',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-Coder-7B-Instruct 是阿里云发布的代码特定大语言模型系列的最新版本。该模型在 Qwen2.5 的基础上,通过 5.5 万亿个 tokens 的训练,显著提升了代码生成、推理和修复能力。它不仅增强了编码能力,还保持了数学和通用能力的优势。模型为代码智能体等实际应用提供了更全面的基础',
|
||||
displayName: 'Qwen2.5 Coder 7B Instruct (Free)',
|
||||
id: 'Qwen/Qwen2.5-Coder-7B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-Coder-7B-Instruct 是阿里云发布的代码特定大语言模型系列的最新版本。该模型在 Qwen2.5 的基础上,通过 5.5 万亿个 tokens 的训练,显著提升了代码生成、推理和修复能力。它不仅增强了编码能力,还保持了数学和通用能力的优势。模型为代码智能体等实际应用提供了更全面的基础',
|
||||
displayName: 'Qwen2.5 Coder 7B Instruct (Pro)',
|
||||
id: 'Pro/Qwen/Qwen2.5-Coder-7B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5-Coder-32B-Instruct 是基于 Qwen2.5 开发的代码特定大语言模型。该模型通过 5.5 万亿 tokens 的训练,在代码生成、代码推理和代码修复方面都取得了显著提升。它是当前最先进的开源代码语言模型,编码能力可与 GPT-4 相媲美。模型不仅增强了编码能力,还保持了在数学和通用能力方面的优势,并支持长文本处理',
|
||||
displayName: 'Qwen2.5 Coder 32B Instruct',
|
||||
id: 'Qwen/Qwen2.5-Coder-32B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2-1.5B-Instruct 是 Qwen2 系列中的指令微调大语言模型,参数规模为 1.5B。该模型基于 Transformer 架构,采用了 SwiGLU 激活函数、注意力 QKV 偏置和组查询注意力等技术。它在语言理解、生成、多语言能力、编码、数学和推理等多个基准测试中表现出色,超越了大多数开源模型。与 Qwen1.5-1.8B-Chat 相比,Qwen2-1.5B-Instruct 在 MMLU、HumanEval、GSM8K、C-Eval 和 IFEval 等测试中均显示出显著的性能提升,尽管参数量略少',
|
||||
displayName: 'Qwen2 1.5B Instruct (Free)',
|
||||
id: 'Qwen/Qwen2-1.5B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2-1.5B-Instruct 是 Qwen2 系列中的指令微调大语言模型,参数规模为 1.5B。该模型基于 Transformer 架构,采用了 SwiGLU 激活函数、注意力 QKV 偏置和组查询注意力等技术。它在语言理解、生成、多语言能力、编码、数学和推理等多个基准测试中表现出色,超越了大多数开源模型。与 Qwen1.5-1.8B-Chat 相比,Qwen2-1.5B-Instruct 在 MMLU、HumanEval、GSM8K、C-Eval 和 IFEval 等测试中均显示出显著的性能提升,尽管参数量略少',
|
||||
displayName: 'Qwen2 1.5B Instruct (Pro)',
|
||||
id: 'Pro/Qwen/Qwen2-1.5B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2-7B-Instruct 是 Qwen2 系列中的指令微调大语言模型,参数规模为 7B。该模型基于 Transformer 架构,采用了 SwiGLU 激活函数、注意力 QKV 偏置和组查询注意力等技术。它能够处理大规模输入。该模型在语言理解、生成、多语言能力、编码、数学和推理等多个基准测试中表现出色,超越了大多数开源模型,并在某些任务上展现出与专有模型相当的竞争力。Qwen2-7B-Instruct 在多项评测中均优于 Qwen1.5-7B-Chat,显示出显著的性能提升',
|
||||
displayName: 'Qwen2 7B Instruct (Free)',
|
||||
id: 'Qwen/Qwen2-7B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2-7B-Instruct 是 Qwen2 系列中的指令微调大语言模型,参数规模为 7B。该模型基于 Transformer 架构,采用了 SwiGLU 激活函数、注意力 QKV 偏置和组查询注意力等技术。它能够处理大规模输入。该模型在语言理解、生成、多语言能力、编码、数学和推理等多个基准测试中表现出色,超越了大多数开源模型,并在某些任务上展现出与专有模型相当的竞争力。Qwen2-7B-Instruct 在多项评测中均优于 Qwen1.5-7B-Chat,显示出显著的性能提升',
|
||||
displayName: 'Qwen2 7B Instruct (Pro)',
|
||||
id: 'Pro/Qwen/Qwen2-7B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2-72B-Instruct 是 Qwen2 系列中的指令微调大语言模型,参数规模为 72B。该模型基于 Transformer 架构,采用了 SwiGLU 激活函数、注意力 QKV 偏置和组查询注意力等技术。它能够处理大规模输入。该模型在语言理解、生成、多语言能力、编码、数学和推理等多个基准测试中表现出色,超越了大多数开源模型,并在某些任务上展现出与专有模型相当的竞争力',
|
||||
displayName: 'Qwen2 72B Instruct',
|
||||
id: 'Qwen/Qwen2-7B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2-VL-7B-Instruct 是 Qwen-VL 模型的最新迭代版本,在视觉理解基准测试中达到了最先进的性能,包括 MathVista、DocVQA、RealWorldQA 和 MTVQA 等。Qwen2-VL 能够用于高质量的基于视频的问答、对话和内容创作,还具备复杂推理和决策能力,可以与移动设备、机器人等集成,基于视觉环境和文本指令进行自动操作。除了英语和中文,Qwen2-VL 现在还支持理解图像中不同语言的文本,包括大多数欧洲语言、日语、韩语、阿拉伯语和越南语等',
|
||||
displayName: 'Qwen2 VL 7B Instruct (Pro)',
|
||||
enabled: true,
|
||||
id: 'Pro/Qwen/Qwen2-VL-7B-Instruct',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2-VL 是 Qwen-VL 模型的最新迭代版本,在视觉理解基准测试中达到了最先进的性能,包括 MathVista、DocVQA、RealWorldQA 和 MTVQA 等。Qwen2-VL 能够理解超过 20 分钟的视频,用于高质量的基于视频的问答、对话和内容创作。它还具备复杂推理和决策能力,可以与移动设备、机器人等集成,基于视觉环境和文本指令进行自动操作。除了英语和中文,Qwen2-VL 现在还支持理解图像中不同语言的文本,包括大多数欧洲语言、日语、韩语、阿拉伯语和越南语等',
|
||||
displayName: 'Qwen2 VL 72B Instruct',
|
||||
enabled: true,
|
||||
id: 'Qwen/Qwen2-VL-72B-Instruct',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'InternLM2.5-7B-Chat 是一个开源的对话模型,基于 InternLM2 架构开发。该 7B 参数规模的模型专注于对话生成任务,支持中英双语交互。模型采用了最新的训练技术,旨在提供流畅、智能的对话体验。InternLM2.5-7B-Chat 适用于各种对话应用场景,包括但不限于智能客服、个人助手等领域',
|
||||
displayName: 'InternLM2.5 7B Chat (Free)',
|
||||
functionCall: true,
|
||||
id: 'internlm/internlm2_5-7b-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'InternLM2.5-20B-Chat 是一个开源的大规模对话模型,基于 InternLM2 架构开发。该模型拥有 200 亿参数,在数学推理方面表现出色,超越了同量级的 Llama3 和 Gemma2-27B 模型。InternLM2.5-20B-Chat 在工具调用能力方面有显著提升,支持从上百个网页收集信息进行分析推理,并具备更强的指令理解、工具选择和结果反思能力。它适用于构建复杂智能体,可进行多轮工具调用以完成复杂任务',
|
||||
displayName: 'InternLM2.5 20B Chat',
|
||||
functionCall: true,
|
||||
id: 'internlm/internlm2_5-20b-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'InternVL2-8B 是 InternVL 2.0 系列多模态大语言模型中的一员。该模型由 InternViT-300M-448px 视觉模型、MLP 投影层和 internlm2_5-7b-chat 语言模型组成。它在各种视觉语言任务上展现出了卓越的性能,包括文档和图表理解、场景文本理解、OCR、科学和数学问题解决等。InternVL2-8B 使用 8K 上下文窗口训练,能够处理长文本、多图像和视频输入,显著提升了模型在这些任务上的处理能力',
|
||||
displayName: 'InternVL2 8B (Pro)',
|
||||
id: 'Pro/OpenGVLab/InternVL2-8B',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'InternVL2-26B 是 InternVL 2.0 系列多模态大语言模型中的一员。该模型由 InternViT-6B-448px-V1-5 视觉模型、MLP 投影层和 internlm2-chat-20b 语言模型组成。它在各种视觉语言任务上展现出了卓越的性能,包括文档和图表理解、场景文本理解、OCR、科学和数学问题解决等。InternVL2-26B 使用 8K 上下文窗口训练,能够处理长文本、多图像和视频输入,显著提升了模型在这些任务上的处理能力',
|
||||
displayName: 'InternVL2 26B',
|
||||
id: 'OpenGVLab/InternVL2-26B',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'GLM-4-9B-Chat 是智谱 AI 推出的 GLM-4 系列预训练模型中的开源版本。该模型在语义、数学、推理、代码和知识等多个方面表现出色。除了支持多轮对话外,GLM-4-9B-Chat 还具备网页浏览、代码执行、自定义工具调用(Function Call)和长文本推理等高级功能。模型支持 26 种语言,包括中文、英文、日语、韩语和德语等。在多项基准测试中,GLM-4-9B-Chat 展现了优秀的性能,如 AlignBench-v2、MT-Bench、MMLU 和 C-Eval 等。该模型支持最大 128K 的上下文长度,适用于学术研究和商业应用',
|
||||
displayName: 'GLM-4 9B Chat (Free)',
|
||||
functionCall: true,
|
||||
id: 'THUDM/glm-4-9b-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'GLM-4-9B-Chat 是智谱 AI 推出的 GLM-4 系列预训练模型中的开源版本。该模型在语义、数学、推理、代码和知识等多个方面表现出色。除了支持多轮对话外,GLM-4-9B-Chat 还具备网页浏览、代码执行、自定义工具调用(Function Call)和长文本推理等高级功能。模型支持 26 种语言,包括中文、英文、日语、韩语和德语等。在多项基准测试中,GLM-4-9B-Chat 展现了优秀的性能,如 AlignBench-v2、MT-Bench、MMLU 和 C-Eval 等。该模型支持最大 128K 的上下文长度,适用于学术研究和商业应用',
|
||||
displayName: 'GLM-4 9B Chat (Pro)',
|
||||
functionCall: true,
|
||||
id: 'Pro/THUDM/glm-4-9b-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'ChatGLM3-6B 是 ChatGLM 系列的开源模型,由智谱 AI 开发。该模型保留了前代模型的优秀特性,如对话流畅和部署门槛低,同时引入了新的特性。它采用了更多样的训练数据、更充分的训练步数和更合理的训练策略,在 10B 以下的预训练模型中表现出色。ChatGLM3-6B 支持多轮对话、工具调用、代码执行和 Agent 任务等复杂场景。除对话模型外,还开源了基础模型 ChatGLM-6B-Base 和长文本对话模型 ChatGLM3-6B-32K。该模型对学术研究完全开放,在登记后也允许免费商业使用',
|
||||
displayName: 'ChatGLM3 6B (Free)',
|
||||
id: 'THUDM/chatglm3-6b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description:
|
||||
'Yi-1.5-6B-Chat 是 Yi-1.5 系列的一个变体,属于开源聊天模型。Yi-1.5 是 Yi 的升级版本,在 500B 个高质量语料上进行了持续预训练,并在 3M 多样化的微调样本上进行了微调。相比于 Yi,Yi-1.5 在编码、数学、推理和指令遵循能力方面表现更强,同时保持了出色的语言理解、常识推理和阅读理解能力。该模型具有 4K、16K 和 32K 的上下文长度版本,预训练总量达到 3.6T 个 token',
|
||||
displayName: 'Yi-1.5 6B Chat (Free)',
|
||||
id: '01-ai/Yi-1.5-6B-Chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description:
|
||||
'Yi-1.5-9B-Chat-16K 是 Yi-1.5 系列的一个变体,属于开源聊天模型。Yi-1.5 是 Yi 的升级版本,在 500B 个高质量语料上进行了持续预训练,并在 3M 多样化的微调样本上进行了微调。相比于 Yi,Yi-1.5 在编码、数学、推理和指令遵循能力方面表现更强,同时保持了出色的语言理解、常识推理和阅读理解能力。该模型在同等规模的开源模型中表现最佳',
|
||||
displayName: 'Yi-1.5 9B Chat 16K (Free)',
|
||||
id: '01-ai/Yi-1.5-9B-Chat-16K',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description:
|
||||
'Yi-1.5-34B-Chat-16K 是 Yi-1.5 系列的一个变体,属于开源聊天模型。Yi-1.5 是 Yi 的升级版本,在 500B 个高质量语料上进行了持续预训练,并在 3M 多样化的微调样本上进行了微调。相比于 Yi,Yi-1.5 在编码、数学、推理和指令遵循能力方面表现更强,同时保持了出色的语言理解、常识推理和阅读理解能力。该模型在大多数基准测试中与更大的模型相当或表现更佳,具有 16K 的上下文长度',
|
||||
displayName: 'Yi-1.5 34B Chat 16K',
|
||||
id: '01-ai/Yi-1.5-34B-Chat-16K',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Gemma 是 Google 开发的轻量级、最先进的开放模型系列之一。它是一个仅解码器的大型语言模型,支持英语,提供开放权重、预训练变体和指令微调变体。Gemma 模型适用于各种文本生成任务,包括问答、摘要和推理。该 9B 模型是通过 8 万亿个 tokens 训练而成。其相对较小的规模使其可以在资源有限的环境中部署,如笔记本电脑、台式机或您自己的云基础设施,从而使更多人能够访问最先进的 AI 模型并促进创新',
|
||||
displayName: 'Gemma 2 9B (Free)',
|
||||
enabled: true,
|
||||
id: 'google/gemma-2-9b-it',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Gemma 是 Google 开发的轻量级、最先进的开放模型系列之一。它是一个仅解码器的大型语言模型,支持英语,提供开放权重、预训练变体和指令微调变体。Gemma 模型适用于各种文本生成任务,包括问答、摘要和推理。该 9B 模型是通过 8 万亿个 tokens 训练而成。其相对较小的规模使其可以在资源有限的环境中部署,如笔记本电脑、台式机或您自己的云基础设施,从而使更多人能够访问最先进的 AI 模型并促进创新',
|
||||
displayName: 'Gemma 2 9B (Pro)',
|
||||
id: 'Pro/google/gemma-2-9b-it',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Gemma 是由 Google 开发的轻量级、最先进的开放模型系列,采用与 Gemini 模型相同的研究和技术构建。这些模型是仅解码器的大型语言模型,支持英语,提供预训练和指令微调两种变体的开放权重。Gemma 模型适用于各种文本生成任务,包括问答、摘要和推理。其相对较小的规模使其能够部署在资源有限的环境中,如笔记本电脑、台式机或个人云基础设施,从而让所有人都能获得最先进的 AI 模型,促进创新',
|
||||
displayName: 'Gemma 2 27B',
|
||||
enabled: true,
|
||||
id: 'google/gemma-2-27b-it',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Meta Llama 3.1 是由 Meta 开发的多语言大型语言模型家族,包括 8B、70B 和 405B 三种参数规模的预训练和指令微调变体。该 8B 指令微调模型针对多语言对话场景进行了优化,在多项行业基准测试中表现优异。模型训练使用了超过 15 万亿个 tokens 的公开数据,并采用了监督微调和人类反馈强化学习等技术来提升模型的有用性和安全性。Llama 3.1 支持文本生成和代码生成,知识截止日期为 2023 年 12 月',
|
||||
displayName: 'Llama 3.1 8B Instruct (Free)',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'meta-llama/Meta-Llama-3.1-8B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Meta Llama 3.1 是由 Meta 开发的多语言大型语言模型家族,包括 8B、70B 和 405B 三种参数规模的预训练和指令微调变体。该 8B 指令微调模型针对多语言对话场景进行了优化,在多项行业基准测试中表现优异。模型训练使用了超过 15 万亿个 tokens 的公开数据,并采用了监督微调和人类反馈强化学习等技术来提升模型的有用性和安全性。Llama 3.1 支持文本生成和代码生成,知识截止日期为 2023 年 12 月',
|
||||
displayName: 'Llama 3.1 8B Instruct (Pro)',
|
||||
id: 'Pro/meta-llama/Meta-Llama-3.1-8B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Meta Llama 3.1 是由 Meta 开发的多语言大型语言模型家族,包括 8B、70B 和 405B 三种参数规模的预训练和指令微调变体。该 70B 指令微调模型针对多语言对话场景进行了优化,在多项行业基准测试中表现优异。模型训练使用了超过 15 万亿个 tokens 的公开数据,并采用了监督微调和人类反馈强化学习等技术来提升模型的有用性和安全性。Llama 3.1 支持文本生成和代码生成,知识截止日期为 2023 年 12 月',
|
||||
displayName: 'Llama 3.1 70B Instruct',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'meta-llama/Meta-Llama-3.1-70B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Meta Llama 3.1 是由 Meta 开发的多语言大型语言模型家族,包括 8B、70B 和 405B 三种参数规模的预训练和指令微调变体。该 405B 指令微调模型针对多语言对话场景进行了优化,在多项行业基准测试中表现优异。模型训练使用了超过 15 万亿个 tokens 的公开数据,并采用了监督微调和人类反馈强化学习等技术来提升模型的有用性和安全性。Llama 3.1 支持文本生成和代码生成,知识截止日期为 2023 年 12 月',
|
||||
displayName: 'Llama 3.1 405B Instruct',
|
||||
enabled: true,
|
||||
id: 'meta-llama/Meta-Llama-3.1-405B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Llama 3.3 是 Llama 系列最先进的多语言开源大型语言模型,以极低成本体验媲美 405B 模型的性能。基于 Transformer 结构,并通过监督微调(SFT)和人类反馈强化学习(RLHF)提升有用性和安全性。其指令调优版本专为多语言对话优化,在多项行业基准上表现优于众多开源和封闭聊天模型。知识截止日期为 2023 年 12 月',
|
||||
displayName: 'Llama 3.3 70B Instruct',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'meta-llama/Llama-3.3-70B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'TeleChat2大模型是由中国电信从0到1自主研发的生成式语义大模型,支持百科问答、代码生成、长文生成等功能,为用户提供对话咨询服务,能够与用户进行对话互动,回答问题,协助创作,高效便捷地帮助用户获取信息、知识和灵感。模型在幻觉问题、长文生成、逻辑理解等方面均有较出色表现。',
|
||||
displayName: 'TeleChat2',
|
||||
id: 'TeleAI/TeleChat2',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'TeleMM多模态大模型是由中国电信自主研发的多模态理解大模型,能够处理文本、图像等多种模态输入,支持图像理解、图表分析等功能,为用户提供跨模态的理解服务。模型能够与用户进行多模态交互,准确理解输入内容,回答问题、协助创作,并高效提供多模态信息和灵感支持。在细粒度感知,逻辑推理等多模态任务上有出色表现',
|
||||
displayName: 'TeleMM',
|
||||
id: 'TeleAI/TeleMM',
|
||||
vision: true,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'Pro/Qwen/Qwen2-1.5B-Instruct',
|
||||
description: 'SiliconCloud,基于优秀开源基础模型的高性价比 GenAI 云服务',
|
||||
id: 'siliconcloud',
|
||||
|
||||
@@ -3,65 +3,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
// ref: https://www.xfyun.cn/doc/spark/HTTP%E8%B0%83%E7%94%A8%E6%96%87%E6%A1%A3.html#_3-%E8%AF%B7%E6%B1%82%E8%AF%B4%E6%98%8E
|
||||
// ref: https://www.xfyun.cn/doc/spark/Web.html#_1-%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E
|
||||
const Spark: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Spark Lite 是一款轻量级大语言模型,具备极低的延迟与高效的处理能力,完全免费开放,支持实时在线搜索功能。其快速响应的特性使其在低算力设备上的推理应用和模型微调中表现出色,为用户带来出色的成本效益和智能体验,尤其在知识问答、内容生成及搜索场景下表现不俗。',
|
||||
displayName: 'Spark Lite',
|
||||
enabled: true,
|
||||
id: 'lite',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Spark Pro 是一款为专业领域优化的高性能大语言模型,专注数学、编程、医疗、教育等多个领域,并支持联网搜索及内置天气、日期等插件。其优化后模型在复杂知识问答、语言理解及高层次文本创作中展现出色表现和高效性能,是适合专业应用场景的理想选择。',
|
||||
displayName: 'Spark Pro',
|
||||
enabled: true,
|
||||
id: 'generalv3',
|
||||
maxOutput: 8192,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Spark Pro 128K 配置了特大上下文处理能力,能够处理多达128K的上下文信息,特别适合需通篇分析和长期逻辑关联处理的长文内容,可在复杂文本沟通中提供流畅一致的逻辑与多样的引用支持。',
|
||||
displayName: 'Spark Pro 128K',
|
||||
enabled: true,
|
||||
id: 'pro-128k',
|
||||
maxOutput: 4096,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Spark Max 为功能最为全面的版本,支持联网搜索及众多内置插件。其全面优化的核心能力以及系统角色设定和函数调用功能,使其在各种复杂应用场景中的表现极为优异和出色。',
|
||||
displayName: 'Spark Max',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'generalv3.5',
|
||||
maxOutput: 8192,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Spark Max 32K 配置了大上下文处理能力,更强的上下文理解和逻辑推理能力,支持32K tokens的文本输入,适用于长文档阅读、私有知识问答等场景',
|
||||
displayName: 'Spark Max 32K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'max-32k',
|
||||
maxOutput: 8192,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Spark Ultra 是星火大模型系列中最为强大的版本,在升级联网搜索链路同时,提升对文本内容的理解和总结能力。它是用于提升办公生产力和准确响应需求的全方位解决方案,是引领行业的智能产品。',
|
||||
displayName: 'Spark 4.0 Ultra',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: '4.0Ultra',
|
||||
maxOutput: 8192,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'lite',
|
||||
description:
|
||||
'科大讯飞星火大模型提供多领域、多语言的强大 AI 能力,利用先进的自然语言处理技术,构建适用于智能硬件、智慧医疗、智慧金融等多种垂直场景的创新应用。',
|
||||
|
||||
@@ -3,104 +3,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
// ref: https://platform.stepfun.com/docs/llm/text
|
||||
// 根据文档,阶级星辰大模型的上下文长度,其 k 的含义均为 1000
|
||||
const Stepfun: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description: '高速模型,适合实时对话。',
|
||||
displayName: 'Step 1 Flash',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'step-1-flash',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description: '小型模型,适合轻量级任务。',
|
||||
displayName: 'Step 1 8K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'step-1-8k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description: '支持中等长度的对话,适用于多种应用场景。',
|
||||
displayName: 'Step 1 32K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'step-1-32k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: '平衡性能与成本,适合一般场景。',
|
||||
displayName: 'Step 1 128K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'step-1-128k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 256_000,
|
||||
description: '具备超长上下文处理能力,尤其适合长文档分析。',
|
||||
displayName: 'Step 1 256K',
|
||||
functionCall: true,
|
||||
id: 'step-1-256k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_000,
|
||||
description: '支持大规模上下文交互,适合复杂对话场景。',
|
||||
displayName: 'Step 2 16K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'step-2-16k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description:
|
||||
'基于新一代自研Attention架构MFA的极速大模型,用极低成本达到和step1类似的效果,同时保持了更高的吞吐和更快响应时延。能够处理通用任务,在代码能力上具备特长。',
|
||||
displayName: 'Step 2 Mini',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'step-2-mini',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_000,
|
||||
description: 'step-2模型的实验版本,包含最新的特性,滚动更新中。不推荐在正式生产环境使用。',
|
||||
displayName: 'Step 2 16K Exp',
|
||||
functionCall: true,
|
||||
id: 'step-2-16k-exp',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8000,
|
||||
description: '小型视觉模型,适合基本的图文任务。',
|
||||
displayName: 'Step 1V 8K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'step-1v-8k',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description: '支持视觉输入,增强多模态交互体验。',
|
||||
displayName: 'Step 1V 32K',
|
||||
functionCall: true,
|
||||
id: 'step-1v-32k',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description: '该模型拥有强大的图像理解能力。相比于 step-1v 系列模型,拥有更强的视觉性能。',
|
||||
displayName: 'Step 1o Vision 32K',
|
||||
enabled: true,
|
||||
id: 'step-1o-vision-32k',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_000,
|
||||
description: '该模型拥有强大的视频理解能力。',
|
||||
displayName: 'Step 1.5V Mini',
|
||||
enabled: true,
|
||||
id: 'step-1.5v-mini',
|
||||
vision: true,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'step-2-mini',
|
||||
description:
|
||||
'阶级星辰大模型具备行业领先的多模态及复杂推理能力,支持超长文本理解和强大的自主调度搜索引擎功能。',
|
||||
|
||||
@@ -2,24 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref :https://ai-maas.wair.ac.cn/#/doc
|
||||
const Taichu: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: '基于海量高质数据训练,具有更强的文本理解、内容创作、对话问答等能力',
|
||||
displayName: 'Taichu 2.0',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'taichu_llm',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: '融合了图像理解、知识迁移、逻辑归因等能力,在图文问答领域表现突出',
|
||||
displayName: 'Taichu 2.0V',
|
||||
enabled: true,
|
||||
id: 'taichu2_mm',
|
||||
vision: true,
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'taichu_llm',
|
||||
description:
|
||||
'中科院自动化研究所和武汉人工智能研究院推出新一代多模态大模型,支持多轮问答、文本创作、图像生成、3D理解、信号分析等全面问答任务,拥有更强的认知、理解、创作能力,带来全新互动体验。',
|
||||
|
||||
@@ -3,280 +3,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
// ref: https://docs.together.ai/docs/chat-models
|
||||
// ref: https://www.together.ai/pricing
|
||||
const TogetherAI: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'LLaMA 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。',
|
||||
displayName: 'Llama 3.2 3B Instruct Turbo',
|
||||
enabled: true,
|
||||
id: 'meta-llama/Llama-3.2-3B-Instruct-Turbo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'LLaMA 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。',
|
||||
displayName: 'Llama 3.2 11B Vision Instruct Turbo (Free)',
|
||||
enabled: true,
|
||||
id: 'meta-llama/Llama-Vision-Free',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'LLaMA 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。',
|
||||
displayName: 'Llama 3.2 11B Vision Instruct Turbo',
|
||||
id: 'meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'LLaMA 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。',
|
||||
displayName: 'Llama 3.2 90B Vision Instruct Turbo',
|
||||
enabled: true,
|
||||
id: 'meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Llama 3.1 8B 模型采用FP8量化,支持高达131,072个上下文标记,是开源模型中的佼佼者,适合复杂任务,表现优异于许多行业基准。',
|
||||
displayName: 'Llama 3.1 8B Instruct Turbo',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'Llama 3.1 70B 模型经过精细调整,适用于高负载应用,量化至FP8提供更高效的计算能力和准确性,确保在复杂场景中的卓越表现。',
|
||||
displayName: 'Llama 3.1 70B Instruct Turbo',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 130_815,
|
||||
description:
|
||||
'405B 的 Llama 3.1 Turbo 模型,为大数据处理提供超大容量的上下文支持,在超大规模的人工智能应用中表现突出。',
|
||||
displayName: 'Llama 3.1 405B Instruct Turbo',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Llama 3.1 Nemotron 70B 是由 NVIDIA 定制的大型语言模型,旨在提高 LLM 生成的响应对用户查询的帮助程度。该模型在 Arena Hard、AlpacaEval 2 LC 和 GPT-4-Turbo MT-Bench 等基准测试中表现出色,截至 2024 年 10 月 1 日,在所有三个自动对齐基准测试中排名第一。该模型使用 RLHF(特别是 REINFORCE)、Llama-3.1-Nemotron-70B-Reward 和 HelpSteer2-Preference 提示在 Llama-3.1-70B-Instruct 模型基础上进行训练',
|
||||
displayName: 'Llama 3.1 Nemotron 70B',
|
||||
enabled: true,
|
||||
id: 'nvidia/Llama-3.1-Nemotron-70B-Instruct-HF',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Llama 3 8B Instruct Turbo 是一款高效能的大语言模型,支持广泛的应用场景。',
|
||||
displayName: 'Llama 3 8B Instruct Turbo',
|
||||
id: 'meta-llama/Meta-Llama-3-8B-Instruct-Turbo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Llama 3 70B Instruct Turbo 提供卓越的语言理解和生成能力,适合最苛刻的计算任务。',
|
||||
displayName: 'Llama 3 70B Instruct Turbo',
|
||||
id: 'meta-llama/Meta-Llama-3-70B-Instruct-Turbo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Llama 3 8B Instruct Lite 适合资源受限的环境,提供出色的平衡性能。',
|
||||
displayName: 'Llama 3 8B Instruct Lite',
|
||||
id: 'meta-llama/Meta-Llama-3-8B-Instruct-Lite',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Llama 3 70B Instruct Lite 适合需要高效能和低延迟的环境。',
|
||||
displayName: 'Llama 3 70B Instruct Lite',
|
||||
id: 'meta-llama/Meta-Llama-3-70B-Instruct-Lite',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Llama 3 8B Instruct Reference 提供多语言支持,涵盖丰富的领域知识。',
|
||||
displayName: 'Llama 3 8B Instruct Reference',
|
||||
id: 'meta-llama/Llama-3-8b-chat-hf',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Llama 3 70B Instruct Reference 是功能强大的聊天模型,支持复杂的对话需求。',
|
||||
displayName: 'Llama 3 70B Instruct Reference',
|
||||
id: 'meta-llama/Llama-3-70b-chat-hf',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'LLaMA-2 Chat (13B) 提供优秀的语言处理能力和出色的交互体验。',
|
||||
displayName: 'LLaMA-2 Chat (13B)',
|
||||
id: 'meta-llama/Llama-2-13b-chat-hf',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'LLaMA-2 提供优秀的语言处理能力和出色的交互体验。',
|
||||
displayName: 'LLaMA-2 (70B)',
|
||||
id: 'meta-llama/Llama-2-70b-hf',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description:
|
||||
'Code Llama 是一款专注于代码生成和讨论的 LLM,结合广泛的编程语言支持,适用于开发者环境。',
|
||||
displayName: 'CodeLlama 34B Instruct',
|
||||
id: 'codellama/CodeLlama-34b-Instruct-hf',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Gemma 2 9B 由Google开发,提供高效的指令响应和综合能力。',
|
||||
displayName: 'Gemma 2 9B',
|
||||
enabled: true,
|
||||
id: 'google/gemma-2-9b-it',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Gemma 2 27B 是一款通用大语言模型,具有优异的性能和广泛的应用场景。',
|
||||
displayName: 'Gemma 2 27B',
|
||||
enabled: true,
|
||||
id: 'google/gemma-2-27b-it',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Gemma Instruct (2B) 提供基本的指令处理能力,适合轻量级应用。',
|
||||
displayName: 'Gemma Instruct (2B)',
|
||||
id: 'google/gemma-2b-it',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Mistral (7B) Instruct v0.3 提供高效的计算能力和自然语言理解,适合广泛的应用。',
|
||||
displayName: 'Mistral (7B) Instruct v0.3',
|
||||
enabled: true,
|
||||
id: 'mistralai/Mistral-7B-Instruct-v0.3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Mistral (7B) Instruct v0.2 提供改进的指令处理能力和更精确的结果。',
|
||||
displayName: 'Mistral (7B) Instruct v0.2',
|
||||
id: 'mistralai/Mistral-7B-Instruct-v0.2',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Mistral (7B) Instruct 以高性能著称,适用于多种语言任务。',
|
||||
displayName: 'Mistral (7B) Instruct',
|
||||
functionCall: true,
|
||||
id: 'mistralai/Mistral-7B-Instruct-v0.1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'Mistral 7B是一款紧凑但高性能的模型,擅长批量处理和简单任务,如分类和文本生成,具有良好的推理能力。',
|
||||
displayName: 'Mistral (7B)',
|
||||
id: 'mistralai/Mistral-7B-v0.1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Mixtral-8x7B Instruct (46.7B) 提供高容量的计算框架,适合大规模数据处理。',
|
||||
displayName: 'Mixtral-8x7B Instruct (46.7B)',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Mixtral 8x7B是一个稀疏专家模型,利用多个参数提高推理速度,适合处理多语言和代码生成任务。',
|
||||
displayName: 'Mixtral-8x7B (46.7B)',
|
||||
id: 'mistralai/Mixtral-8x7B-v0.1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description: 'Mixtral-8x22B Instruct (141B) 是一款超级大语言模型,支持极高的处理需求。',
|
||||
displayName: 'Mixtral-8x22B Instruct (141B)',
|
||||
enabled: true,
|
||||
id: 'mistralai/Mixtral-8x22B-Instruct-v0.1',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'WizardLM 2 是微软AI提供的语言模型,在复杂对话、多语言、推理和智能助手领域表现尤为出色。',
|
||||
displayName: 'WizardLM-2 8x22B',
|
||||
id: 'microsoft/WizardLM-2-8x22B',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'DeepSeek LLM Chat (67B) 是创新的 AI 模型 提供深度语言理解和互动能力。',
|
||||
displayName: 'DeepSeek LLM Chat (67B)',
|
||||
enabled: true,
|
||||
id: 'deepseek-ai/deepseek-llm-67b-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'QwQ模型是由 Qwen 团队开发的实验性研究模型,专注于增强 AI 推理能力。',
|
||||
displayName: 'QwQ 32B Preview',
|
||||
enabled: true,
|
||||
id: 'Qwen/QwQ-32B-Preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Qwen2.5 是全新的大型语言模型系列,旨在优化指令式任务的处理。',
|
||||
displayName: 'Qwen 2.5 7B Instruct Turbo',
|
||||
enabled: true,
|
||||
id: 'Qwen/Qwen2.5-7B-Instruct-Turbo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Qwen2.5 是全新的大型语言模型系列,旨在优化指令式任务的处理。',
|
||||
displayName: 'Qwen 2.5 72B Instruct Turbo',
|
||||
enabled: true,
|
||||
id: 'Qwen/Qwen2.5-72B-Instruct-Turbo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Qwen2.5 Coder 32B Instruct 是阿里云发布的代码特定大语言模型系列的最新版本。该模型在 Qwen2.5 的基础上,通过 5.5 万亿个 tokens 的训练,显著提升了代码生成、推理和修复能力。它不仅增强了编码能力,还保持了数学和通用能力的优势。模型为代码智能体等实际应用提供了更全面的基础',
|
||||
displayName: 'Qwen 2.5 Coder 32B Instruct',
|
||||
id: 'Qwen/Qwen2.5-Coder-32B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Qwen 2 Instruct (72B) 为企业级应用提供精准的指令理解和响应。',
|
||||
displayName: 'Qwen 2 Instruct (72B)',
|
||||
id: 'Qwen/Qwen2-72B-Instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'DBRX Instruct 提供高可靠性的指令处理能力,支持多行业应用。',
|
||||
displayName: 'DBRX Instruct',
|
||||
id: 'databricks/dbrx-instruct',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'Upstage SOLAR Instruct v1 (11B) 适用于精细化指令任务,提供出色的语言处理能力。',
|
||||
displayName: 'Upstage SOLAR Instruct v1 (11B)',
|
||||
id: 'upstage/SOLAR-10.7B-Instruct-v1.0',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'Nous Hermes 2 - Mixtral 8x7B-DPO (46.7B) 是高精度的指令模型,适用于复杂计算。',
|
||||
displayName: 'Nous Hermes 2 - Mixtral 8x7B-DPO (46.7B)',
|
||||
id: 'NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'MythoMax-L2 (13B) 是一种创新模型,适合多领域应用和复杂任务。',
|
||||
displayName: 'MythoMax-L2 (13B)',
|
||||
id: 'Gryphe/MythoMax-L2-13b',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: 'StripedHyena Nous (7B) 通过高效的策略和模型架构,提供增强的计算能力。',
|
||||
displayName: 'StripedHyena Nous (7B)',
|
||||
id: 'togethercomputer/StripedHyena-Nous-7B',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'meta-llama/Llama-Vision-Free',
|
||||
description:
|
||||
'Together AI 致力于通过创新的 AI 模型实现领先的性能,提供广泛的自定义能力,包括快速扩展支持和直观的部署流程,满足企业的各种需求。',
|
||||
|
||||
@@ -2,34 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref :https://developers.upstage.ai/docs/getting-started/models
|
||||
const Upstage: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Solar Mini 是一种紧凑型 LLM,性能优于 GPT-3.5,具备强大的多语言能力,支持英语和韩语,提供高效小巧的解决方案。',
|
||||
displayName: 'Solar Mini',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'solar-1-mini-chat',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Solar Mini (Ja) 扩展了 Solar Mini 的能力,专注于日语,同时在英语和韩语的使用中保持高效和卓越性能。',
|
||||
displayName: 'Solar Mini (Ja)',
|
||||
functionCall: false,
|
||||
id: 'solar-1-mini-chat-ja',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'Solar Pro 是 Upstage 推出的一款高智能LLM,专注于单GPU的指令跟随能力,IFEval得分80以上。目前支持英语,正式版本计划于2024年11月推出,将扩展语言支持和上下文长度。',
|
||||
displayName: 'Solar Pro',
|
||||
enabled: true,
|
||||
functionCall: false,
|
||||
id: 'solar-pro',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'solar-1-mini-chat',
|
||||
description:
|
||||
'Upstage 专注于为各种商业需求开发AI模型,包括 Solar LLM 和文档 AI,旨在实现工作的人造通用智能(AGI)。通过 Chat API 创建简单的对话代理,并支持功能调用、翻译、嵌入以及特定领域应用。',
|
||||
|
||||
@@ -2,146 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu
|
||||
const BaiduWenxin: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'百度自研的旗舰级大规模⼤语⾔模型,覆盖海量中英文语料,具有强大的通用能力,可满足绝大部分对话问答、创作生成、插件应用场景要求;支持自动对接百度搜索插件,保障问答信息时效。',
|
||||
displayName: 'ERNIE 3.5 8K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'ernie-3.5-8k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'百度自研的旗舰级大规模⼤语⾔模型,覆盖海量中英文语料,具有强大的通用能力,可满足绝大部分对话问答、创作生成、插件应用场景要求;支持自动对接百度搜索插件,保障问答信息时效。',
|
||||
displayName: 'ERNIE 3.5 8K Preview',
|
||||
functionCall: true,
|
||||
id: 'ernie-3.5-8k-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'百度自研的旗舰级大规模⼤语⾔模型,覆盖海量中英文语料,具有强大的通用能力,可满足绝大部分对话问答、创作生成、插件应用场景要求;支持自动对接百度搜索插件,保障问答信息时效。',
|
||||
displayName: 'ERNIE 3.5 128K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'ernie-3.5-128k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'百度自研的旗舰级超大规模⼤语⾔模型,相较ERNIE 3.5实现了模型能力全面升级,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。',
|
||||
displayName: 'ERNIE 4.0 8K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'ernie-4.0-8k-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'百度自研的旗舰级超大规模⼤语⾔模型,相较ERNIE 3.5实现了模型能力全面升级,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。',
|
||||
displayName: 'ERNIE 4.0 8K Preview',
|
||||
functionCall: true,
|
||||
id: 'ernie-4.0-8k-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀',
|
||||
displayName: 'ERNIE 4.0 Turbo 8K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'ernie-4.0-turbo-8k-latest',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀',
|
||||
displayName: 'ERNIE 4.0 Turbo 128K',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'ernie-4.0-turbo-128k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀',
|
||||
displayName: 'ERNIE 4.0 Turbo 8K Preview',
|
||||
functionCall: true,
|
||||
id: 'ernie-4.0-turbo-8k-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'ERNIE Lite是百度自研的轻量级大语言模型,兼顾优异的模型效果与推理性能,适合低算力AI加速卡推理使用。',
|
||||
displayName: 'ERNIE Lite 8K',
|
||||
id: 'ernie-lite-8k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'百度自研的轻量级大语言模型,兼顾优异的模型效果与推理性能,效果比ERNIE Lite更优,适合低算力AI加速卡推理使用。',
|
||||
displayName: 'ERNIE Lite Pro 128K',
|
||||
functionCall: true,
|
||||
id: 'ernie-lite-pro-128k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'ERNIE Tiny是百度自研的超高性能大语言模型,部署与精调成本在文心系列模型中最低。',
|
||||
displayName: 'ERNIE Tiny 8K',
|
||||
id: 'ernie-tiny-8k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'百度2024年最新发布的自研高性能大语言模型,通用能力优异,适合作为基座模型进行精调,更好地处理特定场景问题,同时具备极佳的推理性能。',
|
||||
displayName: 'ERNIE Speed 128K',
|
||||
id: 'ernie-speed-128k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'百度2024年最新发布的自研高性能大语言模型,通用能力优异,效果比ERNIE Speed更优,适合作为基座模型进行精调,更好地处理特定场景问题,同时具备极佳的推理性能。',
|
||||
displayName: 'ERNIE Speed Pro 128K',
|
||||
id: 'ernie-speed-pro-128k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'百度自研的垂直场景大语言模型,适合游戏NPC、客服对话、对话角色扮演等应用场景,人设风格更为鲜明、一致,指令遵循能力更强,推理性能更优。',
|
||||
displayName: 'ERNIE Character 8K',
|
||||
id: 'ernie-char-8k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'百度自研的垂直场景大语言模型,适合游戏NPC、客服对话、对话角色扮演等应用场景,人设风格更为鲜明、一致,指令遵循能力更强,推理性能更优。',
|
||||
displayName: 'ERNIE Character Fiction 8K',
|
||||
id: 'ernie-char-fiction-8k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: '百度自研通用大语言模型,在小说续写能力上有明显优势,也可用在短剧、电影等场景。',
|
||||
displayName: 'ERNIE Novel 8K',
|
||||
id: 'ernie-novel-8k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek-V3 为杭州深度求索人工智能基础技术研究有限公司自研的 MoE 模型,其多项评测成绩突出,在主流榜单中位列开源模型榜首。V3 相比 V2.5 模型生成速度实现 3 倍提升,为用户带来更加迅速流畅的使用体验。',
|
||||
displayName: 'DeepSeek V3',
|
||||
id: 'deepseek-v3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 65_536,
|
||||
description:
|
||||
'DeepSeek-R1 在后训练阶段大规模使用了强化学习技术,在仅有极少标注数据的情况下,极大提升了模型推理能力。在数学、代码、自然语言推理等任务上,性能比肩 OpenAI o1 正式版。',
|
||||
displayName: 'DeepSeek R1',
|
||||
id: 'deepseek-r1',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'ernie-speed-128k',
|
||||
description:
|
||||
'企业级一站式大模型与AI原生应用开发及服务平台,提供最全面易用的生成式人工智能模型开发、应用开发全流程工具链',
|
||||
|
||||
@@ -2,87 +2,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
|
||||
// ref: https://platform.lingyiwanwu.com/docs#%E6%A8%A1%E5%9E%8B%E4%B8%8E%E8%AE%A1%E8%B4%B9
|
||||
const ZeroOne: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description: '最新高性能模型,保证高质量输出同时,推理速度大幅提升。',
|
||||
displayName: 'Yi Lightning',
|
||||
enabled: true,
|
||||
id: 'yi-lightning',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description: '复杂视觉任务模型,提供基于多张图片的高性能理解、分析能力。',
|
||||
displayName: 'Yi Vision V2',
|
||||
enabled: true,
|
||||
id: 'yi-vision-v2',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description: '小而精悍,轻量极速模型。提供强化数学运算和代码编写能力。',
|
||||
displayName: 'Yi Spark',
|
||||
id: 'yi-spark',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description: '中型尺寸模型升级微调,能力均衡,性价比高。深度优化指令遵循能力。',
|
||||
displayName: 'Yi Medium',
|
||||
id: 'yi-medium',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 200_000,
|
||||
description: '200K 超长上下文窗口,提供长文本深度理解和生成能力。',
|
||||
displayName: 'Yi Medium 200K',
|
||||
id: 'yi-medium-200k',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description: '超高性价比、卓越性能。根据性能和推理速度、成本,进行平衡性高精度调优。',
|
||||
displayName: 'Yi Large Turbo',
|
||||
id: 'yi-large-turbo',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description:
|
||||
'基于 yi-large 超强模型的高阶服务,结合检索与生成技术提供精准答案,实时全网检索信息服务。',
|
||||
displayName: 'Yi Large RAG',
|
||||
id: 'yi-large-rag',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'在 yi-large 模型的基础上支持并强化了工具调用的能力,适用于各种需要搭建 agent 或 workflow 的业务场景。',
|
||||
displayName: 'Yi Large FC',
|
||||
functionCall: true,
|
||||
id: 'yi-large-fc',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 32_768,
|
||||
description: '全新千亿参数模型,提供超强问答及文本生成能力。',
|
||||
displayName: 'Yi Large',
|
||||
id: 'yi-large',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description: '复杂视觉任务模型,提供高性能图片理解、分析能力。',
|
||||
displayName: 'Yi Vision',
|
||||
id: 'yi-vision',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description: '初期版本,推荐使用 yi-large(新版本)。',
|
||||
displayName: 'Yi Large Preview',
|
||||
id: 'yi-large-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description: '轻量化版本,推荐使用 yi-lightning。',
|
||||
displayName: 'Yi Lightning Lite',
|
||||
id: 'yi-lightning-lite',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'yi-lightning',
|
||||
description:
|
||||
'零一万物致力于推动以人为本的AI 2.0技术革命,旨在通过大语言模型创造巨大的经济和社会价值,并开创新的AI生态与商业模式。',
|
||||
|
||||
@@ -4,128 +4,7 @@ import { ModelProviderCard } from '@/types/llm';
|
||||
// api https://open.bigmodel.cn/dev/api#language
|
||||
// ref :https://open.bigmodel.cn/modelcenter/square
|
||||
const ZhiPu: ModelProviderCard = {
|
||||
chatModels: [
|
||||
{
|
||||
contextWindowTokens: 16_384,
|
||||
description: 'GLM-Zero-Preview具备强大的复杂推理能力,在逻辑推理、数学、编程等领域表现优异。',
|
||||
displayName: 'GLM-Zero-Preview',
|
||||
id: 'glm-zero-preview',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'GLM-4-Flash 是处理简单任务的理想选择,速度最快且免费。',
|
||||
displayName: 'GLM-4-Flash',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'glm-4-flash',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'GLM-4-FlashX 是Flash的增强版本,超快推理速度。',
|
||||
displayName: 'GLM-4-FlashX',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'glm-4-flashx',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 1_024_000,
|
||||
description: 'GLM-4-Long 支持超长文本输入,适合记忆型任务与大规模文档处理。',
|
||||
displayName: 'GLM-4-Long',
|
||||
functionCall: true,
|
||||
id: 'glm-4-long',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'GLM-4-Air 是性价比高的版本,性能接近GLM-4,提供快速度和实惠的价格。',
|
||||
displayName: 'GLM-4-Air',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'glm-4-air',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'GLM-4-AirX 提供 GLM-4-Air 的高效版本,推理速度可达其2.6倍。',
|
||||
displayName: 'GLM-4-AirX',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'glm-4-airx',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'GLM-4-AllTools 是一个多功能智能体模型,优化以支持复杂指令规划与工具调用,如网络浏览、代码解释和文本生成,适用于多任务执行。',
|
||||
displayName: 'GLM-4-AllTools',
|
||||
functionCall: true,
|
||||
id: 'glm-4-alltools',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'GLM-4-Plus 作为高智能旗舰,具备强大的处理长文本和复杂任务的能力,性能全面提升。',
|
||||
displayName: 'GLM-4-Plus',
|
||||
enabled: true,
|
||||
functionCall: true,
|
||||
id: 'glm-4-plus',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'GLM-4-0520 是最新模型版本,专为高度复杂和多样化任务设计,表现卓越。',
|
||||
displayName: 'GLM-4-0520',
|
||||
functionCall: true,
|
||||
id: 'glm-4-0520',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description: 'GLM-4 是发布于2024年1月的旧旗舰版本,目前已被更强的 GLM-4-0520 取代。',
|
||||
displayName: 'GLM-4',
|
||||
functionCall: true,
|
||||
id: 'glm-4',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description:
|
||||
'GLM-4V-Flash 专注于高效的单一图像理解,适用于快速图像解析的场景,例如实时图像分析或批量图像处理。',
|
||||
displayName: 'GLM-4V-Flash',
|
||||
enabled: true,
|
||||
id: 'glm-4v-flash',
|
||||
releasedAt: '2024-12-09',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'GLM-4V-Plus 具备对视频内容及多图片的理解能力,适合多模态任务。',
|
||||
displayName: 'GLM-4V-Plus',
|
||||
enabled: true,
|
||||
id: 'glm-4v-plus',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 2048,
|
||||
description: 'GLM-4V 提供强大的图像理解与推理能力,支持多种视觉任务。',
|
||||
displayName: 'GLM-4V',
|
||||
id: 'glm-4v',
|
||||
vision: true,
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 128_000,
|
||||
description:
|
||||
'CodeGeeX-4 是强大的AI编程助手,支持多种编程语言的智能问答与代码补全,提升开发效率。',
|
||||
displayName: 'CodeGeeX-4',
|
||||
id: 'codegeex-4',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 4096,
|
||||
description: 'CharGLM-3 专为角色扮演与情感陪伴设计,支持超长多轮记忆与个性化对话,应用广泛。',
|
||||
displayName: 'CharGLM-3',
|
||||
id: 'charglm-3',
|
||||
},
|
||||
{
|
||||
contextWindowTokens: 8192,
|
||||
description: 'Emohaa 是心理模型,具备专业咨询能力,帮助用户理解情感问题。',
|
||||
displayName: 'Emohaa',
|
||||
id: 'emohaa',
|
||||
},
|
||||
],
|
||||
chatModels: [],
|
||||
checkModel: 'glm-4-flash-250414',
|
||||
description:
|
||||
'智谱 AI 提供多模态与语言模型的开放平台,支持广泛的AI应用场景,包括文本处理、图像理解与编程辅助等。',
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
import Dexie from 'dexie';
|
||||
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
import { BrowserDB } from '../db';
|
||||
import { dbSchemaV3 } from '../schemas';
|
||||
import { LOBE_CHAT_LOCAL_DB_NAME } from '../types/db';
|
||||
|
||||
beforeEach(async () => {
|
||||
// 确保在测试开始前删除数据库
|
||||
await Dexie.delete(LOBE_CHAT_LOCAL_DB_NAME);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
// 确保在测试结束后删除数据库
|
||||
await Dexie.delete(LOBE_CHAT_LOCAL_DB_NAME);
|
||||
});
|
||||
|
||||
describe('LocalDB migration', () => {
|
||||
it('should upgrade from version 3 to version 4 correctly', async () => {
|
||||
// 使用版本3的schema创建数据库实例并填充测试数据
|
||||
const dbV3 = new Dexie(LOBE_CHAT_LOCAL_DB_NAME);
|
||||
dbV3.version(3).stores(dbSchemaV3);
|
||||
await dbV3.open();
|
||||
await dbV3.table('sessions').bulkAdd([
|
||||
{ id: 's1', group: 'pinned' },
|
||||
{ id: 's2', group: 'default' },
|
||||
]);
|
||||
dbV3.close();
|
||||
|
||||
// 创建新的数据库实例,包含版本4的迁移逻辑
|
||||
const dbV4 = new BrowserDB();
|
||||
await dbV4.open();
|
||||
|
||||
// 验证迁移后的数据
|
||||
const updatedSession1 = await dbV4.sessions.get('s1');
|
||||
const updatedSession2 = await dbV4.sessions.get('s2');
|
||||
expect(updatedSession1).toEqual({ id: 's1', pinned: 1, group: 'default' });
|
||||
expect(updatedSession2).toEqual({ id: 's2', pinned: 0, group: 'default' });
|
||||
|
||||
dbV4.close();
|
||||
});
|
||||
});
|
||||
@@ -1,79 +0,0 @@
|
||||
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
import { DB_File } from '../../schemas/files';
|
||||
import { BrowserDB } from '../db';
|
||||
import { DBModel } from '../types/db';
|
||||
|
||||
describe('LocalDB', () => {
|
||||
let db: BrowserDB;
|
||||
|
||||
beforeEach(() => {
|
||||
db = new BrowserDB();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await db.delete();
|
||||
db.close();
|
||||
});
|
||||
|
||||
it('should be instantiated with the correct schema', () => {
|
||||
const filesTable = db.files;
|
||||
|
||||
expect(filesTable).toBeDefined();
|
||||
});
|
||||
|
||||
it('should allow adding a file', async () => {
|
||||
const file: DBModel<DB_File> = {
|
||||
id: 'file1',
|
||||
name: 'testfile.txt',
|
||||
data: new ArrayBuffer(3),
|
||||
saveMode: 'local',
|
||||
fileType: 'plain/text',
|
||||
size: 3,
|
||||
createdAt: Date.now(),
|
||||
updatedAt: Date.now(),
|
||||
};
|
||||
|
||||
await db.files.add(file);
|
||||
|
||||
expect(await db.files.get(file.id)).toEqual(file);
|
||||
});
|
||||
|
||||
it('should allow updating a file', async () => {
|
||||
const file: DBModel<DB_File> = {
|
||||
id: 'file1',
|
||||
name: 'testfile.txt',
|
||||
data: new ArrayBuffer(3),
|
||||
saveMode: 'local',
|
||||
fileType: 'plain/text',
|
||||
size: 3,
|
||||
createdAt: Date.now(),
|
||||
updatedAt: Date.now(),
|
||||
};
|
||||
await db.files.add(file);
|
||||
|
||||
// Act
|
||||
await db.files.update(file.id, { name: 'update.txt' });
|
||||
|
||||
// Assert
|
||||
expect(await db.files.get(file.id)).toHaveProperty('name', 'update.txt');
|
||||
});
|
||||
|
||||
it('should allow deleting a file', async () => {
|
||||
const file: DBModel<DB_File> = {
|
||||
id: 'file1',
|
||||
name: 'testfile.txt',
|
||||
data: new ArrayBuffer(3),
|
||||
saveMode: 'local',
|
||||
fileType: 'plain/text',
|
||||
size: 3,
|
||||
updatedAt: Date.now(),
|
||||
createdAt: Date.now(),
|
||||
};
|
||||
await db.files.add(file);
|
||||
|
||||
await db.files.delete(file.id);
|
||||
|
||||
expect(await db.files.get(file.id)).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -1,55 +0,0 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { BaseModel } from '../model';
|
||||
|
||||
// Define a mock schema for testing
|
||||
const mockSchema = z.object({
|
||||
name: z.string(),
|
||||
content: z.string(),
|
||||
});
|
||||
|
||||
// Define a mock table name
|
||||
const mockTableName = 'files';
|
||||
|
||||
describe('BaseModel', () => {
|
||||
let baseModel: BaseModel<typeof mockTableName>;
|
||||
|
||||
beforeEach(() => {
|
||||
baseModel = new BaseModel(mockTableName, mockSchema);
|
||||
// Mock the console.error to test error logging
|
||||
vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
// console.error = originalConsoleError;
|
||||
});
|
||||
|
||||
it('should have a table property', () => {
|
||||
expect(baseModel.table).toBeDefined();
|
||||
});
|
||||
|
||||
describe('add method', () => {
|
||||
it('should add a valid record to the database', async () => {
|
||||
const validData = {
|
||||
name: 'testfile.txt',
|
||||
content: 'Hello, World!',
|
||||
};
|
||||
|
||||
const result = await baseModel['_addWithSync'](validData);
|
||||
|
||||
expect(result).toHaveProperty('id');
|
||||
expect(console.error).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should throw an error and log to console when adding an invalid record', async () => {
|
||||
const invalidData = {
|
||||
name: 123, // Invalid type, should be a string
|
||||
content: 'Hello, World!',
|
||||
};
|
||||
|
||||
await expect(baseModel['_addWithSync'](invalidData)).rejects.toThrow(TypeError);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,246 +0,0 @@
|
||||
import Dexie, { Transaction } from 'dexie';
|
||||
|
||||
import { MigrationLLMSettings } from '@/migrations/FromV3ToV4';
|
||||
import { MigrationAgentChatConfig } from '@/migrations/FromV5ToV6';
|
||||
import { MigrationKeyValueSettings } from '@/migrations/FromV6ToV7';
|
||||
import { uuid } from '@/utils/uuid';
|
||||
|
||||
import { DB_File } from '../schemas/files';
|
||||
import { DB_Message } from '../schemas/message';
|
||||
import { DB_Plugin } from '../schemas/plugin';
|
||||
import { DB_Session } from '../schemas/session';
|
||||
import { DB_SessionGroup } from '../schemas/sessionGroup';
|
||||
import { DB_Topic } from '../schemas/topic';
|
||||
import { DB_User } from '../schemas/user';
|
||||
import { migrateSettingsToUser } from './migrations/migrateSettingsToUser';
|
||||
import {
|
||||
dbSchemaV1,
|
||||
dbSchemaV2,
|
||||
dbSchemaV3,
|
||||
dbSchemaV4,
|
||||
dbSchemaV5,
|
||||
dbSchemaV6,
|
||||
dbSchemaV7,
|
||||
dbSchemaV9,
|
||||
} from './schemas';
|
||||
import { DBModel, LOBE_CHAT_LOCAL_DB_NAME } from './types/db';
|
||||
|
||||
export interface LobeDBSchemaMap {
|
||||
files: DB_File;
|
||||
messages: DB_Message;
|
||||
plugins: DB_Plugin;
|
||||
sessionGroups: DB_SessionGroup;
|
||||
sessions: DB_Session;
|
||||
topics: DB_Topic;
|
||||
users: DB_User;
|
||||
}
|
||||
|
||||
// Define a local DB
|
||||
export class BrowserDB extends Dexie {
|
||||
public files: BrowserDBTable<'files'>;
|
||||
public sessions: BrowserDBTable<'sessions'>;
|
||||
public messages: BrowserDBTable<'messages'>;
|
||||
public topics: BrowserDBTable<'topics'>;
|
||||
public plugins: BrowserDBTable<'plugins'>;
|
||||
public sessionGroups: BrowserDBTable<'sessionGroups'>;
|
||||
public users: BrowserDBTable<'users'>;
|
||||
|
||||
constructor() {
|
||||
super(LOBE_CHAT_LOCAL_DB_NAME);
|
||||
this.version(1).stores(dbSchemaV1);
|
||||
this.version(2).stores(dbSchemaV2);
|
||||
this.version(3).stores(dbSchemaV3);
|
||||
this.version(4)
|
||||
.stores(dbSchemaV4)
|
||||
.upgrade((trans) => this.upgradeToV4(trans));
|
||||
|
||||
this.version(5)
|
||||
.stores(dbSchemaV5)
|
||||
.upgrade((trans) => this.upgradeToV5(trans));
|
||||
|
||||
this.version(6)
|
||||
.stores(dbSchemaV6)
|
||||
.upgrade((trans) => this.upgradeToV6(trans));
|
||||
|
||||
this.version(7)
|
||||
.stores(dbSchemaV7)
|
||||
.upgrade((trans) => this.upgradeToV7(trans));
|
||||
|
||||
this.version(8)
|
||||
.stores(dbSchemaV7)
|
||||
.upgrade((trans) => this.upgradeToV8(trans));
|
||||
|
||||
this.version(9)
|
||||
.stores(dbSchemaV9)
|
||||
.upgrade((trans) => this.upgradeToV9(trans));
|
||||
|
||||
this.version(10)
|
||||
.stores(dbSchemaV9)
|
||||
.upgrade((trans) => this.upgradeToV10(trans));
|
||||
|
||||
this.version(11)
|
||||
.stores(dbSchemaV9)
|
||||
.upgrade((trans) => this.upgradeToV11(trans));
|
||||
|
||||
this.files = this.table('files');
|
||||
this.sessions = this.table('sessions');
|
||||
this.messages = this.table('messages');
|
||||
this.topics = this.table('topics');
|
||||
this.plugins = this.table('plugins');
|
||||
this.sessionGroups = this.table('sessionGroups');
|
||||
this.users = this.table('users');
|
||||
}
|
||||
|
||||
/**
|
||||
* 2024.01.22
|
||||
*
|
||||
* DB V3 to V4
|
||||
* from `group = pinned` to `pinned:true`
|
||||
*/
|
||||
upgradeToV4 = async (trans: Transaction) => {
|
||||
const sessions = trans.table('sessions');
|
||||
await sessions.toCollection().modify((session) => {
|
||||
// translate boolean to number
|
||||
session.pinned = session.group === 'pinned' ? 1 : 0;
|
||||
session.group = 'default';
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 2024.01.29
|
||||
* settings from localStorage to indexedDB
|
||||
*/
|
||||
upgradeToV5 = async (trans: Transaction) => {
|
||||
const users = trans.table('users');
|
||||
|
||||
// if no user, create one
|
||||
if ((await users.count()) === 0) {
|
||||
const data = localStorage.getItem('LOBE_SETTINGS');
|
||||
|
||||
if (data) {
|
||||
let json;
|
||||
|
||||
try {
|
||||
json = JSON.parse(data);
|
||||
} catch {
|
||||
/* empty */
|
||||
}
|
||||
|
||||
if (!json?.state?.settings) return;
|
||||
|
||||
const settings = json.state.settings;
|
||||
|
||||
const user = migrateSettingsToUser(settings);
|
||||
await users.add(user);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 2024.02.27
|
||||
* add uuid to user
|
||||
*/
|
||||
upgradeToV6 = async (trans: Transaction) => {
|
||||
const users = trans.table('users');
|
||||
|
||||
await users.toCollection().modify((user: DB_User) => {
|
||||
if (!user.uuid) user.uuid = uuid();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 2024.03.14
|
||||
* add `id` in plugins
|
||||
*/
|
||||
upgradeToV7 = async (trans: Transaction) => {
|
||||
const plugins = trans.table('plugins');
|
||||
|
||||
await plugins.toCollection().modify((plugin: DB_Plugin) => {
|
||||
plugin.id = plugin.identifier;
|
||||
});
|
||||
};
|
||||
|
||||
upgradeToV8 = async (trans: Transaction) => {
|
||||
const users = trans.table('users');
|
||||
await users.toCollection().modify((user: DB_User) => {
|
||||
if (user.settings) {
|
||||
user.settings = MigrationLLMSettings.migrateSettings(user.settings as any);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 2024.05.11
|
||||
*
|
||||
* message role=function to role=tool
|
||||
*/
|
||||
upgradeToV9 = async (trans: Transaction) => {
|
||||
const messages = trans.table('messages');
|
||||
await messages.toCollection().modify(async (message: DBModel<DB_Message>) => {
|
||||
if ((message.role as string) === 'function') {
|
||||
const origin = Object.assign({}, message);
|
||||
|
||||
const toolCallId = `tool_call_${message.id}`;
|
||||
const assistantMessageId = `tool_calls_${message.id}`;
|
||||
|
||||
message.role = 'tool';
|
||||
message.tool_call_id = toolCallId;
|
||||
message.parentId = assistantMessageId;
|
||||
|
||||
await messages.add({
|
||||
...origin,
|
||||
content: '',
|
||||
createdAt: message.createdAt - 10,
|
||||
error: undefined,
|
||||
id: assistantMessageId,
|
||||
role: 'assistant',
|
||||
tools: [{ ...message.plugin!, id: toolCallId }],
|
||||
updatedAt: message.updatedAt - 10,
|
||||
} as DBModel<DB_Message>);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 2024.05.25
|
||||
* migrate some agent config to chatConfig
|
||||
*/
|
||||
upgradeToV10 = async (trans: Transaction) => {
|
||||
const sessions = trans.table('sessions');
|
||||
await sessions.toCollection().modify(async (session: DBModel<DB_Session>) => {
|
||||
if (session.config)
|
||||
session.config = MigrationAgentChatConfig.migrateChatConfig(session.config as any);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 2024.05.27
|
||||
* migrate apiKey in languageModel to keyVaults
|
||||
*/
|
||||
upgradeToV11 = async (trans: Transaction) => {
|
||||
const users = trans.table('users');
|
||||
|
||||
await users.toCollection().modify((user: DB_User) => {
|
||||
if (user.settings) {
|
||||
user.settings = MigrationKeyValueSettings.migrateSettings(user.settings as any);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export const browserDB = new BrowserDB();
|
||||
|
||||
// ================================================ //
|
||||
// ================================================ //
|
||||
// ================================================ //
|
||||
// ================================================ //
|
||||
// ================================================ //
|
||||
|
||||
// types helper
|
||||
export type BrowserDBSchema = {
|
||||
[t in keyof LobeDBSchemaMap]: {
|
||||
model: LobeDBSchemaMap[t];
|
||||
table: Dexie.Table<DBModel<LobeDBSchemaMap[t]>, string>;
|
||||
};
|
||||
};
|
||||
type BrowserDBTable<T extends keyof LobeDBSchemaMap> = BrowserDBSchema[T]['table'];
|
||||
@@ -1,3 +0,0 @@
|
||||
export { browserDB } from './db';
|
||||
export * from './model';
|
||||
export { dataSync } from './sync';
|
||||
@@ -1,55 +0,0 @@
|
||||
{
|
||||
"avatar": "",
|
||||
"defaultAgent": {
|
||||
"config": {
|
||||
"autoCreateTopicThreshold": 2,
|
||||
"displayMode": "chat",
|
||||
"enableAutoCreateTopic": true,
|
||||
"historyCount": 1,
|
||||
"model": "gpt-3.5-turbo-1106",
|
||||
"params": {
|
||||
"frequency_penalty": 0,
|
||||
"presence_penalty": 0,
|
||||
"temperature": 0.7,
|
||||
"top_p": 0.7
|
||||
},
|
||||
"plugins": ["website-crawler"],
|
||||
"systemRole": "",
|
||||
"tts": {
|
||||
"showAllLocaleVoice": false,
|
||||
"sttLocale": "auto",
|
||||
"ttsService": "openai",
|
||||
"voice": { "openai": "alloy" }
|
||||
},
|
||||
"enableHistoryCount": true
|
||||
},
|
||||
"meta": {}
|
||||
},
|
||||
"fontSize": 14,
|
||||
"language": "auto",
|
||||
"languageModel": {
|
||||
"openAI": {
|
||||
"OPENAI_API_KEY": "dfdf",
|
||||
"models": [
|
||||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-1106",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-0125-preview",
|
||||
"gpt-4-vision-preview"
|
||||
],
|
||||
"customModelName": "+glm-4,+glm-4v",
|
||||
"endpoint": "sdaddsd"
|
||||
},
|
||||
"zhipu": { "ZHIPU_API_KEY": "", "enabled": false }
|
||||
},
|
||||
"password": "",
|
||||
"themeMode": "auto",
|
||||
"tool": { "dalle": { "autoGenerate": false } },
|
||||
"tts": {
|
||||
"openAI": { "sttModel": "whisper-1", "ttsModel": "tts-1" },
|
||||
"sttAutoStop": true,
|
||||
"sttServer": "openai"
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user