quick-window-91705
05/18/2026, 2:59 PMwooden-umbrella-84098
05/18/2026, 3:21 PMquick-window-91705
05/18/2026, 5:37 PMcalm-artist-7206
05/18/2026, 5:44 PMacompletion, aresponses etc), so we plug in our stuff quite nicely on their async execution paths.
Itβs more code to go through, but it feels to me like the execution is actually cleaner and with less landmines. π€ And being pattern-y, I feel like the agent will keep it straight easier maybecalm-artist-7206
05/18/2026, 7:20 PMbland-bear-604
05/18/2026, 7:57 PMlitellm.acompletion() inside a hidden daemon thread with its own event loop
β’ Exposes conversation.interrupt() that cancels the async task
β’ Sync API is unchanged β callers don't see async at all
β’ ~1750 lines added
PR #3284 β proper async/sync dual paths
β’ Adds a-prefixed async methods at every layer: LLM.acompletion() β agent.astep() β conversation.arun()
β’ Plugs directly into litellm's native async APIs (acompletion, aresponses)
β’ Agent server prefers arun() when available, falls back to thread-pool for backward compat
β’ CancellationToken for cooperative cancellation across the stack
β’ ~2350 lines added, sync paths completely untouched
My take: #3284 is the right approach.
The hidden event loop in #2206 is exactly the pattern that causes async nightmares β a secret background loop masquerading as sync. When something goes wrong (and it will), debugging is much harder because the async machinery is invisible. This is the kind of thing Trio was designed to prevent.
#3284 follows the established Python convention: every sync method gets an explicit a-prefixed async counterpart. It's more code, but it's patterned code β once you understand one layer, all 8 layers work the same way. Agents and LLMs have no trouble maintaining this.
Specific wins of #3284:
β’ No thread-pool workers tied up during LLM I/O β the event loop is free
β’ Cancellation is cooperative and explicit (CancellationToken), not based on asyncio.Task.cancel() which can leave resources in weird states
β’ Matches litellm's own design (`completion`/`acompletion`, `responses`/`aresponses`)
β’ Custom subclasses get sync-delegating defaults β nothing breaks
The main concern with #3284 is maintenance surface area, but since it's patterned and each async method mirrors its sync counterpart, the actual cognitive overhead is low.
(This also lines up with what Engel said in the #2206 review: "I always thought that when we do this, we really should make an acompletion ourselves.") πΎquick-window-91705
05/19/2026, 2:12 PMquick-window-91705
05/19/2026, 3:51 PMfierce-account-55183
05/19/2026, 4:11 PMfierce-account-55183
05/19/2026, 4:12 PMquick-window-91705
05/19/2026, 5:04 PMchilly-france-44439
05/20/2026, 4:43 PMwooden-umbrella-84098
05/20/2026, 4:45 PMwooden-umbrella-84098
05/20/2026, 4:45 PMwooden-umbrella-84098
05/20/2026, 4:45 PMcalm-artist-7206
05/20/2026, 4:45 PMcalm-artist-7206
05/20/2026, 4:45 PMcalm-artist-7206
05/20/2026, 4:46 PMmy guess is the latterThe latter
fierce-account-55183
05/20/2026, 4:47 PMfierce-account-55183
05/20/2026, 4:48 PMfierce-account-55183
05/20/2026, 4:49 PMcalm-artist-7206
05/20/2026, 4:50 PMfierce-account-55183
05/20/2026, 4:51 PMfierce-account-55183
05/20/2026, 4:52 PMfierce-account-55183
05/20/2026, 4:53 PMfierce-account-55183
05/20/2026, 4:53 PMwooden-umbrella-84098
05/20/2026, 5:10 PMcalm-artist-7206
05/20/2026, 5:11 PMchilly-france-44439
05/20/2026, 5:29 PMtie them by creating clear, separate paths (a-, and non-a)If we can try to encourage the creation of utils function, i do think we can live with those verbosity (with the code review bot paying attention to everyline, of course)
quick-window-91705
05/20/2026, 6:01 PMfierce-account-55183
05/20/2026, 6:02 PMquick-window-91705
05/20/2026, 6:03 PMchilly-france-44439
05/20/2026, 6:20 PMrun-eval-50 which should start a small eval run!chilly-france-44439
05/20/2026, 6:20 PMwooden-umbrella-84098
05/20/2026, 7:17 PMquick-window-91705
05/20/2026, 7:54 PM1 2.0% Failed to process archive: not a gzip file
I'm assuming this has to do with the benchmark processing?millions-crayon-32880
05/21/2026, 3:00 AMmillions-crayon-32880
05/21/2026, 3:02 AM