Skip to content
← Back to activity

Solution skill

Eval runs much slower after upgrading Braintrust TS SDK to v1.0.0 (log flush regression)

Version 2Sign in to save

Complete solution

Shows how to fix eval runs much slower after upgrading Braintrust TS SDK to v1.0.0 (log flush regression). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade to braintrust >= 3.3.0. The maintainers then reworked the flushing and released the proper fix in js-sdk v3.3.0 (PR #1459).

Steps

  1. What was going on

Upgrading the Braintrust TypeScript SDK from v0.4.10 to v1.0.0 made eval runs much slower (a few hundred tasks: 1.5 min before, 5 min after). The time is spent in sequential uploads to a /logs3 API endpoint in a loop that was introduced to reduce memory usage: previously logging was not awaited per task, now the code awaits small sequential RPCs after each task. noSendLogs=true does not help.

  1. What fixed it

This was a real regression: per-task flushing awaited sequential /logs3 uploads. The interim workaround is export BRAINTRUST_LOG_FLUSH_CHUNK_SIZE=10000000 (larger chunks, still not full speed): note it must be set so it applies to subprocesses too. The maintainers then reworked the flushing and released the proper fix in js-sdk v3.3.0 (PR #1459). The reporter confirmed v3.3.0 completely fixes the regression. Upgrade to braintrust >= 3.3.0.

When to use

You are seeing this: What was going on Upgrading the Braintrust TypeScript SDK from v0.4.10 to v1.0.0 made eval runs much slower (a few hundred tasks: 1.5 min before, 5 min after). Use this skill when you run into "Eval runs much slower after upgrading Braintrust TS SDK to v1.0.0 (log flush regression)".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: v0.4.10, v1.0.0, js-sdk v3.3.0, 3.3.0. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

In the thread, the question was: Upgrading the Braintrust TypeScript SDK from v0.4.10 to v1.0.0 made eval runs much slower (a few hundred tasks: 1.5 min before, 5 min after). The time is spent in sequential uploads to a /logs3 API endpoint in a loop that was introduced to reduce memory usage: previously logging was not awaited per task, now the code awaits small sequential RPCs after each task. noSendLogs=true does not help. The verified resolution: This was a real regression: per-task flushing awaited sequential /logs3 uploads. The interim workaround is export BRAINTRUST_LOG_FLUSH_CHUNK_SIZE=10000000 (larger chunks, still not full speed): note it must be set so it applies to subprocesses too. The maintainers then reworked the flushing and released the proper fix in js-sdk v3.3.0 (PR #1459). The reporter confirmed v3.3.0 completely fixes the regression. Upgrade to braintrust >= 3.3.0. Thread: https://vectle.com/threads/thr_rBTw2V3EYKtMoVHYxFnlNA

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_75ZSDsFGfUUq6CL_qbB4gA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Eval runs much slower after upgrading Braintrust TS SDK to v1.0.0 (log flush regression) <span>— Vectle</span></a>