Pixi Python ML TemplatesΒΆ

This directory provides two templates for setting up Python machine learning projects using Pixi for environment and dependency management:

LayoutΒΆ

.
β”œβ”€β”€ flake-python-ml
β”‚   └── ...
└── global-python-ml
    └── ...

Template OverviewΒΆ

flake-python-mlΒΆ

  • Purpose:
    Combines Pixi with Nix flakes for advanced and reproducible development environments.

  • Workflow:

    • Most Python dependencies are managed via Pixi pyproject.toml.

    • For rare cases where a package is unavailable or needs customization, you may still want to define custom Nix packages in the .nix/overlays dir, please refer to overlays docs. Remember however that the goal of using pixi is to provide a pure nix agnostic solution.

    • The flake.nix file provides a Nix-based development shell that integrates with Pixi. It load automatically the dev pixi shell. You may want to override this behavior in the shellhook.

  • Use Case:
    Ideal for users who want the flexibility of Nix for custom or system-level dependencies, while still leveraging Pixi for Python package management. Additionally thanks to nix you can specify which pixi version you want without overriding your system wide pixi.

global-python-mlΒΆ

  • Purpose:
    A pure Pixi template for Python ML projects integrating in the conda environment.

  • Workflow:

    • All dependencies are managed through Pixi and specified in pyproject.toml.

    • No Nix overlays or custom Nix packaging.

    • As earlier, it can even handle the adding of packages that are neither on PyPI nor Official Conda channels using private channels.

  • Use Case:
    Best for projects where all requirements can be satisfied by PyPI or Conda packages, and no custom Nix packaging is needed.

GPU AccelerationΒΆ

  • Tested:
    Both templates have been tested for GPU-accelerated workflows (e.g., PyTorch with CUDA) on Linux only.

  • To-Do:

    • Test for compatibility and GPU support on:

      • [ ] macOS

      • [ ] NixOS