skillfed

osqp

OSQP: The Operator Splitting QP Solver

osqp v1.1.3 5.5M downloads/30d#2,091 on PyPI
Permissive license Apache-2.0 Active released

What it is and what it does

OSQP is a numerical solver for convex quadratic programs—optimization problems that minimize a quadratic objective subject to linear inequality constraints. It wraps a C implementation of the Operator Splitting algorithm, making it accessible from Python. The solver targets problems of the form: minimize (1/2)x^T P x + q^T x subject to l ≤ Ax ≤ u, where P is positive semidefinite.

The package is used in control systems, machine learning, finance, and robotics where you need to solve QP subproblems efficiently. It depends on numpy and scipy for matrix operations, jinja2 for templating, setuptools for installation, and joblib for parallelization. Installation is straightforward via pip, with precompiled wheels available for modern Python versions (3.8+) on macOS, Linux, and Windows.

Use it for:

  • Solve model predictive control problems in robotics and autonomous systems
  • Optimize portfolio allocation and risk management in quantitative finance
  • Train support vector machines and other convex machine learning models
  • Solve convex relaxations of combinatorial optimization problems
  • Implement proximal algorithms and splitting methods in numerical optimization research

Worth the install?

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

OSQP is a Python wrapper for the Operator Splitting Quadratic Program solver, which solves convex quadratic optimization problems with linear constraints.

Yes. OSQP is a mature, actively maintained solver with no known vulnerabilities, permissive licensing, and broad platform support. Medium install friction is typical for compiled optimization libraries. Install it if you need to solve convex quadratic programs; it is a standard choice in control, finance, and machine learning workflows.

Install

osqp on PyPI

pip

pip install osqp

uv

uv add osqp

poetry

poetry add osqp

Installing osqp

Before you install

Medium install friction due to compiled wheels for multiple Python versions and platforms (3.10–3.13, macOS, Linux, Windows). Active maintenance with a recent release 63 days ago. Runtime dependencies on numpy, scipy, jinja2, setuptools, and joblib are standard scientific stack components.

License in practice

Apache-2.0 is a permissive license; you can use, modify, and distribute this package freely in commercial and private projects, provided you include a copy of the license and state significant changes.

Quickstart

pip install osqp

import osqp
import numpy as np

# Define a QP problem and solve it
m = osqp.OSQP()
m.setup(P=P, q=q, A=A, l=l, u=u)
results = m.solve()

Verify before relying

  • Whether the package actively maintains the underlying OSQP C library or relies on external updates
  • Performance characteristics and scalability limits for large-scale problems
  • Availability of GPU acceleration or parallel solving capabilities
  • Specific numerical stability guarantees and convergence properties

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.8)
Install friction medium — platform-specific wheel
Runtime dependencies 5 — jinja2, numpy, scipy, setuptools, joblib
Maintenance actively maintained — 63 days since the last release
First released
Downloads 5,475,125/month — #2,091 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: osqp-1.1.3-cp310-cp310-macosx_10_9_x86_64.whl; osqp-1.1.3-cp310-cp310-macosx_11_0_arm64.whl; osqp-1.1.3-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; osqp-1.1.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; osqp-1.1.3-cp310-cp310-win_amd64.whl; osqp-1.1.3-cp311-cp311-macosx_10_9_x86_64.whl; osqp-1.1.3-cp311-cp311-macosx_11_0_arm64.whl; osqp-1.1.3-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; osqp-1.1.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; osqp-1.1.3-cp311-cp311-win_amd64.whl; osqp-1.1.3-cp312-cp312-macosx_10_13_x86_64.whl; osqp-1.1.3-cp312-cp312-macosx_11_0_arm64.whl; osqp-1.1.3-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; osqp-1.1.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; osqp-1.1.3-cp312-cp312-win_amd64.whl; osqp-1.1.3-cp313-cp313-macosx_10_13_x86_64.whl; osqp-1.1.3-cp313-cp313-macosx_11_0_arm64.whl; osqp-1.1.3-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; osqp-1.1.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; osqp-1.1.3-cp313-cp313-win_amd64.whl

Tags

quadratic programming solverconvex optimizationQP solverlinear constraints optimizationoperator splitting algorithmnumerical optimizationconstrained quadratic minimization
optimizationquadratic-programmingnumerical-methods

More Mathematics packages