Add DeepSeek to the list of providers

This commit is contained in:
Matt Rubens
2024-12-29 08:42:03 -08:00
parent 948c66c1af
commit eb8c4cc50f
8 changed files with 438 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ export type ApiProvider =
| "lmstudio"
| "gemini"
| "openai-native"
| "deepseek"
export interface ApiHandlerOptions {
apiModelId?: string
@@ -38,6 +39,9 @@ export interface ApiHandlerOptions {
openRouterUseMiddleOutTransform?: boolean
includeStreamOptions?: boolean
setAzureApiVersion?: boolean
deepSeekBaseUrl?: string
deepSeekApiKey?: string
deepSeekModelId?: string
}
export type ApiConfiguration = ApiHandlerOptions & {
@@ -489,6 +493,22 @@ export const openAiNativeModels = {
},
} as const satisfies Record<string, ModelInfo>
// DeepSeek
// https://platform.deepseek.com/docs/api
export type DeepSeekModelId = keyof typeof deepSeekModels
export const deepSeekDefaultModelId: DeepSeekModelId = "deepseek-chat"
export const deepSeekModels = {
"deepseek-chat": {
maxTokens: 8192,
contextWindow: 64_000,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.014, // $0.014 per million tokens
outputPrice: 0.28, // $0.28 per million tokens
description: `DeepSeek-V3 achieves a significant breakthrough in inference speed over previous models. It tops the leaderboard among open-source models and rivals the most advanced closed-source models globally.`,
},
} as const satisfies Record<string, ModelInfo>
// Azure OpenAI
// https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation
// https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs