RAG & Agents Engineering

M01 lab, Python and data toolkit

Concurrency ends at the slowest call.

Eight questions about the Larkspur Cloud handbook, one model call each, started together with asyncio.gather. A Semaphore caps how many are in flight. Move the cap and switch the client, and read the wall time.

Client inside async def
Wall time
Faster than one at a time
Most calls in flight
Longest wait in the queue

Call timeline

Seconds from the start of gather

    A dark bar is a call in flight; the hairline before it is time spent waiting for the semaphore. The call that ends last is in magenta, and its end is the wall time. Call times are representative, not measured; the schedule is what asyncio does with them.

    The code this timeline runs