Skip to main content

Aeryl SDK

A Python SDK for training and deploying machine learning models to detect and analyze chaos in production systems.

Installation

pip install aeryl-sdk

Quick Start

from aeryl_sdk import AerylModel

# Initialize and train a new model
model = AerylModel(
    dev_path='data/company_research_dev.csv',
    prod_path='data/company_research_prod.csv',
    models_dir='models'
)
model_id = model.train()

# Or load an existing model by ID
model = AerylModel(
    dev_path='data/company_research_dev.csv',
    prod_path='data/company_research_prod.csv',
    models_dir='models',
    model_id='your-model-id'
)

# Make predictions
predictions = model.predict()

AerylModel Class

The AerylModel class provides a high-level interface for training and inference using the chaos classifier.

Initialization

model = AerylModel(
    dev_path='path/to/dev/data.csv',    # Path to development dataset
    prod_path='path/to/prod/data.csv',  # Path to production dataset
    models_dir='models',                # Directory to save/load models
    model_id=None                       # Optional: ID of existing model to load
)

Key Methods

Training

# Train the model on the development dataset
model_id = model.train()

Returns a dictionary containing the model ID.

Loading a Model

# Load an existing model by ID
model.load_model(model_id)

This method is automatically called during initialization if a model_id is provided.

Prediction

# Make predictions on the production dataset
predictions = model.predict(model_id=None)  # Optional: specify model_id

Returns a dictionary containing predictions for each run and step:

{
    'model_id': 'uuid-123',
    'predictions': {
        'run_1': {
            'step_1': {'prediction': True, 'probability': 0.85},
            'step_2': {'prediction': False, 'probability': 0.12},
            'step_3': {'prediction': True, 'probability': 0.92}
        },
        'run_2': {
            'step_1': {'prediction': False, 'probability': 0.08},
            'step_2': {'prediction': False, 'probability': 0.15},
            'step_3': {'prediction': False, 'probability': 0.23}
        }
    }
}

Model Management

# List all available trained models
models = model.list_models()

# Get detailed information about a specific model
model_info = model.get_model_info(model_id)

# Delete a specific model
success = model.delete_model(model_id)

Performance Analysis

# Get performance metrics for all steps or a specific step
metrics = model.get_performance_metrics(step=None)

# Get detailed information about a specific step model
step_info = model.get_step_model_info(step)

# Get dataset statistics
stats = model.describe_datasets()

Dataset Statistics Format

The describe_datasets() method returns statistics for both development and production datasets:

{
    'development': {
        'num_runs': int,          # Total number of runs
        'num_steps': int,         # Number of steps per run
        'error_free_runs': int,   # Number of runs without errors
        'error_runs': int,        # Number of runs with errors
        'training_rows': int,     # Number of training data points
        'unique_runs': int,       # Number of unique runs
        'error_free_pairs': int,  # Number of error-free pairs
        'error_pairs': int        # Number of error pairs
    },
    'production': {
        'num_runs': int,          # Total number of runs
        'num_steps': int          # Number of steps per run
    }
}

Model Serialization

# Convert model state to JSON
json_str = model.to_json()

# Create model instance from JSON
model = AerylModel.from_json(json_str)

Example Usage

Here's a complete example showing how to train a model and save the results:

from aeryl_sdk import AerylModel
import json
import os
from datetime import datetime

def main():
    # Initialize the model
    model = AerylModel(
        dev_path='data/company_research_dev.csv',
        prod_path='data/company_research_prod.csv',
        models_dir='models'
    )
    
    # Train the model
    model_id = model.train()
    
    # Get dataset statistics and performance metrics
    dataset_stats = model.describe_datasets()
    performance_metrics = model.get_performance_metrics()
    predictions = model.predict()
    
    # Create output dictionary
    output = {
        'timestamp': datetime.now().isoformat(),
        'model_id': model_id,
        'dataset_statistics': dataset_stats,
        'performance_metrics': performance_metrics,
        'predictions': predictions
    }
    
    # Save results to JSON file
    os.makedirs('output', exist_ok=True)
    output_file = f'output/model_run_{datetime.now().strftime("%Y%m%d_%H%M%S")}.json'
    with open(output_file, 'w') as f:
        json.dump(output, f, indent=2)

if __name__ == '__main__':
    main()

Requirements

  • Python 3.7+
  • XGBoost
  • NumPy
  • Polars
  • scikit-learn

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please read our Contributing Guidelines for details on our code of conduct and the process for submitting pull requests.

Contact

For any questions or concerns, please contact us at info@aeryl.ai.

Metadata

Release files for aeryl-sdk 0.1.2

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

Source distribution (sdist)

Source distribution for aeryl-sdk 0.1.2
File Size Uploaded Provenance
aeryl_sdk-0.1.2.tar.gz 21.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aeryl-sdk 0.1.2
File Interpreter ABI Platform
aeryl_sdk-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 40.8 kB

Release files / aeryl_sdk-0.1.2.tar.gz

Download URL aeryl_sdk-0.1.2.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c04fa910e535446d11a1da1e49a6d02f4f37fc66b48d0a9f757896453461cbca
BLAKE2b-256 checksum
How to use checksums
f0657b54c59b518761f7a8c65d613330e5bea2fc8937580496290f004e57b07b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / aeryl_sdk-0.1.2-py3-none-any.whl

Download URL aeryl_sdk-0.1.2-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d615311cbd7f59b220532f7d6b5ef221fa9694cd74910b54c9164f77bbf466f
BLAKE2b-256 checksum
How to use checksums
d4e2996593a0e4498a29c136dfcc0c65328200b2ab10b99210fc595dd37d9b08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for aeryl-sdk 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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