From 5a81f8f6d3530e51c87fca28ea4ad73f33c1d5b1 Mon Sep 17 00:00:00 2001 From: Ann-Holmes <41296458+Ann-Holmes@users.noreply.github.com> Date: Sat, 23 Aug 2025 11:16:01 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(deepseek):=20Update=20DeepSeek?= =?UTF-8?q?=20models=20context=20window=20from=2064K=20to=20128K=20(#5751)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated contextWindow for deepseek-chat and deepseek-reasoner models from 64_000 to 128_000 - Modified context-window-utils.ts to handle DeepSeek models with 128K context window instead of 64K - This change aligns with DeepSeek's official API documentation and improves model performance --- src/core/context/context-management/context-window-utils.ts | 2 +- src/shared/api.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/context/context-management/context-window-utils.ts b/src/core/context/context-management/context-window-utils.ts index 6e658c14..1e6e1383 100644 --- a/src/core/context/context-management/context-window-utils.ts +++ b/src/core/context/context-management/context-window-utils.ts @@ -13,7 +13,7 @@ export function getContextWindowInfo(api: ApiHandler) { // Handle special cases like DeepSeek if (api instanceof OpenAiHandler && api.getModel().id.toLowerCase().includes("deepseek")) { - contextWindow = 64_000 + contextWindow = 128_000 } let maxAllowedSize: number diff --git a/src/shared/api.ts b/src/shared/api.ts index 387e507e..ca842f9f 100644 --- a/src/shared/api.ts +++ b/src/shared/api.ts @@ -1246,7 +1246,7 @@ export const deepSeekDefaultModelId: DeepSeekModelId = "deepseek-chat" export const deepSeekModels = { "deepseek-chat": { maxTokens: 8_000, - contextWindow: 64_000, + contextWindow: 128_000, supportsImages: false, supportsPromptCache: true, // supports context caching, but not in the way anthropic does it (deepseek reports input tokens and reads/writes in the same usage report) FIXME: we need to show users cache stats how deepseek does it inputPrice: 0, // technically there is no input price, it's all either a cache hit or miss (ApiOptions will not show this). Input is the sum of cache reads and writes @@ -1256,7 +1256,7 @@ export const deepSeekModels = { }, "deepseek-reasoner": { maxTokens: 8_000, - contextWindow: 64_000, + contextWindow: 128_000, supportsImages: false, supportsPromptCache: true, // supports context caching, but not in the way anthropic does it (deepseek reports input tokens and reads/writes in the same usage report) FIXME: we need to show users cache stats how deepseek does it inputPrice: 0, // technically there is no input price, it's all either a cache hit or miss (ApiOptions will not show this)