Skip to main content

A simple agentic framework with observability and evals baked in

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minion_ai-0.1.3.tar.gz (356.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minion_ai-0.1.3-py3-none-any.whl (232.3 kB view details)

Uploaded Python 3

File details

Details for the file minion_ai-0.1.3.tar.gz.

File metadata

  • Download URL: minion_ai-0.1.3.tar.gz
  • Upload date:
  • Size: 356.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for minion_ai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f26f605dbe6775710d6c6606bcf8d898eccfa31c24e6d5a70aba0246718d5724
MD5 4e929243f1a85c33c456d934e0ce2765
BLAKE2b-256 e33369f1e11e99ecd3d8dea9539a0737544830a9730e94a3092b4b75c1ea84f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for minion_ai-0.1.3.tar.gz:

Publisher: pypi-publish.yml on shriyansnaik/minion-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file minion_ai-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: minion_ai-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 232.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for minion_ai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3b089f706251d70bed5bc251cd731394ea4ed609eb513b70b7b8851ac64a0276
MD5 80c19d5c1301aad2c4f0a095362e54c2
BLAKE2b-256 23e1f034879ee9992076b6fb8d4d0e46bcadb3bc8089b765728d35a18292d12b

See more details on using hashes here.

Provenance

The following attestation bundles were made for minion_ai-0.1.3-py3-none-any.whl:

Publisher: pypi-publish.yml on shriyansnaik/minion-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page