Skip to main content
saealib

Status: Beta ci-tests codecov pypi-saealib-v pypi-python-v Apache-2.0 Downloads

uv ruff ty NumPy

Status: Active Development (Beta)

Warning: This project is under active development. APIs are subject to change without notice. Operation is not guaranteed in production environments.

A comprehensive library for Surrogate-Assisted Evolutionary Algorithms (SAEAs) in Python.
Designed for expensive optimization problems where function evaluations are costly, saealib provides a modular framework to combine evolutionary algorithms, surrogate models, and model management strategies.

Table of Contents

Why saealib

saealib is designed around composable components for surrogate-assisted evolutionary optimization. Surrogates, acquisition functions, model-management strategies, and optimization pipelines can be replaced independently, making it suitable for researchers and practitioners who want to experiment with SAEA structure rather than treat an algorithm as monolithic.

General-purpose libraries such as pymoo provide broad evolutionary optimization coverage. saealib complements them by focusing on modular surrogate-assisted optimization and the surrogate/strategy layer.

Documents

See the official documentation for the architecture, component reference, tutorials, and API.

Key Features

  • Composable SAEA architecture: major optimization components — Algorithm, Surrogate, SurrogateManager, AcquisitionFunction, OptimizationStrategy, EvaluationPlanner, Evaluator, and more — are independently replaceable and can be assembled fluently with Optimizer.set_*().

  • First-class evaluation decisions: separate candidate generation, surrogate scoring, and true-evaluation planning. New surrogate-assisted strategies or batch-selection ideas can often be implemented by replacing a single component without rewriting the optimization loop.

  • Validated composition: component contracts and the graph compiler check structural compatibility — including data flow, required services, lifecycle, state access, and runtime capabilities — before optimization begins, with structured diagnostics for invalid configurations.

  • Surrogate and model-management toolkit: built-in RBF plus adapters for scikit-learn, XGBoost, LightGBM, and PyTorch, with regression, feasibility-classification, and pairwise-comparison workflows.

  • Evolutionary and multi-objective optimization: GA and PSO with configurable operators, mixed-variable support, Pareto/epsilon-dominance ranking, NSGA-II/III and R-NSGA-II comparators, hypervolume indicators, and decomposition methods for MOEA/D-style setups.

  • Constraint handling: equality and inequality constraints, epsilon-constraint tolerance scheduling, feasibility surrogates, and gradient-based repair.

  • Interoperability: reuse implementations from other optimization ecosystems through adapters for pymoo and DEAP, from individual crossover/mutation operators to complete algorithms and problems.

  • Experimentation and observability: typed pipeline callbacks, execution history, result visualization, asynchronous evaluation, and experiment tooling for multi-trial sweeps, parallel execution, checkpointing, and resume.

Installation

Requirements

  • Python >= 3.10
pip install saealib
# or
uv add saealib

saealib is still pre-1.0, so the public API may change between minor versions. The command above installs the latest stable release; pre-releases need pip install --pre saealib.

Optional extras

Extra Adds
sklearn scikit-learn-based surrogates
xgboost XGBoost surrogate
lightgbm LightGBM surrogate
torch PyTorch-based components
parallel joblib-based parallel evaluation
pymoo pymoo adapters for crossover, mutation, algorithm, and problem
deap DEAP adapters for crossover, mutation, and generate/update algorithms
viz Matplotlib-based result and history plots
tqdm tqdm progress bars for experiment sweeps
rich Rich progress bars for experiment sweeps
hdf5 HDF5 trial-result storage and loading via h5py
all All optional dependencies listed above
pip install "saealib[sklearn,parallel]"
# or install everything
pip install "saealib[all]"

Install from source

For contributing or a development setup, see CONTRIBUTING.md.

Quick Start

minimize() / maximize() run a surrogate-assisted optimization end-to-end with sensible defaults (GA algorithm, RBF surrogate, individual-based strategy):

import numpy as np
from saealib import minimize


def sphere(x):
    return np.sum(x**2)


result = minimize(
    sphere,
    dim=5,
    lb=[-5.0] * 5,
    ub=[5.0] * 5,
    max_fe=500,
    seed=0,
)

print(result.x, result.f)

Every default is overridable — pass algorithm='PSO', surrogate='rbf', strategy='gb'/'ps', or your own component instances (Algorithm, Surrogate/SurrogateManager, OptimizationStrategy).

For per-generation inspection, custom pipelines, or research-style control loops, build an Optimizer directly and drive it with .iterate() instead of .run(). See the documentation for the low-level API and full component reference.

Contributing

Contributions are welcome! Please refer to CONTRIBUTING.md for guidelines on how to contribute to this project.

License

Apache License 2.0

Metadata

Release files for saealib 0.1.0

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

Source distribution (sdist)

Source distribution for saealib 0.1.0
File Size Uploaded
saealib-0.1.0.tar.gz 5.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for saealib 0.1.0
File Interpreter ABI Platform
saealib-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.7 MB

Release files / saealib-0.1.0.tar.gz

Download URL saealib-0.1.0.tar.gz
Size 5.2 MB
Tags Source
SHA-256 checksum
How to use checksums
08df4012770cffd539b6a521a9aa1f5cd434fee55d2777f810a0e7a4d14796a7
BLAKE2b-256 checksum
How to use checksums
7a77ad9dfae2fec3018c50198fd00399f5f2a20b825a8cfd3ecfd4cfcaba750d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 3, 2026.

Transparency log

Release files / saealib-0.1.0-py3-none-any.whl

Download URL saealib-0.1.0-py3-none-any.whl
Size 549.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d3192e522988777c58f78b75ca9f2dfb39f4b4f78ce45b5eb2e12f9c5772e90
BLAKE2b-256 checksum
How to use checksums
801cef449454843364fe380646803d3c7ed369e070ea907b3ca84c2cf317d165
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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