sparkle is a parametric, gradient-free optimization library that I mostly developed at CEMEF, in the CFL group (public repo from the team is here). It is designed to provide a common interface to various algorithms, and to make numerical experimentation easy.
If you end up using this library for research purpose, please consider citing the following paper (link):
Mixed-variable policy-based optimization
J. Viquerat
arXiv pre-print 2506.13240, 2025
Clone this repository and install it locally. We recommend to use uv:
git clone git@github.com:jviquerat/sparkle.git
cd sparkle
uv venv
source .venv/bin/activate
uv pip install -r pyproject.toml
uv pip install -e .
Environments are expected to be available locally or present in the path. To train an agent on an environment, a .json case file is required (sample files are available in sparkle/env). Once you have written the corresponding <env_name>.json file to configure your agent, just run:
spk --train <json_file>
| Environment | Default dimension | Description | Illustration |
|---|---|---|---|
lorenz |
4 | Optimizing a control law for the chaotic Lorenz attractor, adapted from this ref (solved with PBO) |
![]() |
n-body |
9 | Optimizing the initial parameters to find periodic orbits, adapted from this ref (solved with CMAES) |
![]() |
heat-source |
14 | Optimizing the positions of heat sources to obtain a high temperature distribution with low variance in a target area (solved with CMAES) |
![]() |
packing |
26 | Finding the best disk packing within a square domain, adapted from this ref (solved with PBO) |
![]() |
emstack |
40 | Optimizing the reflectance of a dielectric mirror with mixed continuous/discrete variables (solved with PBO) |
![]() |









