MultiRun

Introduction

Python SDK for durable execution of multi-agent systems.

MultiRun

Python SDK for durable execution of multi-agent systems.

MultiRun makes building and scaling multi-agent systems as easy as deploying a web service. This SDK provides:

  • Transactional steps with automatic retry and replay
  • Durable checkpoints for failure recovery
  • Budget controls for tokens, cost, steps, and sub-agents
  • Framework adapters for LangGraph (CrewAI and AutoGen planned)

Install

pip install multirun

# With LangGraph support
pip install multirun[langgraph]

Minimal example

import asyncio
import multirun
from multirun import run, step
from multirun.models import Budget

multirun.init("http://localhost:8989", api_key="your-api-key")

@step(retry=3, checkpoint=True)
async def call_llm(prompt: str) -> str:
    return f"Response to: {prompt}"

@run(budget=Budget(max_tokens=10000, max_cost_usd=0.10))
async def my_agent(query: str) -> dict:
    response = await call_llm(query)
    return {"result": response}

async def main():
    async with multirun.get_client():
        result = await my_agent("What is the weather?")
        print(result)

asyncio.run(main())

SDK structure

ModulePurpose
multirunClient, init(), init_local(), get_client()
multirun.decorators@run, @step, @checkpoint, @agent
multirun.contextRunContext, AgentContext, StepContext
multirun.modelsRun, Step, Budget, Checkpoint, Policy, Agent
multirun.exceptionsMultiRunError and subclasses
multirun.adaptersLangGraph integration
multirun.transportTransport protocol, HTTP and local backends

Next steps

On this page