Parallelization Pattern in Python: Fan-Out LLM Calls (2026)
Run independent LLM calls at the same time in Python with asyncio.gather, cap them with a Semaphore, and survive 429 rate limits with backoff. Runnable code.
Tag
6 posts tagged.
Run independent LLM calls at the same time in Python with asyncio.gather, cap them with a Semaphore, and survive 429 rate limits with backoff. Runnable code.
Build the orchestrator-workers agent pattern in Python with Claude: a planner that decides subtasks at runtime, parallel workers, and a synthesizer. Runnable code, July 2026.
A code-first routing tutorial: build a runnable LLM router in Python with the Claude API, add a deterministic fallback, and route by difficulty to cut cost.
A code-first prompt chaining tutorial: build a gated Python pipeline with the Claude API, add pure-Python and LLM gates, and fail fast before wasting tokens.
Five reusable agentic workflow patterns, built from scratch in Python with runnable code and a start-simple rule.
An AI agent is just a loop: you call a model, the model asks to run a tool, you run it, you feed the result back, and you repeat until the model is done. In this tutorial you build that loop yourself in plain TypeScript against the Anthropic Messages API, no framework. You will wire up two tools (read a file, run a calculation), let the model orchestrate them, add a turn cap and basic guardrails, then verify the whole thing end to end. The result is a small research agent you fully understand and can extend with your own tools.