Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.swarms.world/llms.txt

Use this file to discover all available pages before exploring further.

This page maps the most common ways to ship a Swarms agent to production and helps you pick the right one based on workload, complexity, and cost.

Deployment types at a glance

DeploymentUse caseComplexityScalabilityCostBest for
FastAPI + UvicornREST API endpointsLowMediumLowQuick prototypes, internal tools, real-time agent calls
Cron JobsScheduled tasksLowLowVery lowBatch processing, periodic agents (digest, daily reports)
Detailed walkthroughs:
  • FastAPI Agent API — full guide with code, auth, rate limiting, Docker, Gunicorn.
  • Cron jobs: see the runnable examples in the repo at examples/guides/deployment/cron_job_examples/.

Quick-start

1. FastAPI + Uvicorn (REST API)

2. Cron jobs (scheduled tasks)

  • Best for: running agents on a schedule (every hour, daily summary, weekly report).
  • Setup time: 2–5 minutes.
  • Reference code: cron_job_examples/

Choosing a target

Performance

  • FastAPI — excellent for high-throughput synchronous APIs.
  • Cron jobs — good for batch processing where latency doesn’t matter.
  • Docker — consistent performance across environments.
  • Kubernetes — best for complex, scalable, multi-service systems.

Security

  • FastAPI — built-in mechanisms for auth, CORS, rate limiting.
  • Cron jobs — runs with the system user’s permissions; isolate carefully.
  • Docker — sandboxed processes, easier to apply security patches.
  • Kubernetes — full RBAC, network policies, secrets management.

Monitoring & observability

  • FastAPI — standard Python logging hooks; integrates with Prometheus, Datadog, etc.
  • Cron jobs — basic log files; pair with a log shipper for visibility.
  • Docker — container-level metrics via the runtime.
  • Kubernetes — first-class metrics, alerting, and tracing.

Cost

  • FastAPI — pay for the compute that hosts the process.
  • Cron jobs — minimal cost; runs on existing infrastructure.
  • Docker — efficient resource utilisation.
  • Kubernetes — advanced auto-scaling and resource governance.

What to pick

You are…Pick
Building an API for your agentsFastAPI + Uvicorn
Running batch jobs / scheduled agentsCron jobs
Shipping to production with consistency requirementsFastAPI + Docker
Auto-scaling under variable loadCloud Run or Kubernetes
Running on existing infrastructure with minimal costCron jobs or Cloud Functions
Building a complex multi-service platformKubernetes
  1. Start with FastAPI if you need synchronous agent calls.
  2. Add cron jobs for any scheduled or batch agents.
  3. Move to Docker once you need consistent environments and easy deployment.
  4. Consider Kubernetes once you have multiple services that need orchestration, auto-scaling, or advanced resource policies.

See also