Metadata-Version: 2.4
Name: ai-studio-blueprint-kit
Version: 0.1.1
Summary: Reusable Python utilities for HP AI Studio and notebook-centric ML workflows.
Author-email: Ata Turhan <ata.turhan@hp.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/HPInc/AI-Studio-Blueprint-Kit
Project-URL: Repository, https://github.com/HPInc/AI-Studio-Blueprint-Kit
Project-URL: Issues, https://github.com/HPInc/AI-Studio-Blueprint-Kit/issues
Project-URL: Discussions, https://github.com/HPInc/AI-Studio-Blueprint-Kit/discussions
Keywords: ai,ml,notebook,jupyter,gpu,memory,vram,blueprints
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: notebook
Requires-Dist: matplotlib>=3.8; extra == "notebook"
Requires-Dist: ipython>=8.0; extra == "notebook"
Provides-Extra: torch
Requires-Dist: torch>=2.0; extra == "torch"
Provides-Extra: nvidia
Requires-Dist: nvidia-ml-py>=12.0; extra == "nvidia"
Provides-Extra: dev
Requires-Dist: build>=1.2.1; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: twine>=5.1.0; extra == "dev"
Requires-Dist: ruff>=0.6.0; extra == "dev"
Dynamic: license-file

# AI-Studio-Blueprint-Kit

`AI-Studio-Blueprint-Kit` is a public Python package and source repository for reusable utilities that support AI Studio blueprint development.

This repository is intentionally structured for growth. It starts with the `memory_guard` module and can later include additional modules under the same top-level package.

## Current module

### `ai_studio_blueprint_kit.memory_guard`

A notebook-oriented RAM and VRAM resource guard designed for local AI and ML workflows.

Main capabilities:
- checks Linux or WSL RAM availability from `/proc/meminfo`
- attempts NVIDIA VRAM detection through `nvidia-smi`, `torch`, or `pynvml`
- renders rich notebook warnings and pass/fail status with IPython HTML and Markdown when available
- shuts down the active Jupyter kernel when total hardware is insufficient

## Installation

Base install:

```bash
pip install ai-studio-blueprint-kit
```

With notebook UI dependencies:

```bash
pip install "ai-studio-blueprint-kit[notebook]"
```

With GPU helper dependency:

```bash
pip install "ai-studio-blueprint-kit[gpu]"
```

With Torch fallback support:

```bash
pip install "ai-studio-blueprint-kit[torch]"
```

## Usage

```python
from ai_studio_blueprint_kit.memory_guard import run_memory_check_notebook

run_memory_check_notebook(
    min_total_ram_gb=16.0,
    min_total_vram_gb=8.0,
)
```

Lower-level usage:

```python
from ai_studio_blueprint_kit.memory_guard import check_ram, check_vram

ram = check_ram()
vram = check_vram()

print(ram)
print(vram)
```

## Repository layout

```text
AI-Studio-Blueprint-Kit/
├── .github/
│   └── workflows/
├── src/
│   └── ai_studio_blueprint_kit/
│       ├── __init__.py
│       └── memory_guard/
│           ├── __init__.py
│           └── core.py
├── tests/
├── LICENSE
├── MANIFEST.in
├── README.md
└── pyproject.toml
```

## Adding future modules

New modules should be added under:

```text
src/ai_studio_blueprint_kit/
```

Examples:

```text
src/ai_studio_blueprint_kit/data_checks/
src/ai_studio_blueprint_kit/model_utils/
src/ai_studio_blueprint_kit/notebook_ui/
```

This keeps the public import surface consistent:

```python
from ai_studio_blueprint_kit.memory_guard import run_memory_check_notebook
```

## Development

Create a virtual environment and install development dependencies:

```bash
pip install -e ".[dev]"
```

Run tests:

```bash
pytest
```

Build package distributions:

```bash
python -m build
```

Validate distributions:

```bash
python -m twine check dist/*
```

## Publishing

Recommended release flow:

1. publish the repository publicly on GitHub
2. test on TestPyPI first
3. configure PyPI Trusted Publishing for GitHub Actions
4. push a version tag such as `v0.1.0`

## Notes

- The current RAM check is Linux and WSL oriented because it reads `/proc/meminfo`.
- VRAM detection is primarily intended for NVIDIA environments.
- Notebook rendering is optional and is only used when IPython is available.
- Kernel shutdown on hard failure is intentional in the current `memory_guard` behavior.

## License

MIT
