CVXPY is a Python-embedded modeling language for convex optimization problems.

Convex optimization is a powerful mathematical tool with applications to fields as diverse as machine learning, control, finance, and signal and image processing. Using convex optimization in an application requires either developing a custom solver or converting the problem into a standard form. Both of these tasks require expertise, and are time-consuming and error prone. An alternative is to use a domain-specific language (DSL) for convex optimization.

CVXPY is a DSL for convex optimization embedded in Python. It allows the user to express convex optimization problems in a natural syntax that follows the math, rather than in the restrictive standard form required by solvers. CVXPY makes it easy to combine convex optimization with high-level features of Python such as parallelism and object-oriented design. CVXPY is available at under the GPL license, along with documentation and examples.

CVXPY is widely used by researchers and industry practitioners who want to apply optimization to their problems. It has been downloaded thousands of times and used to teach multiple courses. Many tools have been built on top of CVXPY, such as an extension for stochastic optimization.

lightbulb_outline View ideas list


  • python


  • convex optimization
  • optimization
  • dsl
email Mailing list
mail_outline Contact email