https://github.com/kyegomez/swarms
476
The official image for Swarms, a framework for building and orchestrating multi-agent LLM systems. It has the swarms package and CLI installed on Python 3.13, ready to run agents, workflows and swarms with any model provider that LiteLLM supports.
| Tag | Contents |
|---|---|
latest | The most recent release |
16.0.1 | swarms 16.0.1 |
Version tags match the swarms version inside the image. Pin one in production. Every tag is built for linux/amd64 and linux/arm64.
docker pull swarmscorp/swarms:latest
docker run --rm swarmscorp/swarms python -c "import swarms; print('Swarms is ready')"
Save this as agent.py:
from swarms import Agent
agent = Agent(
agent_name="Analyst",
model_name="gpt-5.4-mini",
max_loops=1,
)
print(agent.run("Summarise the current state of LLM research in three bullets."))
Mount the folder into /app and pass your API key:
docker run --rm -e OPENAI_API_KEY -v "$PWD:/app" swarmscorp/swarms python agent.py
-e OPENAI_API_KEY with no value passes the key from your shell, so it never appears in your command history.
# Python shell with swarms installed
docker run -it --rm -e OPENAI_API_KEY swarmscorp/swarms
# Bash shell
docker run -it --rm -e OPENAI_API_KEY -v "$PWD:/app" swarmscorp/swarms bash
# The swarms CLI
docker run --rm -e OPENAI_API_KEY swarmscorp/swarms swarms --help
FROM swarmscorp/swarms:16.0.1
# The image has no pip; ensurepip adds it to the environment swarms is installed in.
USER root
RUN python -m ensurepip && python -m pip install --no-cache-dir yfinance
USER swarms
COPY agent.py .
CMD ["python", "agent.py"]
| Variable | Purpose |
|---|---|
OPENAI_API_KEY | OpenAI models, such as gpt-5.4 |
ANTHROPIC_API_KEY | Anthropic models, such as claude-sonnet-4-6 |
GROQ_API_KEY | Groq models, such as groq/llama-3.3-70b-versatile |
GEMINI_API_KEY | Google models, such as gemini/gemini-2.5-pro |
SWARMS_TELEMETRY_ON | Telemetry is on by default. Set this to false to turn it off. |
Any other provider supported by LiteLLM works with its own key variable.
Using --env-file: Docker doesn't strip quotes, so OPENAI_API_KEY="sk-..." reaches the provider with the quotes included and fails to authenticate. Write OPENAI_API_KEY=sk-... instead.
python:3.13-slim/opt/venv, which is already on PATHswarms (UID 1000)/app, which is writable. Agents save their agent_workspace there.pythonMounting a folder on Linux: if the container can't write to it, run as your own user with --user "$(id -u):$(id -g)".
Licensed under Apache-2.0.
Content type
Image
Digest
sha256:d7269b5e1…
Size
106.7 MB
Last updated
1 day ago
docker pull swarmscorp/swarms