Examples#

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 server (Quick Start), set the client environment and run the integrated examples below unchanged — no code edits are required. The Python async gRPC client section is separate: it uses Client(host, port) and does not read CUOPT_REMOTE_*.

On the client machine, before running the example commands or scripts:

export CUOPT_REMOTE_HOST=<gpu-server-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 / MIP)#

  • Convex Optimization Examples — runnable Python samples (LP, QP). With CUOPT_REMOTE_HOST and CUOPT_REMOTE_PORT set on the client, solves go to the remote server automatically.

  • MIP Examples — runnable Python samples (MIP). With CUOPT_REMOTE_HOST and CUOPT_REMOTE_PORT set on the client, solves go to the remote server automatically.

C API (LP / QP / MIP)#

cuopt_cli#

  • Examplescuopt_cli invocations. With the exports above, the CLI forwards solves to cuopt_grpc_server.

Minimal Demos (This Section)#

Included with the gRPC docs source for a quick copy-paste path (also walked through in Quick Start):

Python Async gRPC Client#

For explicit job control (submit / wait / cancel / stream logs or incumbents) without CUOPT_REMOTE_*, use cuopt.grpc.linear_programming.Client:

Custom gRPC Client#

Integrations that do not use remote execution or the Python async gRPC client 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#

REST vs gRPC#

  • Self-hosted HTTP/JSONExamples targets the REST server; request shapes follow the OpenAPI workflow, not the CuOptRemoteService protos.