directsearch
A derivative-free solver for unconstrained minimization
Decision gist · record as of 2026-08-14
Yes, if you need derivative-free optimization for expensive or noisy objectives and accept the GPL-3.0-or-later copyleft license. The package is actively maintained, has no known vulnerabilities, and installs with low friction. It is well-suited for unconstrained problems and problems with linear constraints up to moderate dimension; for very high-dimensional problems, verify that the subspace method meets your scalability needs.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; objective function must accept and return numpy arrays and floats respectively.
- Low friction install with three standard scientific dependencies (setuptools, numpy, scipy).
- Actively maintained with a recent release and no known vulnerabilities.
License · maintenance · safety
GPL-3.0-or-later (copyleft) — Released under GPL-3.0-or-later (copyleft). You may use and modify the package freely, but any derivative work or distribution must also be released under a compatible GPL license.
last release 2026-06-04 (71 days) · last repo commit 2026-07-22 · 5 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 437,576 downloads/mo, #6,665 on PyPI
Alternatives
Verify before relying
pip install directsearch
import directsearch
import numpy as np
def objective(x):
return (x[0] - 2)**2 + (x[1] + 1)**2
x0 = np.array([0.0, 0.0])
soln = directsearch.solve(objective, x0)
print(soln.x, soln.f, soln.nf)- Scalability limits for high-dimensional problems beyond the mentioned rule-of-thumb threshold of ~50 dimensions.
- Actual convergence rates and wall-clock performance compared to other derivative-free solvers on standard benchmarks.
- How constraint handling in v1.1 affects solution quality and iteration count for typical constrained problems.
What it is and what it does
directsearch is a Python package implementing direct search methods for derivative-free optimization. It solves minimization problems where you have an objective function but cannot or do not want to compute its gradient—useful when function evaluations are expensive, noisy, or unavailable analytically. The package supports both unconstrained problems and problems with linear inequality constraints (including bounds). It depends on numpy and scipy for numerical operations.
The core interface is a single `solve()` function that takes your objective, a starting point, and optional constraint matrices, returning the approximate minimizer, its value, the number of function evaluations used, and a termination flag. The package also exposes specialized solvers: deterministic direct search, probabilistic descent variants, subspace methods for higher dimensions, and the stochastic three-points method. Configuration options include maximum evaluations, verbosity, and print frequency.
Use it for
- Optimize expensive simulations or physical experiments where gradient computation is infeasible or prohibitively costly.
- Tune hyperparameters or model coefficients when the objective is noisy or only available through sampling.
- Solve bound-constrained or linearly constrained problems without implementing custom constraint handling.
- Benchmark derivative-free methods on small to moderate-dimensional problems (roughly under 50 variables).
- Replace gradient-based optimizers when the objective is non-smooth or discontinuous in practice.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need derivative-free optimization for expensive or noisy objectives and accept the GPL-3.0-or-later copyleft license.
The package is actively maintained, has no known vulnerabilities, and installs with low friction. It is well-suited for unconstrained problems and problems with linear constraints up to moderate dimension; for very high-dimensional problems, verify that the subspace method meets your scalability needs.
Install
directsearch on PyPI
Before you install
Low friction install with three standard scientific dependencies (setuptools, numpy, scipy). Actively maintained with a recent release and no known vulnerabilities.
Requires Python 3.9 or later; objective function must accept and return numpy arrays and floats respectively.
License in practice
Released under GPL-3.0-or-later (copyleft). You may use and modify the package freely, but any derivative work or distribution must also be released under a compatible GPL license.
Quickstart
pip install directsearch
import directsearch
import numpy as np
def objective(x):
return (x[0] - 2)**2 + (x[1] + 1)**2
x0 = np.array([0.0, 0.0])
soln = directsearch.solve(objective, x0)
print(soln.x, soln.f, soln.nf)
Verify before relying
- Scalability limits for high-dimensional problems beyond the mentioned rule-of-thumb threshold of ~50 dimensions.
- Actual convergence rates and wall-clock performance compared to other derivative-free solvers on standard benchmarks.
- How constraint handling in v1.1 affects solution quality and iteration count for typical constrained problems.
Package facts
| License | GPL-3.0-or-later copyleft |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagessetuptoolsnumpyscipy |
| Maintenance | Actively maintained 71 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 437,576 / month, #6,665 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleFramework :: IPythonFramework :: JupyterIntended Audience :: Science/ResearchLicense :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)Operating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Mathematics |
Evidence: directsearch-1.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “derivative-free optimization”
- directsearchSolves unconstrained and linearly constrained nonlinear minimization…
- cmaCMA-ES is a derivative-free numerical optimization algorithm for…
- cmaesProvides CMA-ES (Covariance Matrix Adaptation Evolution Strategy)…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also cma · pyroots · optimistix · quadprog · nevergrad · lmfit · ropwr · scikit-optimize · proxsuite · moocore