Deployment Overview

Deployment Overview

LeafMesh deployment requires Python, Redis, and LLM API access. This section covers requirements, deployment options, and operational considerations.

System Requirements

ComponentMinimumRecommended
Python3.113.11 – 3.14
Redis6.0+7.0+
Memory4GB8GB+
LLM API Access1 provider2+ providers

Dependencies

Required:

  • aiohttp — Async HTTP client
  • redis — Redis client
  • pydantic — Configuration validation
  • apscheduler — Agent scheduling

Optional:

  • fastapi, uvicorn — API services
  • pyyaml — YAML configuration loading

Observability dependencies are bundled by LeafMesh — no extra packages required.

Deployment Options

OptionBest For
Single processDevelopment, small deployments (one instance, no workers mode)
Managed containersProduction via [leafmesh-deploy](cloud-deploy) — App Runner / Container Apps from your project's Dockerfile
Docker / docker-composeReproducible deployments, CI/CD (every scaffolded project ships a Dockerfile + docker-compose.yml)
KubernetesExisting clusters; auto-scaling, high availability
Multi-instanceHorizontal scaling — requires LEAFMESH_WORKERS_MODE=1 and a shared Redis ([Scaling](scaling))

Running more than one instance? Set LEAFMESH_WORKERS_MODE=1 on every instance and point them at the same Redis. See Scaling for the guarantees this enables.

Minimal Deployment

# app.py import asyncio from leafmesh import LeafMesh leafmesh = LeafMesh.from_store() async def main(): await leafmesh.start() # Application logic... await leafmesh.stop() asyncio.run(main())

With Redis running locally:

# Start Redis redis-server # Run the application python app.py

With API Server

import asyncio from leafmesh import LeafMesh leafmesh = LeafMesh.from_store() async def main(): await leafmesh.start() # API server runs on port 18820 by default # Includes all service endpoints asyncio.run(main())

Network Requirements

  • Redis: localhost:6379 (default) or cluster addresses
  • LLM APIs: HTTPS to provider endpoints (api.openai.com, api.anthropic.com, etc.)
  • API server: Port 18820 (configurable) for external access

Next Steps


LeafMesh — Deployment overview

Last updated: 11/10/2026