New to Claude Skills? Learn how to install them →

nvidia on GitHub

cuOpt Numerical Optimization API

OfficialFree

Solve LP, MILP, and QP problems with GPU acceleration.

by nvidia2.8k stars on nvidia/skills
Updated Aug 7, 2026
Get this skill

Free · Opens the source repo

What cuOpt Numerical Optimization API does

The cuOpt Numerical Optimization API allows users to model and solve Linear Programming (LP), Mixed Integer Linear Programming (MILP), and Quadratic Programming (QP) problems using NVIDIA's GPU-accelerated solver. This skill is particularly useful for developers and data scientists who require efficient optimization solutions for complex problems that involve large datasets or intricate constraints. With interfaces available for Python, C/C++, and command-line usage, users can easily integrate cuOpt into their existing workflows.

For those already utilizing modeling languages such as AMPL, GAMS, PuLP, JuMP, Pyomo, or CVXPY, cuOpt serves as a backend solver, enabling seamless integration with minimal code changes. This is especially beneficial for users who have existing models and prefer not to rewrite them to fit a new API. The skill supports various optimization scenarios, making it adaptable to a wide range of applications, from resource allocation to production planning.

When choosing between LP, MILP, and QP, users can refer to specific guidelines based on their problem's objectives and variable types. LP is recommended for continuous variables, MILP for problems requiring integer or binary decisions, and QP for objectives involving squared or cross terms. The API also provides tools for managing common issues, such as infeasibility and slow solving times, ensuring users can troubleshoot effectively.

Overall, the cuOpt Numerical Optimization API is a powerful tool for anyone needing to perform advanced optimization tasks efficiently, leveraging the capabilities of NVIDIA's hardware to enhance performance and speed.

When to use it

Use this skill when you need to solve optimization problems efficiently, especially when working with large datasets or complex constraints.

When not to use it

This skill may not be suitable for simple optimization tasks or when working in environments without access to NVIDIA GPUs.

What you can build with it

Production Planning Optimization

Use cuOpt to optimize production schedules and resource allocation in manufacturing environments, ensuring efficient use of materials and labor.

Logistics and Routing Problems

Apply cuOpt for solving complex routing problems in logistics, such as vehicle routing or facility location, to minimize costs and improve service levels.

Financial Portfolio Optimization

Leverage cuOpt's capabilities for quadratic programming to optimize financial portfolios, minimizing risk while maximizing returns.

How to install cuOpt Numerical Optimization API

View source

1. Install with the skills CLI

npx skills add nvidia/skills/cuopt-numerical-optimization-api --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by nvidia

cuOpt Numerical Optimization API

Model and solve LP, MILP, and QP problems using NVIDIA cuOpt's GPU-accelerated solver.

Interface Selection

Choose the reference for the user's interface:

InterfaceWhen to useReference
PythonUser is writing Python codereferences/python_api.md
C / C++User is embedding in a C/C++ applicationreferences/c_api.md
CLIUser is solving from MPS files on the command linereferences/cli_api.md

If the interface is not yet clear, ask before writing any code.

Already using a modeling language? cuOpt also works as a solver backend for third-party modeling tools — AMPL, GAMS / GAMSPy, PuLP, JuMP, Pyomo, and CVXPY — with near-zero code changes (point the model's solver at cuOpt). CVXPY additionally covers convex QP and, in beta, QCQP / SOCP. Prefer this when the user already has a model in one of these tools rather than porting it to the cuOpt API. See Third-Party Modeling Languages.

Choosing LP vs MILP vs QP

Decide from the objective and variables:

If the objective is...And variables are...Use
Linear (sum of c_i * x_i)All continuousLP
LinearSome integer or binaryMILP
Has squared (x*x) or cross (x*y) termsContinuous (integer QP not supported)QP (beta)

Prefer LP when the problem allows it. LP solves faster and has stronger optimality guarantees. Use MILP only when the problem logically requires whole numbers or yes/no decisions. Use QP only when the objective is genuinely quadratic (variance, squared error, kinetic energy).

  • Use LP when every quantity can meaningfully be fractional: flows, proportions, rates, dollars, hours, tonnes of material, etc.
  • Use MILP when the problem mentions counts of discrete entities, yes/no choices, or either/or decisions (e.g. open a facility or not, assign a person to a shift, number of trucks).
  • Use QP when the objective minimizes variance, squared error, or any expression with x*x or x*y terms (portfolio optimization, least squares, regularized regression).

Integer vs Continuous from Wording

Problem wording / conceptVariable typeExamples
Discrete entities (counts)INTEGERWorkers, cars, trucks, machines, pilots, facilities, units to manufacture
Yes/no or on/offINTEGER (binary, lb=0 ub=1)Open a facility, run a machine, assign a person to a shift
Amounts that can be fractionalCONTINUOUSTonnes, litres, dollars, hours, kWh, proportion of capacity
Rates or fractionsCONTINUOUSUtilization, percentage, share of budget

Rule of thumb: "How many things" → INTEGER. "How much" → CONTINUOUS.

QP Rules (all interfaces)

  • MINIMIZE only — the solver rejects MAXIMIZE for quadratic objectives. To maximize f(x), minimize -f(x) and negate the reported objective value.
  • Continuous variables only — integer QP is not supported.
  • Q should be positive semi-definite for a convex, well-posed problem.
  • Beta — API may evolve; treat as production-capable for typical convex QP.

Dual Values

Duals and reduced costs are available for LP and QP only:

  • MILP — no duals (integer optima are not continuous).
  • Quadratic constraints — duals unavailable even for LP/QP; all values return NaN.
  • PDLP warmstart — LP only; MILP solves do not accept a PDLP warmstart.

Common Issues (all interfaces)

ProblemLikely causeFix
InfeasibleConflicting constraintsCheck constraint logic and bounds
UnboundedMissing boundsAdd variable bounds
Slow solveLarge problemSet time limit; increase gap tolerance
QP rejected with MAXIMIZEQP only supports MINIMIZENegate the objective; negate the result
QP returns non-optimalQ not PSD or badly scaledCheck Q is PSD; rescale variables

Solver Settings (concepts)

SettingPurpose
time_limitStop after N seconds
mip_relative_gapStop MILP when within X% of optimal
mip_absolute_toleranceAbsolute MIP gap stop
log_to_consoleEnable solver logging

Syntax varies by interface — see the interface reference file.

Frequently asked questions about cuOpt Numerical Optimization API

Similar skills