Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/shared/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const getModelMaxOutputTokens = ({

// If model has explicit maxTokens, clamp it to 20% of the context window
if (model.maxTokens) {
return Math.min(model.maxTokens, model.contextWindow * 0.2)
return Math.min(model.maxTokens, Math.ceil(model.contextWindow * 0.2))
}

// For non-Anthropic formats without explicit maxTokens, return undefined
Expand Down
Loading