Skip to main content

Minions

A lightweight, provider-agnostic agentic framework.
Build AI agents that think, use tools, and delegate to sub-agents — with observability baked in.


Install

pip install minion-ai

Quick Start

import minions
from minions.demo_tools import read_file, list_files

def search_web(query: str) -> str:
    """Search the web and return results.

    Args:
        query: The search query.
    """
    # your implementation
    ...

minions.init(api_key="your-api-key")  # or set ANTHROPIC_API_KEY / OPENAI_API_KEY env var

agent = minions.Minion(
    model="anthropic/claude-opus-4",
    tools=[search_web, read_file],
)

result = agent("Summarise the contents of report.pdf")
print(result)

Supported Providers

Any provider supported by LiteLLM works out of the box — just change the model string:

minions.Minion(model="openai/gpt-4o", ...)
minions.Minion(model="anthropic/claude-opus-4", ...)
minions.Minion(model="gemini/gemini-2.5-pro", ...)

API keys are read from the standard env vars (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.) or passed via minions.init().

Sub-Agents

Minion can spawn sub-agents to parallelise large tasks:

agent = minions.Minion(
    model="anthropic/claude-opus-4",
    tools=[read_file, list_files],
    allow_sub_agents=True,
    secondary_model="anthropic/claude-haiku-4-5",  # cheaper model for sub-tasks
)

result = agent("Summarise every file in the /reports directory")

The agent automatically delegates when it sees 3+ independent items to process.

Tracing & UI

Enable tracing to record every run, turn, and tool call to a local SQLite database, then inspect them in the built-in dashboard.

pip install minion-ai
minions.init(
    api_key="...",
    tracing=True,
    project="my-project",   # required when tracing=True
)

agent = minions.Minion(model="openai/gpt-4o", tools=[...])
agent("Do something interesting")

Launch the dashboard:

minion ui

Minions UI

The UI groups traces by project, lets you drill into every turn and tool call, and shows token usage and cost estimates in real time.

Remote tracing (team server)

To send traces to a shared minion-ui server instead of a local file, add trace_url and a project-scoped token (create one in the dashboard under a project's Settings → API Tokens):

minions.init(
    tracing=True,
    project="my-project",
    trace_url="https://traces.mycompany.com",
    tracing_secret_token="mni_xK9mP2...",
)

In this mode nothing is written locally — runs are pushed over HTTP to the server. Tracing never raises: if the server is unreachable the push is skipped and your agent keeps running.

Running the server

The dashboard server ships as a container:

docker compose up            # SQLite (default), data in a named volume

For a team-scale deployment, point it at Postgres via DATABASE_URL (SQLite stays the default when it's unset):

docker compose -f docker-compose.postgres.yml up          # self-hosted Postgres
docker compose -f docker-compose.managed-postgres.yml up  # RDS / Supabase / Neon

See docs/ for full hosting, remote-tracing, and image-publishing guides.

Building Tools

Any Python function with a docstring and typed args works as a tool:

def get_weather(city: str, unit: str = "celsius") -> str:
    """Get the current weather for a city.

    Args:
        city: Name of the city.
        unit: Temperature unit, either 'celsius' or 'fahrenheit'.
    """
    ...

agent = minions.Minion(model="openai/gpt-4o", tools=[get_weather])

See minions/demo_tools.py for more examples.

Metadata

Release files for minion-ai 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minion-ai 0.1.3
File Size Uploaded Provenance
minion_ai-0.1.3.tar.gz 356.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for minion-ai 0.1.3
File Interpreter ABI Platform
minion_ai-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 589.1 kB

Release files / minion_ai-0.1.3.tar.gz

Download URL minion_ai-0.1.3.tar.gz
Size 356.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f26f605dbe6775710d6c6606bcf8d898eccfa31c24e6d5a70aba0246718d5724
BLAKE2b-256 checksum
How to use checksums
e33369f1e11e99ecd3d8dea9539a0737544830a9730e94a3092b4b75c1ea84f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 19, 2026.

Transparency log

Release files / minion_ai-0.1.3-py3-none-any.whl

Download URL minion_ai-0.1.3-py3-none-any.whl
Size 232.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b089f706251d70bed5bc251cd731394ea4ed609eb513b70b7b8851ac64a0276
BLAKE2b-256 checksum
How to use checksums
23e1f034879ee9992076b6fb8d4d0e46bcadb3bc8089b765728d35a18292d12b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 19, 2026.

Transparency log

Security for minion-ai 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for minion_ai-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page