AI21 Labs Releases Teel, an Open-Source Python Library for Parallelizing Agent IO
·2026.11.05 09:00
Key point
The library uses a shadow interpreter to parallelize independent IO-bound calls in sequential code without requiring async syntax, reducing runtime from 148s to 24s in benchmarks.
Details
- AI21 Labs released Teel, an open-source Python runtime that accelerates sequential code by parallelizing independent IO-bound calls without requiring
async,await, or manual concurrency logic. - In the Princeton Tree of Thoughts benchmark using GPT-4, Teel reduced average runtime by 83% (from 148s to 24s) and improved the longest runtime by 8.07x (from 307s to 38s).
- Teel operates via a shadow interpreter that reads CPython bytecode and frame stacks to identify independent calls, dispatching them to a
ThreadPoolExecutorwhile speculatively executing conditional branches. - Performance gains in LangChain Deep Agents (RLM) showed a 2.58x speedup over synchronous Python (150s to 58s) and a 19% improvement over model-generated async JavaScript code.
- The library currently supports only Python 3.12.13 and requires
@cacheablefunctions to be pure, as side effects in speculatively executed branches are not supported. - Observability is provided via Chrome trace-event files for visualization in Perfetto UI, allowing users to inspect call start times, durations, and execution threads.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.