Skip to main content
Cellarium Logo

Cellarium ML: a machine learning framework for single-cell biology

Cellarium ML is a PyTorch Lightning-based library for distributed single-cell data analysis. It provides tools for training deep learning models on large-scale single-cell datasets, including distributed data loading, model training, and evaluation. Designed to be modular and extensible, Cellarium ML allows users to easily define custom models, data transformations, and training pipelines.


Code Organization

The code is organized as follows:

cellarium/
└── ml/
    ├── "callbacks"        # Custom PyTorch Lightning callbacks
    ├── "core"             # Essential components
    │   ├── "CellariumModule"              # PyTorch Lightning Module for model, training step, and optimizer
    │   ├── "CellariumAnnDataDataModule"   # DataModule for multi-GPU DataLoader for AnnData objects
    │   └── "CellariumPipeline"            # Pipeline for data transformations and model inference
    ├── "data"             # Distributed AnnData Collection and multi-GPU Iterable Datasets
    ├── "lr_schedulers"    # Custom learning rate schedulers
    ├── "models"           # Cellarium ML models
    ├── "preprocessing"    # Pre-processing functions
    ├── "transforms"       # Data transformation modules
    ├── "utilities"        # Utility functions for various submodules
    └── "cli.py"           # Implements the "cellarium-ml" CLI. Models must be registered here

Important Notes

cellarium/ml/models/*

  • Models must subclass CellariumModel and implement the following:

  • reset_parameters: Initializes model parameters.

  • forward: Returns a dictionary containing the computed loss under the loss key.

Optional hooks for training include:

  • on_train_start: Called at the start of training.

  • on_train_epoch_end: Triggered at the end of each epoch.

  • on_train_batch_end: Triggered at the end of each batch.

cellarium/ml/transforms/*

  • All transforms must subclass torch.nn.Module.

  • The forward method must output a dictionary where keys correspond to the input arguments for subsequent transforms or the model.

cellarium/ml/cli.py

  • Models must be registered here to be accessible via the command-line interface (cellarium-ml CLI).


Installation

To install via pip:

pip install cellarium-ml

To install the developer version from source:

git clone https://github.com/cellarium-ai/cellarium-ml.git
cd cellarium-ml
make install  # runs pip install -e .[dev]

API Documentation and Tutorials

For detailed API documentation and tutorials, visit: Cellarium ML Documentation


For Developers

To run the tests:

make test-examples                   # runs single-device cli example tests
make test-dataloader                 # runs single-device dataloader related tests
TEST_DEVICES=2 make test-dataloader  # runs multi-device dataloader related test
make test                            # runs single-device (all other) tests
TEST_DEVICES=2 make test             # runs multi-device (all other) tests

To format the code automatically:

make format                # runs ruff formatter and fixes linter errors

To run the linters:

make lint                  # runs ruff linter and checks for formatter errors

To build the documentation:

make docs                  # builds the documentation at docs/build/html

Metadata

Release files for cellarium-ml 0.0.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cellarium-ml 0.0.15
File Size Uploaded Provenance
cellarium_ml-0.0.15.tar.gz 246.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cellarium-ml 0.0.15
File Interpreter ABI Platform
cellarium_ml-0.0.15-py3-none-any.whl Python 3 none any Details

Total release size: 472.8 kB

Release files / cellarium_ml-0.0.15.tar.gz

Download URL cellarium_ml-0.0.15.tar.gz
Size 246.2 kB
Tags Source
SHA-256 checksum
How to use checksums
08437bbf7b6072e5819ffb0eebbb065bb682ace8e6f976e1453f90f990341a0b
BLAKE2b-256 checksum
How to use checksums
b8ab7c0e3f6e9c12ec41e151b543ccfbc6609a278dfb49ed5d12dc102e2e3cbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / cellarium_ml-0.0.15-py3-none-any.whl

Download URL cellarium_ml-0.0.15-py3-none-any.whl
Size 226.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af764c8aeac28dff4fc2b3f856aa903c56fcc3d331f232a464abf5a259622bf0
BLAKE2b-256 checksum
How to use checksums
7c49a1e523258bd5f817de4bcb3bda6df0a682b40c5d401a4fc4b3bf16135a52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for cellarium-ml 0.0.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cellarium_ml-0.0.15.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page