Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Antisource/heronaisec/llms.txt

Use this file to discover all available pages before exploring further.

This page covers everything you need to set up a working Heron AI Security environment: system requirements, virtual environment creation, dependency installation, and a verification script that confirms PyTorch can see your hardware. Following these steps in order ensures a clean, reproducible environment before you run any experiments.

System Requirements

RequirementMinimumNotes
Python3.8 or higher3.10+ recommended
pipLatest stableIncluded with Python 3.8+
GitAny recent versionRequired to clone the repository
CUDA-capable GPUOptionalStrongly recommended; CPU-only runs are supported but slow
Check your Python version before proceeding:
python --version

Installation Steps

1. Clone the Repository

git clone https://github.com/Antisource/heronaisec.git
cd heronaisec

2. Create a Virtual Environment

Creating an isolated environment prevents dependency conflicts with other Python projects on your system.
python -m venv .venv

3. Activate the Virtual Environment

source .venv/bin/activate
Your shell prompt will update to show (.venv) when the environment is active. All subsequent pip install and python commands will operate inside this environment.

4. Install Dependencies

pip install -r requirements.txt

Dependencies

The requirements.txt file pins every dependency to a compatible version range. The table below documents each package, its pinned range, and its role in the framework.

Deep Learning

PackageVersion RangePurpose
torch>=2.7,<3.0Core deep learning runtime; model training and inference on CPU and GPU

Hugging Face Ecosystem

PackageVersion RangePurpose
transformers>=4.56,<5.0Pre-trained transformer models and tokenizers (DistilBERT, BERT)
datasets>=3.6,<4.0Standardised dataset loading and preprocessing (SST-2 via GLUE)
accelerate>=1.8,<2.0Hardware-agnostic training acceleration used internally by Transformers
evaluate>=0.4.6,<0.5Metric computation utilities (accuracy, etc.)

Scientific Computing

PackageVersion RangePurpose
numpy>=2.0,<3.0Numerical array operations underpinning data manipulation
pandas>=2.2,<3.0Tabular storage and export of per-stage evaluation metrics
scikit-learn>=1.7,<2.0Supporting utilities for dataset splitting and evaluation helpers

Visualization

PackageVersion RangePurpose
matplotlib>=3.10,<4.0Publication-quality figures: persistence curves and intervention plots

Configuration

PackageVersion RangePurpose
PyYAML>=6.0,<7.0YAML parsing for experiment configuration files under configs/

Utilities

PackageVersion RangePurpose
tqdm>=4.67,<5.0Progress bars during training and evaluation loops

Verifying the Installation

After installation, run the included verification script to confirm that PyTorch is installed correctly and that your GPU (if present) is visible to the framework.
python test.py
The script prints a four-line summary of your environment:
PyTorch version: 2.7.0
CUDA version: 12.4
CUDA available: True
GPU: NVIDIA GeForce RTX 3090
If no CUDA-capable GPU is detected, the last line reads:
No GPU detected by PyTorch
Automatic GPU detectionHeron AI Security uses torch.cuda.is_available() to detect CUDA at runtime. The entry point main.py prints the detected device name at startup — Using GPU: <name> or Using CPU — before any experiment logic runs. You do not need to set environment variables or modify configuration files to switch between CPU and GPU; the framework handles device placement automatically.
Running on CPUAll experiments will complete without a GPU, but training DistilBERT on CPU is significantly slower than on a CUDA-capable device. A single baseline run that takes a few minutes on an RTX-class GPU may take several hours on CPU. If you are working on a CPU-only machine, consider using a smaller prototype subset (the train_dataset.select(range(5000)) call in experiments/baseline.py is already active by default) or reducing the number of training epochs in configs/baseline.yaml to keep iteration times manageable.

Build docs developers (and LLMs) love