GPTSwarm

Build and self-organize language-agent swarms as optimizable graphs.

Stars
★ 1.1k
Last updated
9mo ago
License
MIT
Primary language
Python

At a glance

How it runs
Library / SDKFramework
Works with
Portable with changesOpenAI API
Cost
Free software; you pay for model usage
Setup effort
Medium · a few setup steps
You'll need
Python 3.10PoetryOpenAI API keyShell / CLINetwork accessLocal filesystem
Typical use
A Python developer who needs to arrange predefined agents into a graph and answer a knowledge question through the gaia environment.
Not a fit if
  • Users unwilling to obtain OpenAI and search API keys: the online path depends on paid keys
  • Users wanting a ready-made GUI or hosted service: this is a local Python library

What does this agent do, and when should you use it?

GPTSwarm is a Python framework for building LLM-based agent graphs and agent swarms. It places domain operations, agents, tools, and tasks in swarm.environment, while swarm.graph creates and executes agent graphs and composite swarm graphs. swarm.llm selects LLM backends and calculates operational costs, swarm.memory provides index-based memory, and swarm.optimizer is intended to improve agent performance and swarm efficiency. Examples instantiate the Swarm class with agent types and an environment, then execute tasks through run or arun and receive a result. It runs as a local Python library, with documented OpenAI and search API configuration plus a local-model route through LM Studio.

A caller imports Swarm from swarm.graph.swarm and creates a predefined swarm such as Swarm(["IO", "IO", "IO"], "gaia"), then passes a task in {"task": task} and calls await swarm.arun(inputs). The framework executes the swarm through its graph and returns the call result. For file analysis, the documented example creates Swarm(["IO", "TOT"], "gaia"), passes image paths in {"task": task, "files": files}, and calls swarm.run(inputs). When BING_API_KEY, SEARCHAPI_API_KEY, or GOOGLE_API_KEY is configured, it selects Bing API, SearchAPI, or Google API in that order; swarm.llm also handles backend selection and operational-cost calculation.

  1. A Python developer who needs to arrange predefined agents into a graph and answer a knowledge question through the gaia environment.
  2. A researcher studying inter-agent edge optimization, including probability changes toward edge pruning or creation.
  3. An application developer who needs to submit local image paths to a file-analysis task and request a three-sentence summary.
  4. A multi-agent research team experimenting with reinforcement-learning and prompting optimization for swarm performance.
  5. A developer with an LM Studio server who wants to run a local language model using model_name='lmstudio'.

How do you install or deploy this agent?

Clone and install:

git clone https://github.com/metauto-ai/GPTSwarm.git
cd GPTSwarm/
conda create -n swarm python=3.10
conda activate swarm
pip install poetry
poetry install

Rename .env.template to .env and provide OPENAI_API_KEY for the OpenAI backend. For search, add BING_API_KEY, SEARCHAPI_API_KEY, or GOOGLE_API_KEY. The README does not document a complete credential configuration for using none of these services.

How do you use this agent?

Minimal invocation:

from swarm.graph.swarm import Swarm

swarm = Swarm(["IO", "IO", "IO"], "gaia")
inputs = {"task": "What is the capital of Jordan?"}
answer = await swarm.arun(inputs)

For a local model, choose a model and start a server in LM Studio, then use model_name='lmstudio' in GPTSwarm code.

What are this agent's strengths and limitations?

Pros
  • Uses graphs as the core representation for agents and composite swarms, with explicit graph creation and execution components.
  • Separates environments, graphs, LLM backends, index-based memory, and optimization algorithms into distinct modules for experimentation.
  • Documents inter-agent edge optimization and an optimizer aimed at agent performance and swarm efficiency.
  • Documents a search-provider selection order for Bing, SearchAPI, and Google, plus a local-inference path through LM Studio.
Limitations
  • The installation path specifies Python 3.10, Conda, and Poetry, which may require runtime changes in an existing project.
  • The documented online LLM and search paths depend on API keys; no pricing, quota, or offline alternative is described.
  • The README shows only limited calls using the gaia environment and IO/TOT configurations, without a complete contract for custom environments or agents.
  • Only the LM Studio desktop route for Mac or Windows is explicitly documented for local inference; support for other local services is not evidenced.

How does this agent compare with similar options?

The README names OpenAI Swarm as a related alternative and positions GPTSwarm around “Swarm Intelligence”; it does not provide a verifiable feature matrix or benchmark comparison.

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
GPTSwarm This agent 27 · Major gaps Library / SDKFree + model costs ★ 1.1k 9mo ago Python OpenAI API
Youtu-Agent 27 · Major gaps CLIFree + model costs ★ 4.6k 7mo ago Python OpenAI API
Weco Autoresearch 63 · Some gaps CLIFree + model costs ★ 121 2d ago Python Codex · Claude Code · OpenAI API
AWorld Agent Harness 48 · Major gaps CLIFree + model costs ★ 1.2k 23d ago Python —

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
27/ 100 5-point scale 1.4 / 5
Trust 0/29
Reliability 3/14
Adaptability 8/18
Convention 8/18
Effectiveness 6/13
Verifiability 2/8
Why each dimension lost points
Trust0 / 29 · 0.0/5

Evidence shows no mechanisms for least privilege, user confirmation, data flow transparency, sensitive data handling, dependency security, external effects, rollback, or source attribution. README mentions API key configuration but no least privilege or user confirmation. Thus all trust criteria score 0.

Reliability3 / 14 · 1.1/5

Self-consistency: README and pyproject.toml descriptions align, but no error handling or failure messages in code. Dependency availability: pyproject.toml lists dependencies but no lock file or version ranges, potentially unstable. Failure messages: no error handling or user-friendly failure messages found.

Adaptability8 / 18 · 2.2/5

Audience and scenarios: README provides multiple examples and scenarios but no explicit target audience. Capability boundaries: no explicit limitations. Trigger precision: no trigger mechanism. Environment fit: local LLM support mentioned but no other environment requirements.

Convention8 / 18 · 2.2/5

Information architecture: README well-structured but lacks detailed docs. Install notes: installation steps provided but no troubleshooting. Naming stability: no version history. Examples and FAQ: examples provided but no FAQ. Known limitations: not mentioned. License: MIT license clear. Versioning/changelog: not provided. Maintenance responsibility: contributors listed but no explicit maintainer.

Effectiveness6 / 13 · 2.3/5

Output usability: examples show output but no output format specification. Marginal value: self-improvement feature mentioned but not quantified. Cost-benefit: no cost analysis.

Verifiability2 / 8 · 1.3/5

Claim traceability: claims in README lack evidence. Cross-source corroboration: none. Fact-inference separation: not distinguished.

Risks and how to mitigate them
  • Not found in source: least-privilege scopingGrant only what the task needs: a dedicated account or read-only token, scoped to specific directories and repos.
  • Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
  • Not found in source: data-flow disclosureWatch which external services it contacts (proxy or firewall logs) and keep sensitive data out until you know where it goes.
  • Not found in source: sensitive-data handlingUse dedicated, low-privilege, revocable API keys — never production credentials — and keep secrets out of logs.
  • Not found in source: dependency securityPin versions and run a dependency audit (npm audit, pip-audit) before installing; prefer running it in a container.
  • Not found in source: disclosed external effectsEstablish which external systems it writes to, sends to or changes, and verify with test accounts or repos before production.
  • Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
  • Not found in source: verifiable attributionInstall from the official repo or registry and check the publisher and URL to avoid look-alike packages.
  • The repository lacks any security mechanisms such as least privilege or user confirmation; use with caution.
  • Dependencies are not pinned, which may lead to environment inconsistency.
  • No error handling or failure messages are provided, which may affect user experience.
Evidence confidence: Low Reviewed Aug 09, 2026 Reviewed revision c23a827f561c
See the full review method →

FAQ

Which credentials are needed to run GPTSwarm?
The README requires OPENAI_API_KEY in .env for the OpenAI LLM backend. Search requires BING_API_KEY, SEARCHAPI_API_KEY, or GOOGLE_API_KEY.
How does it choose a search engine?
It selects the first configured provider in this order: Bing API, SearchAPI, then Google API.
Can it use a local language model?
Yes. The documented route is to start a server in LM Studio and set model_name='lmstudio' in GPTSwarm code.
Does it support file or image tasks?
The README includes a file-analysis example that passes an image file path through files and runs it with swarm.run(inputs).
Can I inspect operational costs?
The README states that swarm.llm calculates LLM operational costs, but does not specify billing models, price sources, or the cost-output format.
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related agents