cuOpt User Rules
Read this when helping someone use cuOpt — calling the SDK, installing, deploying the server, or formulating optimization problems. For modifying cuOpt itself, switch to cuopt-developer.
When to Use
Activate this skill when the user:
- Asks about NVIDIA cuOpt (routing, LP, MILP, QP, or related solvers)
- Needs help installing, configuring, or deploying cuOpt
- Wants to write code that calls the cuOpt Python API, C API, REST server, or CLI
- Is formulating an optimization problem and needs guidance on constraints, objectives, or data
- Asks about cuOpt examples, documentation, or troubleshooting
Do NOT use this skill for cuOpt internal development, source code changes, or build-system work — use cuopt-developer instead.
Prerequisites
- Windows host is primary (PowerShell). Keep Windows path notes when present.
- User may or may not have cuOpt installed — never assume installation is needed.
- If the user references
scripts/ or references/ subdirectories, load them on demand (see Procedure).
Procedure
1. Ask Before Assuming
Always clarify ambiguous requirements before implementing:
- What language/interface? (Python, C, REST server, CLI)
- What problem type? (routing, LP, MILP, QP)
- What constraints matter? (time windows, capacities, precedence, etc.)
- What output format?
Skip asking only if:
- User explicitly stated the requirement
- Context makes it unambiguous (e.g., user shows Python code)
2. Handle Incomplete Questions
If a question seems partial or incomplete, ask follow-up questions:
- "Could you tell me more about [missing detail]?"
- "What specifically would you like to achieve with this?"
- "Are there any constraints or requirements I should know about?"
Common missing information to probe for:
- Problem size (number of vehicles, locations, variables, constraints)
- Specific constraints (time windows, capacities, precedence)
- Performance requirements (time limits, solution quality)
- Integration context (existing codebase, deployment environment)
Don't guess — ask. A brief clarifying question saves time vs. solving the wrong problem.
3. Clarify Data Requirements
Before generating examples, ask about data:
Check if user has data:
- "Do you have specific data you'd like to use, or should I create a sample dataset?"
- "Can you share the format of your input data?"
If using synthesized data:
- State clearly: "I'll create a sample dataset for demonstration"
- Keep it small and understandable (e.g., 5-10 locations, 2-3 vehicles)
- Make values realistic and meaningful
Always document what you used:
"For this example I'm using:
- [X] locations/variables/constraints
- [Key assumptions: e.g., all vehicles start at depot, 8-hour shifts]
- [Data source: synthesized / user-provided / from docs]"
State assumptions explicitly:
- "I'm assuming [X] — let me know if this differs from your scenario"
- List any default values or simplifications made
4. MUST Verify Understanding
Before writing substantial code, you MUST confirm your understanding:
"Let me confirm I understand:
- Problem: [restate in your words]
- Constraints: [list them]
- Objective: [minimize/maximize what]
- Interface: [Python/REST/C/CLI]
Is this correct?"
5. Follow Requirements Exactly
- Use the exact variable names, formats, and structures the user specifies
- Don't add features the user didn't ask for
- Don't change the problem formulation unless asked
- If user provides partial code, extend it — don't rewrite from scratch
6. Check Environment First
Before writing code or suggesting installation, verify the user's setup:
Ask how they access cuOpt:
- "Do you have cuOpt installed? If so, which interface?"
- "What environment are you using? (local GPU, cloud, Docker, server, etc.)"
Different packages by language/interface:
| Language / Interface |
Package |
Check |
| Python |
cuopt (pip/conda) — also pulls in libcuopt |
import cuopt |
| C |
libcuopt (pip/conda) — already present if cuopt is installed |
find libcuopt.so or header check |
| REST Server |
cuopt-server or Docker |
curl /cuopt/health |
| CLI |
cuopt package includes CLI |
cuopt_cli --help |
Note: cuopt declares libcuopt as a runtime dependency, so installing the Python package also installs the C library and headers. Installing libcuopt on its own does not install the Python API.
If not installed, ask how they want to access:
- "Would you like help installing cuOpt, or do you have access another way?"
- Options: pip, conda, Docker, cloud instance, existing remote server
Never assume installation is needed — the user may:
- Already have it installed
- Be connecting to a remote server
- Prefer a specific installation method
- Only need the C library (not Python)
Ask before running any verification commands:
# Python API check - ask first
import cuopt
print(cuopt.__version__)
# C API check - ask first
find ${CONDA_PREFIX} -name "libcuopt.so"
# Server check - ask first
curl http://localhost:8000/cuopt/health
7. Check Results
After providing a solution, guide the user to verify:
- Status check: Is it
Optimal / FeasibleFound / SUCCESS?
- Constraint satisfaction: Are all constraints met?
- Objective value: Is it reasonable for the problem?
Always end with a Result summary that includes at least:
- Solver status (e.g. Optimal, FeasibleFound, SUCCESS).
- Objective value with highlight — easy to spot (bold or code block). Example: Objective value (min total cost):
<value> or Objective value: <value>.
- Briefly what the objective represents (e.g. total cost, total profit).
Do not bury the objective value only in the middle of a paragraph; it must appear prominently in this summary. Use sufficient precision (don't truncate or round unnecessarily unless the problem asks for it).
Workflow: Formulate once carefully (with verified understanding), solve, then sanity-check the result. If something is wrong, fix it with a targeted change — avoid spinning through many model variants. Decide, implement, verify, then move on.
Provide diagnostic code snippets when helpful.
8. Post-Correction Check (Mandatory)
If the result required a correction, retry, or workaround to reach this point, you MUST evaluate the skill-evolution workflow (skills/skill-evolution/SKILL.md) before moving on. Do not skip this step.
9. Loading Reference Files
- If the user references
scripts/ — load relevant scripts from the scripts/ directory within this skill folder when needed for examples or diagnostics.
- If the user references
references/ — load reference documentation from the references/ directory when deeper API or configuration detail is needed.
- Load these on demand, not preemptively.
Pitfalls
Never Install Packages Automatically
🔒 MANDATORY — You MUST NOT install, upgrade, or modify packages. Provide the exact command; the user runs it. No exceptions.
| Forbidden |
What to do instead |
pip install ..., conda install ..., apt install ..., any package manager |
Give the exact command and ask the user to run it. Say why the package is needed. |
When a package is needed: Identify it, provide the exact command, explain why, then wait for the user to confirm they ran it. Even if the user says "just install it", give the command and require them to execute it themselves.
Ask Before Running
Do not execute commands or code without explicit permission:
| Action |
Rule |
| Shell commands |
Show command, explain what it does, ask "Should I run this?" |
| Package installs |
Never run installs yourself — give the exact command, user runs it |
| Examples/scripts |
Show the code first, ask "Would you like me to run this?" |
| File writes |
Explain what will change, ask before writing |
Exceptions (okay without asking):
- Read-only commands the user explicitly requested
- Commands the user just provided and asked you to run
No Privileged Operations
Never do these without explicit user request AND confirmation:
- Use
sudo or run as root
- Modify system files or configurations
- Add package repositories or keys
- Change firewall, network, or driver settings
- Write files outside the workspace
Common Mistakes
- Guessing problem size or constraints — always ask if unclear
- Rewriting user code from scratch — extend, don't replace
- Adding unrequested features — follow requirements exactly
- Burying the objective value — it must be prominent in the result summary
- Assuming installation is needed — user may already have cuOpt or use a remote server
- Installing
libcuopt alone expecting Python API — it does NOT include the Python API; install cuopt instead
Verification
Verify Environment
Ask the user to run (do not run yourself unless explicitly permitted):
# Python API check
import cuopt
print(cuopt.__version__)
# C API check
find ${CONDA_PREFIX} -name "libcuopt.so"
# Server health check
curl http://localhost:8000/cuopt/health
Verify Solution
After solving, confirm:
- Solver status is
Optimal, FeasibleFound, or SUCCESS
- All constraints are satisfied
- Objective value is reasonable for the problem size and type
Verify Understanding
Before writing substantial code, restate the problem and get confirmation (see Procedure step 4).
Resources
Documentation
Examples
Support
Related Skills
- cuopt-developer — Use when modifying cuOpt internals, source code, or build system
- skill-evolution — Mandatory evaluation after any correction, retry, or workaround (see Procedure step 8)
1---
2name: cuopt-user-rules
3version: "26.08.01"
4description: "Guides end users calling NVIDIA cuOpt for routing, LP, MILP, or QP via Python, C, REST, or CLI — install, formulate, and check solver status. Use when asking about the cuOpt SDK, installation, server deploy, or optimization problem setup. Not for modifying cuOpt internals, source, or build systems (cuopt-developer). Never auto-install packages."
5license: Apache-2.0
6metadata:
7 source: https://skillmd.com/skills/kayforkind/cuopt-user-rules
8 author: NVIDIA cuOpt Team
9 tags:
10 - cuopt
11 - user-rules
12 - guidelines
13---
14
15# cuOpt User Rules
16
17**Read this when helping someone *use* cuOpt** — calling the SDK, installing, deploying the server, or formulating optimization problems. For modifying cuOpt itself, switch to `cuopt-developer`.
18
19---
20
21## When to Use
22
23Activate this skill when the user:
24- Asks about NVIDIA cuOpt (routing, LP, MILP, QP, or related solvers)
25- Needs help installing, configuring, or deploying cuOpt
26- Wants to write code that calls the cuOpt Python API, C API, REST server, or CLI
27- Is formulating an optimization problem and needs guidance on constraints, objectives, or data
28- Asks about cuOpt examples, documentation, or troubleshooting
29
30**Do NOT use this skill** for cuOpt internal development, source code changes, or build-system work — use `cuopt-developer` instead.
31
32---
33
34## Prerequisites
35
36- Windows host is primary (PowerShell). Keep Windows path notes when present.
37- User may or may not have cuOpt installed — never assume installation is needed.
38- If the user references `scripts/` or `references/` subdirectories, load them on demand (see Procedure).
39
40---
41
42## Procedure
43
44### 1. Ask Before Assuming
45
46**Always clarify ambiguous requirements before implementing:**
47
48- What **language/interface**? (Python, C, REST server, CLI)
49- What problem type? (routing, LP, MILP, QP)
50- What constraints matter? (time windows, capacities, precedence, etc.)
51- What output format?
52
53**Skip asking only if:**
54- User explicitly stated the requirement
55- Context makes it unambiguous (e.g., user shows Python code)
56
57### 2. Handle Incomplete Questions
58
59If a question seems partial or incomplete, ask follow-up questions:
60
61- "Could you tell me more about [missing detail]?"
62- "What specifically would you like to achieve with this?"
63- "Are there any constraints or requirements I should know about?"
64
65**Common missing information to probe for:**
66- Problem size (number of vehicles, locations, variables, constraints)
67- Specific constraints (time windows, capacities, precedence)
68- Performance requirements (time limits, solution quality)
69- Integration context (existing codebase, deployment environment)
70
71**Don't guess — ask.** A brief clarifying question saves time vs. solving the wrong problem.
72
73### 3. Clarify Data Requirements
74
75Before generating examples, ask about data:
76
771. **Check if user has data:**
78 - "Do you have specific data you'd like to use, or should I create a sample dataset?"
79 - "Can you share the format of your input data?"
80
812. **If using synthesized data:**
82 - State clearly: "I'll create a sample dataset for demonstration"
83 - Keep it small and understandable (e.g., 5-10 locations, 2-3 vehicles)
84 - Make values realistic and meaningful
85
863. **Always document what you used:**
87 ```
88 "For this example I'm using:
89 - [X] locations/variables/constraints
90 - [Key assumptions: e.g., all vehicles start at depot, 8-hour shifts]
91 - [Data source: synthesized / user-provided / from docs]"
92 ```
93
944. **State assumptions explicitly:**
95 - "I'm assuming [X] — let me know if this differs from your scenario"
96 - List any default values or simplifications made
97
98### 4. MUST Verify Understanding
99
100Before writing substantial code, you MUST confirm your understanding:
101
102```
103"Let me confirm I understand:
104- Problem: [restate in your words]
105- Constraints: [list them]
106- Objective: [minimize/maximize what]
107- Interface: [Python/REST/C/CLI]
108Is this correct?"
109```
110
111### 5. Follow Requirements Exactly
112
113- Use the **exact** variable names, formats, and structures the user specifies
114- Don't add features the user didn't ask for
115- Don't change the problem formulation unless asked
116- If user provides partial code, extend it — don't rewrite from scratch
117
118### 6. Check Environment First
119
120Before writing code or suggesting installation, verify the user's setup:
121
1221. **Ask how they access cuOpt:**
123 - "Do you have cuOpt installed? If so, which interface?"
124 - "What environment are you using? (local GPU, cloud, Docker, server, etc.)"
125
1262. **Different packages by language/interface:**
127
128 | Language / Interface | Package | Check |
129 |----------------------|---------|-------|
130 | **Python** | `cuopt` (pip/conda) — also pulls in `libcuopt` | `import cuopt` |
131 | **C** | `libcuopt` (pip/conda) — already present if `cuopt` is installed | `find libcuopt.so` or header check |
132 | REST Server | `cuopt-server` or Docker | `curl /cuopt/health` |
133 | CLI | `cuopt` package includes CLI | `cuopt_cli --help` |
134
135 **Note:** `cuopt` declares `libcuopt` as a runtime dependency, so installing the Python package also installs the C library and headers. Installing `libcuopt` on its own does **not** install the Python API.
136
1373. **If not installed, ask how they want to access:**
138 - "Would you like help installing cuOpt, or do you have access another way?"
139 - Options: pip, conda, Docker, cloud instance, existing remote server
140
1414. **Never assume installation is needed** — the user may:
142 - Already have it installed
143 - Be connecting to a remote server
144 - Prefer a specific installation method
145 - Only need the C library (not Python)
146
1475. **Ask before running any verification commands:**
148 ```python
149 # Python API check - ask first
150 import cuopt
151 print(cuopt.__version__)
152 ```
153 ```bash
154 # C API check - ask first
155 find ${CONDA_PREFIX} -name "libcuopt.so"
156 ```
157 ```bash
158 # Server check - ask first
159 curl http://localhost:8000/cuopt/health
160 ```
161
162### 7. Check Results
163
164After providing a solution, guide the user to verify:
165
166- **Status check**: Is it `Optimal` / `FeasibleFound` / `SUCCESS`?
167- **Constraint satisfaction**: Are all constraints met?
168- **Objective value**: Is it reasonable for the problem?
169
170**Always end with a Result summary** that includes at least:
171- Solver status (e.g. Optimal, FeasibleFound, SUCCESS).
172- **Objective value with highlight** — easy to spot (bold or code block). Example: **Objective value (min total cost):** `<value>` or `Objective value: <value>`.
173- Briefly what the objective represents (e.g. total cost, total profit).
174
175Do not bury the objective value only in the middle of a paragraph; it must appear prominently in this summary. Use sufficient precision (don't truncate or round unnecessarily unless the problem asks for it).
176
177**Workflow:** Formulate once carefully (with verified understanding), solve, then sanity-check the result. If something is wrong, fix it with a targeted change — avoid spinning through many model variants. Decide, implement, verify, then move on.
178
179Provide diagnostic code snippets when helpful.
180
181### 8. Post-Correction Check (Mandatory)
182
183If the result required a correction, retry, or workaround to reach this point, you MUST evaluate the skill-evolution workflow (`skills/skill-evolution/SKILL.md`) before moving on. Do not skip this step.
184
185### 9. Loading Reference Files
186
187- If the user references `scripts/` — load relevant scripts from the `scripts/` directory within this skill folder when needed for examples or diagnostics.
188- If the user references `references/` — load reference documentation from the `references/` directory when deeper API or configuration detail is needed.
189- Load these on demand, not preemptively.
190
191---
192
193## Pitfalls
194
195### Never Install Packages Automatically
196
197> **🔒 MANDATORY — You MUST NOT install, upgrade, or modify packages.** Provide the exact command; the user runs it. No exceptions.
198
199| Forbidden | What to do instead |
200|-----------|--------------------|
201| `pip install ...`, `conda install ...`, `apt install ...`, any package manager | Give the exact command and ask the user to run it. Say why the package is needed. |
202
203**When a package is needed:** Identify it, provide the exact command, explain why, then wait for the user to confirm they ran it. Even if the user says "just install it", give the command and require them to execute it themselves.
204
205### Ask Before Running
206
207Do not execute commands or code without explicit permission:
208
209| Action | Rule |
210|--------|------|
211| Shell commands | Show command, explain what it does, ask "Should I run this?" |
212| Package installs | **Never** run installs yourself — give the exact command, user runs it |
213| Examples/scripts | Show the code first, ask "Would you like me to run this?" |
214| File writes | Explain what will change, ask before writing |
215
216**Exceptions (okay without asking):**
217- Read-only commands the user explicitly requested
218- Commands the user just provided and asked you to run
219
220### No Privileged Operations
221
222**Never do these without explicit user request AND confirmation:**
223
224- Use `sudo` or run as root
225- Modify system files or configurations
226- Add package repositories or keys
227- Change firewall, network, or driver settings
228- Write files outside the workspace
229
230### Common Mistakes
231
232- **Guessing problem size or constraints** — always ask if unclear
233- **Rewriting user code from scratch** — extend, don't replace
234- **Adding unrequested features** — follow requirements exactly
235- **Burying the objective value** — it must be prominent in the result summary
236- **Assuming installation is needed** — user may already have cuOpt or use a remote server
237- **Installing `libcuopt` alone expecting Python API** — it does NOT include the Python API; install `cuopt` instead
238
239---
240
241## Verification
242
243### Verify Environment
244
245Ask the user to run (do not run yourself unless explicitly permitted):
246
247```python
248# Python API check
249import cuopt
250print(cuopt.__version__)
251```
252
253```bash
254# C API check
255find ${CONDA_PREFIX} -name "libcuopt.so"
256```
257
258```bash
259# Server health check
260curl http://localhost:8000/cuopt/health
261```
262
263### Verify Solution
264
265After solving, confirm:
2661. **Solver status** is `Optimal`, `FeasibleFound`, or `SUCCESS`
2672. **All constraints** are satisfied
2683. **Objective value** is reasonable for the problem size and type
269
270### Verify Understanding
271
272Before writing substantial code, restate the problem and get confirmation (see Procedure step 4).
273
274---
275
276## Resources
277
278### Documentation
279- [cuOpt User Guide](https://docs.nvidia.com/cuopt/user-guide/latest/introduction.html)
280- [API Reference](https://docs.nvidia.com/cuopt/user-guide/latest/api.html)
281
282### Examples
283- [cuopt-examples repo](https://github.com/NVIDIA/cuopt-examples)
284- [Google Colab notebooks](https://colab.research.google.com/github/nvidia/cuopt-examples/)
285
286### Support
287- [File a Bug](https://github.com/NVIDIA/cuopt/issues/new?template=bug_report.md)
288- [Ask a Question](https://github.com/NVIDIA/cuopt/issues/new?template=submit-question.md)
289- [All Issues](https://github.com/NVIDIA/cuopt/issues)
290
291---
292
293## Related Skills
294
295- **cuopt-developer** — Use when modifying cuOpt internals, source code, or build system
296- **skill-evolution** — Mandatory evaluation after any correction, retry, or workaround (see Procedure step 8)