Skip to content

Commit 468c040

Browse files
shakkernerdjalehman
authored andcommitted
fix: use OpenAI batch file cap headroom
1 parent a021efb commit 468c040

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

extensions/openai/embedding-batch.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ type OpenAiBatchOutputLine = ProviderBatchOutputLine;
5151
export const OPENAI_BATCH_ENDPOINT = EMBEDDING_BATCH_ENDPOINT;
5252
const OPENAI_BATCH_COMPLETION_WINDOW = "24h";
5353
const OPENAI_BATCH_MAX_REQUESTS = 50000;
54-
const OPENAI_BATCH_MAX_JSONL_BYTES = 9 * 1024 * 1024;
54+
// OpenAI accepts 200 MB Batch input files. Keep a safety margin so the JSONL
55+
// splitter avoids boundary-size uploads while preserving source-wide batching.
56+
const OPENAI_BATCH_MAX_JSONL_BYTES = 190 * 1024 * 1024;
5557
const OPENAI_BATCH_MAX_POLL_BACKOFF_MS = 5 * 60_000;
5658

5759
async function submitOpenAiBatch(params: {

0 commit comments

Comments
 (0)