Examples#
gRPC remote execution uses the same Python, C API, and cuopt_cli entry points as a local solve. After you start cuopt_grpc_server on the GPU host (Quick start), set the client environment and run any of the examples below unchanged — no code edits are required.
On the client host, before running the example commands or scripts:
export CUOPT_REMOTE_HOST=<gpu-hostname-or-ip>
export CUOPT_REMOTE_PORT=5001
Add TLS or tuning variables from Advanced configuration if your deployment uses them.
Note
Routing solve over gRPC is not supported. For solving routing problems remotely today, use the HTTP/JSON REST self-hosted server and Examples.
Where to find examples#
Python (LP / QP / MILP)#
LP, QP and MILP Examples — runnable Python samples (LP, QP, MILP). With
CUOPT_REMOTE_HOSTandCUOPT_REMOTE_PORTset on the client, solves go to the remote server automatically.
C API (LP / QP / MILP)#
LP/QP C API Examples — LP and QP C examples.
MILP C API Examples — MILP C examples.
Compile and run these programs with the same exports in the shell;
solve_lp/solve_mipuse gRPC when both remote variables are set (see cuOpt LP/QP/MILP C API Reference for API reference).
cuopt_cli#
Examples —
cuopt_cliinvocations. With the exports above, the CLI forwards solves tocuopt_grpc_server.
Minimal demos (this section)#
Bundled with the gRPC docs source for a quick copy-paste path (also walked through in Quick start):
Custom gRPC client#
Integrations that do not use the bundled Python / C / CLI stack should speak CuOptRemoteService directly. See gRPC API (reference), gRPC server behavior, and cpp/docs/grpc-server-architecture.md in the repository for protos and server behavior.
More samples#
NVIDIA cuOpt examples on GitHub — set the remote environment on the client before running notebooks or scripts.
REST vs gRPC#
Self-hosted HTTP/JSON — Examples targets the REST server; request shapes follow the OpenAPI workflow, not the
CuOptRemoteServiceprotos.