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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/renderer/components/icons/ProviderIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ export default function ProviderIcon(props: { className?: string; size?: number;
/>
</>
)}
{provider === ModelProviderEnum.Modelsell && (
<path
d="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
/>
)}
{provider === ModelProviderEnum.Azure && (
<>
<path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const FEATURED_PROVIDER_IDS: string[] = [
ModelProviderEnum.SiliconFlow,
ModelProviderEnum.DeepSeek,
ModelProviderEnum.OpenRouter,
ModelProviderEnum.Modelsell,
ModelProviderEnum.Ollama,
]

Expand Down
1 change: 1 addition & 0 deletions src/shared/models/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ describe('getModel', () => {
[ModelProviderEnum.MiniMaxCN, 'MiniMax-M2.5', 'https://api.minimaxi.com/v1'],
[ModelProviderEnum.Moonshot, 'kimi-k2.5', 'https://api.moonshot.ai/v1'],
[ModelProviderEnum.MoonshotCN, 'kimi-k2.5', 'https://api.moonshot.cn/v1'],
[ModelProviderEnum.Modelsell, 'test-model', 'https://modelsell.com/v1'],
])('returns OpenAI-compatible model instances for %s', (provider, modelId, apiHost) => {
const sessionSettings: SessionSettings = {
provider,
Expand Down
1 change: 1 addition & 0 deletions src/shared/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const aiProviderNameHash: Record<ModelProviderEnum, string> = {
[ModelProviderEnum.Perplexity]: 'Perplexity API',
[ModelProviderEnum.XAI]: 'xAI API',
[ModelProviderEnum.OpenRouter]: 'OpenRouter API',
[ModelProviderEnum.Modelsell]: 'Modelsell API',
[ModelProviderEnum.Bedrock]: 'AWS Bedrock',
[ModelProviderEnum.VercelAIGateway]: 'Vercel AI Gateway',
[ModelProviderEnum.Custom]: 'Custom Provider',
Expand Down
40 changes: 40 additions & 0 deletions src/shared/providers/definitions/modelsell.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { ModelProviderEnum, ModelProviderType } from '../../types'
import { defineProvider } from '../registry'
import OpenAI from './models/openai'

export const modelsellProvider = defineProvider({
id: ModelProviderEnum.Modelsell,
name: 'Modelsell',
type: ModelProviderType.OpenAI,
description: 'Access multiple AI models through the Modelsell OpenAI-compatible API.',
urls: {
website: 'https://modelsell.com',
apiKey: 'https://modelsell.com/console/token',
docs: 'https://modelsell.com/docs/api-reference',
models: 'https://modelsell.com/v1/models',
},
defaultSettings: {
apiHost: 'https://modelsell.com/v1',
models: [],
},
createModel: (config) => {
return new OpenAI(
{
apiKey: config.effectiveApiKey,
apiHost: config.formattedApiHost,
model: config.model,
dalleStyle: config.settings.dalleStyle || 'vivid',
temperature: config.settings.temperature,
topP: config.settings.topP,
maxOutputTokens: config.settings.maxTokens,
injectDefaultMetadata: config.globalSettings.injectDefaultMetadata,
useProxy: false,
stream: config.settings.stream,
},
config.dependencies
)
},
getDisplayName: (modelId, providerSettings) => {
return `Modelsell (${providerSettings?.models?.find((model) => model.modelId === modelId)?.nickname || modelId})`
},
})
1 change: 1 addition & 0 deletions src/shared/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import './definitions/minimax'
import './definitions/moonshot'
import './definitions/siliconflow'
import './definitions/openrouter'
import './definitions/modelsell'
import './definitions/ollama'
import './definitions/lmstudio'
import './definitions/azure'
Expand Down
1 change: 1 addition & 0 deletions src/shared/types/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export enum ModelProviderEnum {
Perplexity = 'perplexity',
XAI = 'xAI',
OpenRouter = 'openrouter',
Modelsell = 'modelsell',
Bedrock = 'bedrock',
VercelAIGateway = 'vercel-ai-gateway',
Custom = 'custom',
Expand Down