- Declare deps in a normal Python project.
agentix buildpackages the project + every transitive dep into a self-contained bundle — noFROM, nopip installat run time, just a Nix closure under/nix/store/....- Deploy a sandbox: the bundle is overlaid onto a task base
image with
--volumes-from. Different task images, same runtime. - Call a remote function with
RuntimeClient.remote(fn, …).
Prerequisites
- Python 3.11 or newer
- Docker (Engine 20.10+; 25.0+ recommended once
--mount type=imagestabilizes) - Nix on the build host (the framework vendors a pinned Nixpkgs revision)
uvfor dependency locking (uv.lockis mandatory —uv2nixreads it to build the Python closure)
One project, two images
The two-image model is the heart of Agentix:bundle— the bundle fromagentix build. Generic and reusable. Holds Python, agentixx, every plugin, your code, all transitive deps under/nix/store/...with libc vendored.image— the task-specific base the workload runs in (a SWE-bench task image, a customer environment, plain Ubuntu, …).
DockerDeployment mounts the runtime’s /nix into the task container
at sandbox-create time. The Python interpreter, agentix-server, your
code, and the plugin binaries (bash, coreutils, …) all live under
/nix/runtime/bin/ and resolve regardless of the task image’s
distribution.
Layout
- pyproject.toml
- src/hello_agentix/__init__.py
- uv.lock
Install + build
agentix build does, in order:
- Stages your project + every plugin’s
default.nix(each plugin ships its system deps next to its Python module). - Runs
nix buildagainst the vendored Nixpkgs pin:uv2nixproduces a derivation for every entry inuv.lock,symlinkJoinmerges them with the plugin trees. - Streams the resulting
dockerTools.streamLayeredImagetarball intodocker loadand also applies a:latestalias for convenience.
VOLUME /nix so the deployment can share it via
--volumes-from (see below). No base image, no FROM directive, no
runtime pip install.
Call it
run.py
How the overlay works
Under the hood,DockerDeployment.create does:
/nix/store/... and /nix/runtime/bin/... at
their canonical paths. Python’s RPATH (baked at Nix build time) finds
its libs under /nix/store/... because that’s exactly where the
mounted volume puts them.
(--mount type=image,subpath=nix will let us skip the carrier when
that combination lands in stable Docker — both paths use the same
entrypoint, so the swap is transparent.)
Next
Cookbook: hello-agentix
The complete project files used here.
Cookbook: eval-cc-swe
Larger example: Claude Code on SWE-bench Verified.
Architecture
Bundles, workers, and transports.
CLI Reference
Every
agentix build option.