cuopt-numerical-optimization-api — Claude Code skill for LP, MILP, QP
A skill for NVIDIA cuOpt: it walks the agent through modeling LP, MILP and QP problems and picking the right interface — Python, C or CLI.
npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-api -a claude-codeWhat cuopt-numerical-optimization-api does
The skill covers modeling and solving LP, MILP and QP problems with NVIDIA's GPU-accelerated cuOpt solver. It ships no solver of its own. What's inside is a set of instructions plus three interface references: references/python_api.md, references/c_api.md and references/cli_api.md. The agent asks which interface you're on before writing any code, so you won't get Python snippets for a C++ project.
A good chunk of the skill is about picking the problem type. Linear objective with continuous variables means LP. Add integers or binaries and you're in MILP. Squared or cross terms like x*x and x*y push you into QP, which is still beta. The rule it gives: counts of things are integer, amounts are continuous. QP has a hard edge — the solver only accepts MINIMIZE, so maximizing means negating the objective and the reported value. Integer QP isn't supported at all, and Q should be positive semi-definite.
If your model already lives in AMPL, GAMS / GAMSPy, PuLP, JuMP, Pyomo or CVXPY, the skill suggests pointing that tool's solver at cuOpt instead of porting the model. Duals and reduced costs come back for LP and QP only; MILP has none, and quadratic constraints return NaN even for LP. Settings such as time_limit and mip_relative_gap differ per interface, so check the matching reference file.
What it helps with
- decide between LP, MILP and QP for a given problem
- tell integer variables from continuous ones by the problem wording
- write a cuOpt model in Python
- wire cuOpt as the solver behind an existing Pyomo or CVXPY model
- figure out why a QP solve rejects MAXIMIZE
Example prompts for the agent
- Solve this linear program with cuOpt in Python
- I have a Pyomo model — set cuOpt as the solver
- Why is my QP returning a non-optimal result?
How to install cuopt-numerical-optimization-api
1Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-api -a claude-code2Manually: put the files in place
~/.claude/skills/cuopt-numerical-optimization-api/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/cuopt-numerical-optimization-api/
1Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-api -a codex2Manually: put the files in place
.agents/skills/cuopt-numerical-optimization-api/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-api -a cursor2Manually: put the files in place
.cursor/skills/cuopt-numerical-optimization-api/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install NVIDIA/skills cuopt-numerical-optimization-api2Manually: put the files in place
.github/skills/cuopt-numerical-optimization-api/SKILL.md1Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-api -a gemini-cli2Platform CLI
gemini skills install https://github.com/NVIDIA/skills --path skills/cuopt-numerical-optimization-apiManually: put the files in place
.devin/skills/cuopt-numerical-optimization-api/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-api -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about cuopt-numerical-optimization-api
How do I install cuopt-numerical-optimization-api in Claude?
Run npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-api -a claude-code. The skill file then lands at ~/.claude/skills/cuopt-numerical-optimization-api/SKILL.md.
What does cuopt-numerical-optimization-api do?
It guides the agent through modeling and solving LP, MILP and QP problems with the NVIDIA cuOpt solver. It also explains which interface to use and what each problem type allows.
Can I use cuOpt with Pyomo or CVXPY?
Yes. cuOpt works as a solver backend for AMPL, GAMS / GAMSPy, PuLP, JuMP, Pyomo and CVXPY, so the model stays in the tool you already use.
Source text
SKILL.md · Apache-2.0
---
name: cuopt-numerical-optimization-api
version: "26.10.00"
description: LP, MILP, and QP (beta) with cuOpt — Python, C, and CLI. Use when the user is solving LP, MILP, or QP with any cuOpt interface.
license: Apache-2.0
metadata:
author: NVIDIA cuOpt Team
tags:
- cuopt
- linear-programming
- milp
- qp
- python
- c-api
- cli
---
# 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:
| Interface | When to use | Reference |
|-----------|-------------|-----------|
| **Python** | User is writing Python code | [references/python_api.md](references/python_api.md) |
| **C / C++** | User is embedding in a C/C++ application | [references/c_api.md](references/c_api.md) |
| **CLI** | User is solving from MPS files on the command line | [references/cli_api.md](references/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](https://docs.nvidia.com/cuopt/user-guide/latest/thirdparty_modeling_languages/index.html).
## 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 continuous | **LP** |
| Linear | Some integer or binary | **MILP** |
| Has squared (`x*x`) or cross (`x*y`) terms | Continuous (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 / concept | Variable type | Examples |
|---------------------------|---------------|----------|
| **Discrete entities (counts)** | **INTEGER** | Workers, cars, trucks, machines, pilots, facilities, units to manufacture |
| **Yes/no or on/off** | **INTEGER** (binary, lb=0 ub=1) | Open a facility, run a machine, assign a person to a shift |
| **Amounts that can be fractional** | **CONTINUOUS** | Tonnes, litres, dollars, hours, kWh, proportion of capacity |
| **Rates or fractions** | **CONTINUOUS** | Utilization, 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)
| Problem | Likely cause | Fix |
|---------|-------------|-----|
| Infeasible | Conflicting constraints | Check constraint logic and bounds |
| Unbounded | Missing bounds | Add variable bounds |
| Slow solve | Large problem | Set time limit; increase gap tolerance |
| QP rejected with MAXIMIZE | QP only supports MINIMIZE | Negate the objective; negate the result |
| QP returns non-optimal | Q not PSD or badly scaled | Check Q is PSD; rescale variables |
## Solver Settings (concepts)
| Setting | Purpose |
|---------|---------|
| `time_limit` | Stop after N seconds |
| `mip_relative_gap` | Stop MILP when within X% of optimal |
| `mip_absolute_tolerance` | Absolute MIP gap stop |
| `log_to_console` | Enable solver logging |
Syntax varies by interface — see the interface reference file.
© NVIDIA cuOpt Team · Apache-2.0 · NVIDIA/skills