skillfed

nevergrad

A Python toolbox for performing gradient-free optimization

nevergrad v1.0.12 482.3K downloads/30d#6,423 on PyPI4,201
Permissive license MIT Active released

What it is and what it does

Nevergrad is a Python optimization library designed for problems where gradients are unavailable or expensive to compute. It implements multiple gradient-free algorithms (including evolutionary strategies, Bayesian optimization, and CMA-ES variants) and lets you specify complex search spaces with bounded continuous variables, discrete choices, and mixtures of both through its Instrumentation API. You define a function to minimize, describe the parameter space, set a budget, and the optimizer explores and returns the best point found.

The library is maintained by Facebook Research and actively developed. It's commonly used for hyperparameter tuning in machine learning, algorithm configuration, and any black-box optimization task where you can evaluate a function but cannot compute gradients. Dependencies include numpy for numerics, cma for covariance-matrix adaptation, and bayesian-optimization for probabilistic search strategies.

Use it for:

  • Tuning hyperparameters (learning rate, batch size, architecture choice) for neural networks without access to gradient information.
  • Optimizing simulator or expensive-to-evaluate function outputs where finite differences are impractical.
  • Finding optimal configurations for complex systems with mixed continuous and categorical parameters.
  • Benchmarking and comparing multiple gradient-free algorithms on the same optimization problem.
  • Automating parameter search for legacy code or proprietary black-box functions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Nevergrad is a gradient-free optimization library that finds optimal parameter values for functions without requiring derivatives, supporting continuous, discrete, and mixed variable spaces.

Yes. Nevergrad is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It's well-suited if you need gradient-free optimization with support for mixed variable types. Install it if you're doing hyperparameter tuning, black-box optimization, or algorithm configuration without access to gradients.

Install

nevergrad on PyPI

pip

pip install nevergrad

uv

uv add nevergrad

poetry

poetry add nevergrad

Installing nevergrad

Before you install

Low install friction; pure Python wheel with six runtime dependencies (numpy, cma, bayesian-optimization, typing-extensions, pandas, directsearch). Repository is active with recent commits and no known vulnerabilities.

License in practice

MIT license is permissive; you can use, modify, and distribute nevergrad with minimal restrictions in commercial and open-source projects.

Quickstart

pip install nevergrad

import nevergrad as ng

def square(x):
    return sum((x - .5)**2)

optimizer = ng.optimizers.NGOpt(parametrization=2, budget=100)
recommendation = optimizer.minimize(square)
print(recommendation.value)

Requires Python 3.6 or later; numpy and other dependencies must be installed.

Verify before relying

  • Whether the library scales well to high-dimensional optimization problems or very large budgets.
  • Performance comparison with other gradient-free optimizers on standard benchmarks.
  • Specific convergence guarantees or theoretical properties of the NGOpt algorithm.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 6 — numpy, cma, bayesian-optimization, typing-extensions, pandas, directsearch
Maintenance actively maintained — 478 days since the last release
Last repo commit
First released
Downloads 482,272/month — #6,423 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: nevergrad-1.0.12-py3-none-any.whl

Intended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonTopic :: Scientific/Engineering

Tags

gradient-free optimizationblack-box function optimizationhyperparameter tuning without gradientsderivative-free optimizationmixed variable optimizationevolutionary algorithmsparameter search
optimizationhyperparameter-tuningblack-box

More Scientific/Engineering packages

Further reading