Catalog PyPI
PACKAGE EXPLORERView in registry

agi-pack

PyPI

Dockerfile generator for AGI -- nothing more, nothing less.

Versions collected1
Direct dependencies7From release 0.3.0
Last observed21 Oct, 09:09 UTC

README

Version 0.3.0 documentation

📦 agi-pack

A Dockerfile builder for Machine Learning developers.

PyPi Version PyPi Version PyPi Downloads

📦 agi-pack allows you to define your Dockerfiles using a simple YAML format, and then generate images from them trivially using Jinja2 templates and Pydantic-based validation. It's a simple tool that aims to simplify the process of building Docker images for machine learning (ML).

Goals 🎯

  • 😇 Simplicity: Make it easy to define and build docker images for ML.
  • 📦 Best-practices: Bring best-practices to building docker images for ML -- good base images, multi-stage builds, minimal image sizes, etc.
  • ⚡️ Fast: Make it lightning-fast to build and re-build docker images with out-of-the-box caching for apt, conda and pip packages.
  • 🧩 Modular, Re-usable, Composable: Define base, dev and prod targets with multi-stage builds, and re-use them wherever possible.
  • 👩‍💻 Extensible: Make the YAML / DSL easily hackable and extensible to support the ML ecosystem, as more libraries, drivers, HW vendors, come into the market.
  • ☁️ Vendor-agnostic: agi-pack is not intended to be built for any specific vendor -- I need this tool for internal purposes, but I decided to build it in the open and keep it simple.

Installation 📦

pip install agi-pack

For shell completion, you can install them via:

agi-pack --install-completion <bash|zsh|fish|powershell|pwsh>

Go through the examples and the corresponding examples/generated directory to see a few examples of what agi-pack can do. If you're interested in checking out a CUDA / CUDNN example, check out examples/agibuild.base-cu118.yaml.

Quickstart 🛠

  1. Create a simple YAML configuration file called agibuild.yaml. You can use agi-pack init to generate a sample configuration file.

    agi-pack init
    
  2. Edit agibuild.yaml to define your custom system and python packages.

    images:
      sklearn-base:
        base: debian:buster-slim
        system:
        - wget
        - build-essential
        python: "3.8.10"
        pip:
        - loguru
        - typer
        - scikit-learn
    

    Let's break this down:

    • sklearn-base: name of the target you want to build. Usually, these could be variants like *-base, *-dev, *-prod, *-test etc.
    • base: base image to build from.
    • system: system packages to install via apt-get install.
    • python: specific python version to install via miniconda.
    • pip: python packages to install via pip install.
  3. Generate the Dockerfile using agi-pack generate

    agi-pack generate -c agibuild.yaml
    

    You should see the following output:

    $ agi-pack generate -c agibuild.yaml
    📦 sklearn-base
    └── 🎉 Successfully generated Dockerfile (target=sklearn-base, filename=Dockerfile).
        └── `docker build -f Dockerfile --target sklearn-base .`
    

That's it! Here's the generated Dockerfile -- use it to run docker build and build the image directly.

Rationale 🤔

Docker has become the standard for building and managing isolated environments for ML. However, any one who has gone down this rabbit-hole knows how broken ML development is, especially when you need to experiment and re-configure your environments constantly. Production is another nightmare -- large docker images (10GB+), bloated docker images with model weights that are ~5-10GB in size, 10+ minute long docker build times, sloppy package management to name just a few.

What makes Dockerfiles painful? If you've ever tried to roll your own Dockerfiles with all the best-practices while fully understanding their internals, you'll still find yourself building, and re-building, and re-building these images across a whole host of use-cases. Having to build Dockerfile(s) for dev, prod, and test all turn out to be a nightmare when you add the complexity of hardware targets (CPUs, GPUs, TPUs etc), drivers, python, virtual environments, build and runtime dependencies.

agi-pack aims to simplify this by allowing developers to define Dockerfiles in a concise YAML format and then generate them based on your environment needs (i.e. python version, system packages, conda/pip dependencies, GPU drivers etc).

For example, you should be able to easily configure your dev environment for local development, and have a separate prod environment where you'll only need the runtime dependencies avoiding any bloat.

agi-pack hopes to also standardize the base images, so that we can really build on top of giants.

More Complex Example 📚

Now imagine you want to build a more complex image that has multiple stages, and you want to build a base image that has all the basic dependencies, and a dev image that has additional build-time dependencies.

images:
  base-cpu:
    name: agi
    base: debian:buster-slim
    system:
        - wget
    python: "3.8.10"
    pip:
        - scikit-learn
    run:
        - echo "Hello, world!"

  dev-cpu:
    base: base-cpu
    system:
    - build-essential

Once you've defined this agibuild.yaml, running agi-pack generate will generate the following output:

$ agi-pack generate -c agibuild.yaml
📦 base-cpu
└── 🎉 Successfully generated Dockerfile (target=base-cpu, filename=Dockerfile).
    └── `docker build -f Dockerfile --target base-cpu .`
📦 dev-cpu
└── 🎉 Successfully generated Dockerfile (target=dev-cpu, filename=Dockerfile).
    └── `docker build -f Dockerfile --target dev-cpu .`

As you can see, agi-pack will generate a single Dockerfile for each of the targets defined in the YAML file. You can then build the individual images from the same Dockerfile using docker targets: docker build -f Dockerfile --target <target> . where <target> is the name of the image target you want to build.

Here's the corresponding Dockerfile that was generated.

Why the name? 🤷‍♂️

agi-pack is very much intended to be tongue-in-cheek -- we are soon going to be living in a world full of quasi-AGI agents orchestrated via ML containers. At the very least, agi-pack should provide the building blocks for us to build a more modular, re-usable, and distribution-friendly container format for "AGI".

Inspiration and Attribution 🌟

TL;DR agi-pack was inspired by a combination of Replicate's cog, Baseten's truss, skaffold, and Docker Compose Services. I wanted a standalone project without any added cruft/dependencies of vendors and services.

📦 agi-pack is simply a weekend project I hacked together, that started with a conversation with ChatGPT / GPT-4.

ChatGPT Prompt


Prompt: I'm building a Dockerfile generator and builder to simplify machine learning infrastructure. I'd like for the Dockerfile to be dynamically generated (using Jinja templates) with the following parametrizations:

# Sample YAML file
images:
  base-gpu:
    base: nvidia/cuda:11.8.0-base-ubuntu22.04
    system:
    - gnupg2
    - build-essential
    - git
    python: "3.8.10"
    pip:
    - torch==2.0.1

I'd like for this yaml file to generate a Dockerfile via agi-pack generate -c <name>.yaml. You are an expert in Docker and Python programming, how would I implement this builder in Python. Use Jinja2 templating and miniconda python environments wherever possible. I'd like an elegant and concise implementation that I can share on PyPI.

Contributing 🤝

Contributions are welcome! Please read the CONTRIBUTING guide for more information.

License 📄

This project is licensed under the MIT License. See the LICENSE file for details.

Downloads & popularity

10downloads
1-day window · source-reported counts20 Oct 2026
48240
2026-07-23: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-07-23–2026-07-232026-07-24: 33 · observed 2026-10-21T10:46:57.5068633Z · period 2026-07-24–2026-07-242026-07-25: 48 · observed 2026-10-21T10:46:57.5068633Z · period 2026-07-25–2026-07-252026-07-26: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-07-26–2026-07-262026-07-27: 26 · observed 2026-10-21T10:46:57.5068633Z · period 2026-07-27–2026-07-272026-07-28: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-07-28–2026-07-282026-07-29: 5 · observed 2026-10-21T10:46:57.5068633Z · period 2026-07-29–2026-07-292026-07-30: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-07-30–2026-07-302026-07-31: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-07-31–2026-07-312026-08-01: 7 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-01–2026-08-012026-08-02: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-02–2026-08-022026-08-04: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-04–2026-08-042026-08-05: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-05–2026-08-052026-08-08: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-08–2026-08-082026-08-09: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-09–2026-08-092026-08-10: 5 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-10–2026-08-102026-08-11: 8 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-11–2026-08-112026-08-12: 4 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-12–2026-08-122026-08-14: 4 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-14–2026-08-142026-08-15: 4 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-15–2026-08-152026-08-16: 25 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-16–2026-08-162026-08-17: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-17–2026-08-172026-08-18: 9 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-18–2026-08-182026-08-19: 13 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-19–2026-08-192026-08-20: 3 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-20–2026-08-202026-08-21: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-21–2026-08-212026-08-22: 3 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-22–2026-08-222026-08-23: 5 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-23–2026-08-232026-08-24: 31 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-24–2026-08-242026-08-25: 3 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-25–2026-08-252026-08-26: 33 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-26–2026-08-262026-08-27: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-27–2026-08-272026-08-28: 9 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-28–2026-08-282026-08-30: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-30–2026-08-302026-08-31: 3 · observed 2026-10-21T10:46:57.5068633Z · period 2026-08-31–2026-08-312026-09-01: 5 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-01–2026-09-012026-09-03: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-03–2026-09-032026-09-04: 6 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-04–2026-09-042026-09-06: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-06–2026-09-062026-09-07: 21 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-07–2026-09-072026-09-08: 36 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-08–2026-09-082026-09-09: 12 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-09–2026-09-092026-09-10: 3 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-10–2026-09-102026-09-11: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-11–2026-09-112026-09-12: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-12–2026-09-122026-09-13: 19 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-13–2026-09-132026-09-14: 4 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-14–2026-09-142026-09-15: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-15–2026-09-152026-09-16: 3 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-16–2026-09-162026-09-17: 4 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-17–2026-09-172026-09-18: 7 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-18–2026-09-182026-09-19: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-19–2026-09-192026-09-21: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-21–2026-09-212026-09-22: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-22–2026-09-222026-09-23: 18 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-23–2026-09-232026-09-24: 8 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-24–2026-09-242026-09-25: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-25–2026-09-252026-09-26: 5 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-26–2026-09-262026-09-27: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-27–2026-09-272026-09-28: 9 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-28–2026-09-282026-09-30: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-09-30–2026-09-302026-10-01: 28 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-01–2026-10-012026-10-02: 11 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-02–2026-10-022026-10-05: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-05–2026-10-052026-10-06: 5 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-06–2026-10-062026-10-07: 5 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-07–2026-10-072026-10-08: 4 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-08–2026-10-082026-10-09: 4 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-09–2026-10-092026-10-10: 5 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-10–2026-10-102026-10-11: 11 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-11–2026-10-112026-10-12: 14 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-12–2026-10-122026-10-13: 8 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-13–2026-10-132026-10-14: 2 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-14–2026-10-142026-10-15: 4 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-15–2026-10-152026-10-16: 1 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-16–2026-10-162026-10-17: 5 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-17–2026-10-172026-10-18: 5 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-18–2026-10-182026-10-19: 5 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-19–2026-10-192026-10-20: 10 · observed 2026-10-21T10:46:57.5068633Z · period 2026-10-20–2026-10-20
23 Jul20 Oct

pypistats · 79 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-20 – 2026-10-20102026-10-21T10:46:57.5068633Z
2026-10-19 – 2026-10-1952026-10-21T10:46:57.5068633Z
2026-10-18 – 2026-10-1852026-10-21T10:46:57.5068633Z
2026-10-17 – 2026-10-1752026-10-21T10:46:57.5068633Z
2026-10-16 – 2026-10-1612026-10-21T10:46:57.5068633Z
2026-10-15 – 2026-10-1542026-10-21T10:46:57.5068633Z
2026-10-14 – 2026-10-1422026-10-21T10:46:57.5068633Z
2026-10-13 – 2026-10-1382026-10-21T10:46:57.5068633Z
2026-10-12 – 2026-10-12142026-10-21T10:46:57.5068633Z
2026-10-11 – 2026-10-11112026-10-21T10:46:57.5068633Z
2026-10-10 – 2026-10-1052026-10-21T10:46:57.5068633Z
2026-10-09 – 2026-10-0942026-10-21T10:46:57.5068633Z
2026-10-08 – 2026-10-0842026-10-21T10:46:57.5068633Z
2026-10-07 – 2026-10-0752026-10-21T10:46:57.5068633Z
2026-10-06 – 2026-10-0652026-10-21T10:46:57.5068633Z
2026-10-05 – 2026-10-0522026-10-21T10:46:57.5068633Z
2026-10-02 – 2026-10-02112026-10-21T10:46:57.5068633Z
2026-10-01 – 2026-10-01282026-10-21T10:46:57.5068633Z
2026-09-30 – 2026-09-3022026-10-21T10:46:57.5068633Z
2026-09-28 – 2026-09-2892026-10-21T10:46:57.5068633Z
2026-09-27 – 2026-09-2712026-10-21T10:46:57.5068633Z
2026-09-26 – 2026-09-2652026-10-21T10:46:57.5068633Z
2026-09-25 – 2026-09-2522026-10-21T10:46:57.5068633Z
2026-09-24 – 2026-09-2482026-10-21T10:46:57.5068633Z
2026-09-23 – 2026-09-23182026-10-21T10:46:57.5068633Z
2026-09-22 – 2026-09-2222026-10-21T10:46:57.5068633Z
2026-09-21 – 2026-09-2112026-10-21T10:46:57.5068633Z
2026-09-19 – 2026-09-1912026-10-21T10:46:57.5068633Z
2026-09-18 – 2026-09-1872026-10-21T10:46:57.5068633Z
2026-09-17 – 2026-09-1742026-10-21T10:46:57.5068633Z
2026-09-16 – 2026-09-1632026-10-21T10:46:57.5068633Z
2026-09-15 – 2026-09-1522026-10-21T10:46:57.5068633Z
2026-09-14 – 2026-09-1442026-10-21T10:46:57.5068633Z
2026-09-13 – 2026-09-13192026-10-21T10:46:57.5068633Z
2026-09-12 – 2026-09-1222026-10-21T10:46:57.5068633Z
2026-09-11 – 2026-09-1122026-10-21T10:46:57.5068633Z
2026-09-10 – 2026-09-1032026-10-21T10:46:57.5068633Z
2026-09-09 – 2026-09-09122026-10-21T10:46:57.5068633Z
2026-09-08 – 2026-09-08362026-10-21T10:46:57.5068633Z
2026-09-07 – 2026-09-07212026-10-21T10:46:57.5068633Z
2026-09-06 – 2026-09-0612026-10-21T10:46:57.5068633Z
2026-09-04 – 2026-09-0462026-10-21T10:46:57.5068633Z
2026-09-03 – 2026-09-0312026-10-21T10:46:57.5068633Z
2026-09-01 – 2026-09-0152026-10-21T10:46:57.5068633Z
2026-08-31 – 2026-08-3132026-10-21T10:46:57.5068633Z
2026-08-30 – 2026-08-3012026-10-21T10:46:57.5068633Z
2026-08-28 – 2026-08-2892026-10-21T10:46:57.5068633Z
2026-08-27 – 2026-08-2712026-10-21T10:46:57.5068633Z
2026-08-26 – 2026-08-26332026-10-21T10:46:57.5068633Z
2026-08-25 – 2026-08-2532026-10-21T10:46:57.5068633Z
2026-08-24 – 2026-08-24312026-10-21T10:46:57.5068633Z
2026-08-23 – 2026-08-2352026-10-21T10:46:57.5068633Z
2026-08-22 – 2026-08-2232026-10-21T10:46:57.5068633Z
2026-08-21 – 2026-08-2122026-10-21T10:46:57.5068633Z
2026-08-20 – 2026-08-2032026-10-21T10:46:57.5068633Z
2026-08-19 – 2026-08-19132026-10-21T10:46:57.5068633Z
2026-08-18 – 2026-08-1892026-10-21T10:46:57.5068633Z
2026-08-17 – 2026-08-1712026-10-21T10:46:57.5068633Z
2026-08-16 – 2026-08-16252026-10-21T10:46:57.5068633Z
2026-08-15 – 2026-08-1542026-10-21T10:46:57.5068633Z
2026-08-14 – 2026-08-1442026-10-21T10:46:57.5068633Z
2026-08-12 – 2026-08-1242026-10-21T10:46:57.5068633Z
2026-08-11 – 2026-08-1182026-10-21T10:46:57.5068633Z
2026-08-10 – 2026-08-1052026-10-21T10:46:57.5068633Z
2026-08-09 – 2026-08-0912026-10-21T10:46:57.5068633Z
2026-08-08 – 2026-08-0822026-10-21T10:46:57.5068633Z
2026-08-05 – 2026-08-0512026-10-21T10:46:57.5068633Z
2026-08-04 – 2026-08-0422026-10-21T10:46:57.5068633Z
2026-08-02 – 2026-08-0212026-10-21T10:46:57.5068633Z
2026-08-01 – 2026-08-0172026-10-21T10:46:57.5068633Z
2026-07-31 – 2026-07-3122026-10-21T10:46:57.5068633Z
2026-07-30 – 2026-07-3012026-10-21T10:46:57.5068633Z
2026-07-29 – 2026-07-2952026-10-21T10:46:57.5068633Z
2026-07-28 – 2026-07-2822026-10-21T10:46:57.5068633Z
2026-07-27 – 2026-07-27262026-10-21T10:46:57.5068633Z
2026-07-26 – 2026-07-2622026-10-21T10:46:57.5068633Z
2026-07-25 – 2026-07-25482026-10-21T10:46:57.5068633Z
2026-07-24 – 2026-07-24332026-10-21T10:46:57.5068633Z
2026-07-23 – 2026-07-2312026-10-21T10:46:57.5068633Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.3.03 May 20247

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
spillai/agi-pack

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:09 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:28647dddb845a08405c86dae6049acf8cec5883de6901f3aa539803486596778