mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-13 08:02:47 +00:00
fix: raise deepseek output budget for reasoning responses
This commit is contained in:
@@ -116,13 +116,31 @@ async function setupClients() {
|
||||
|
||||
beforeEach(async () => {
|
||||
await setupClients()
|
||||
})
|
||||
}, 60000)
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
h.currentModel = undefined
|
||||
})
|
||||
|
||||
describe('DeepSeek output budget', () => {
|
||||
it.each(['deepseek-flash', 'deepseek-v4-flash', 'deepseek-v4-pro'])(
|
||||
'sends the full reasoning and answer budget for %s',
|
||||
async (model) => {
|
||||
const { getCompletion, getNonStreamingMetadataCompletion, METADATA_MAX_TOKENS } =
|
||||
await import('./lib')
|
||||
h.currentModel = { provider: 'deepseek', model }
|
||||
|
||||
await getCompletion(messages, new AbortController())
|
||||
expect(openaiCreate.mock.calls[0][0].max_tokens).toBe(393216)
|
||||
|
||||
openaiCreate.mockClear()
|
||||
await getNonStreamingMetadataCompletion(messages, new AbortController())
|
||||
expect(openaiCreate.mock.calls[0][0].max_tokens).toBe(METADATA_MAX_TOKENS)
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
describe('Anthropic Messages API routing', () => {
|
||||
it('getNonStreamingCompletion routes Foundry Claude through the Anthropic client', async () => {
|
||||
const { getNonStreamingCompletion } = await import('./lib')
|
||||
|
||||
@@ -310,7 +310,10 @@ export async function fetchAvailableModels(
|
||||
}
|
||||
|
||||
export function getModelMaxTokens(provider: AIProvider, model: string) {
|
||||
if (model.includes('gpt-5')) {
|
||||
if (/^(deepseek-flash|deepseek-v4-(flash|pro))$/.test(model.split('/').pop() ?? '')) {
|
||||
// DeepSeek counts reasoning against the output budget as well as the answer.
|
||||
return 393216
|
||||
} else if (model.includes('gpt-5')) {
|
||||
return 128000
|
||||
} else if (
|
||||
(provider === 'azure_openai' || provider === 'openai' || provider === 'azure_foundry') &&
|
||||
|
||||
Reference in New Issue
Block a user