JuMP supports the OSQP solver using the MathOptInterface interface. You can define a JuMP model to be solved via OSQP as follows

# Load JuMP and OSQP
using JuMP, OSQP

# Create OSQP Solver instance
s = OSQPMathProgBaseInterface.OSQPSolver(verbose=false)

# Create JuMP model
model = Model(solver=s)


Note that here we set the verbosity to false. After defining your model, you can solve it by just calling


For more details on how to create and modify the models, see the JuMP Documentation.