Skip to content

Commit f5a62bd

Browse files
committed
fix(translate): increase chunk buffer to 50% for DeepSeek safety
1 parent 926a536 commit f5a62bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ export function getModelContextLimit(modelName: string): number {
120120
return 128000;
121121
}
122122

123-
/** Estimated max chars per chunk (context limit / 3.5 chars per token, with 20% buffer) */
123+
/** Estimated max chars per chunk (context limit / 3.5 chars per token, with 50% buffer) */
124124
export function getMaxChunkChars(modelName: string): number {
125125
const contextLimit = getModelContextLimit(modelName);
126-
// Reserve ~20% for prompt overhead and response
127-
return Math.floor((contextLimit * 3.5) / 1.2);
126+
// Reserve ~50% for prompt overhead, title, and response to be safe
127+
return Math.floor((contextLimit * 3.5) / 1.5);
128128
}
129129

130130
/**

0 commit comments

Comments
 (0)