Metadata-Version: 2.4
Name: kryo
Version: 0.3.0
Summary: Sub-second cold starts for GPU inference
Project-URL: Homepage, https://github.com/akhileshsharma99/kryo
Project-URL: Repository, https://github.com/akhileshsharma99/kryo
Project-URL: Issues, https://github.com/akhileshsharma99/kryo/issues
Project-URL: Changelog, https://github.com/akhileshsharma99/kryo/blob/main/CHANGELOG.md
Author-email: Akhilesh Sharma <sharmaninenine@gmail.com>
License-Expression: MIT
Keywords: checkpoint,cold-start,criu,gpu,inference
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# Kryo Python SDK

Python helper for [Kryo](https://github.com/akhileshsharma99/kryo) checkpoint signaling. It is optional: other languages send `SIGUSR1` / wait for `SIGUSR2`, or use `kryo snapshot create --wait`.

`kryo.checkpoint()` does not snapshot by itself. The Kryo CLI freezes the process after it receives that signal.

## Installation

```bash
pip install kryo
```

You still need the [Kryo CLI](https://github.com/akhileshsharma99/kryo#installation), CRIU, and `cuda-checkpoint` on Linux. `kryo snapshot create` and `kryo run` must be run as root (`sudo`).

## Usage

```python
import kryo

# Setup (runs once, gets checkpointed)
model = load_model()
model.to("cuda")

kryo.checkpoint()  # Freeze here

# Inference (runs after restore)
result = model(input)
```

Then:

```bash
sudo kryo snapshot create --name mymodel -- python app.py
sudo kryo run --snapshot mymodel
```

`checkpoint()` is idempotent. Recreate the snapshot when the code, model, CUDA toolkit, or NVIDIA driver changes.

## Requirements

- Linux (CRIU is Linux-only)
- Kryo CLI on `PATH`
- NVIDIA driver 550+ for GPU checkpointing
- CRIU and `cuda-checkpoint`
