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
.It can even handle the adding of packages that are neither on PyPI nor Official Conda channels using private channels.
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 usingpixi
is to provide a purenix
agnostic solution.The
flake.nix
file provides a Nix-based development shell that integrates with Pixi. It load automatically thedev
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 whichpixi
version you want without overriding your system widepixi
.
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