LP Python Examples#
The following example showcases how to use the CuOptServiceSelfHostClient to solve a simple LP problem.
The OpenAPI specification for the server is available in open-api spec. The example data is structured as per the OpenAPI specification for the server, please refer LPData under “POST /cuopt/request” under schema section. LP and MIP share same spec.
If you want to run server locally, please run the following command in a terminal or tmux session so you can test examples in another terminal.
1export ip="localhost"
2export port=5000
3cuopt_grpc_server --port 5001 &
4python -m cuopt_server.cuopt_proxy --ip $ip --port $port --grpc-port 5001
Generic LP Example#
1# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2# SPDX-License-Identifier: Apache-2.0
3"""
4Basic LP Server Example
5
6This example demonstrates how to use the cuOpt Self-Hosted Service Client
7to solve an LP problem via the cuOpt server.
8
9Requirements:
10 - cuOpt server running (default: localhost:5000)
11 - cuopt_sh_client package installed
12
13Problem:
14 Minimize: -0.2*x1 + 0.1*x2
15 Subject to:
16 3.0*x1 + 4.0*x2 <= 5.4
17 2.7*x1 + 10.1*x2 <= 4.9
18 x1, x2 >= 0
19
20The data is structured according to the OpenAPI specification (LPData):
21 - csr_constraint_matrix: Constraint matrix in CSR format
22 - constraint_bounds: Upper and lower bounds for constraints
23 - objective_data: Objective coefficients and settings
24 - variable_bounds: Variable bounds
25 - solver_config: Solver settings
26
27Expected Response:
28 A single LP solution
29"""
30
31from cuopt_sh_client import CuOptServiceSelfHostClient
32import json
33import time
34
35
36def repoll(cuopt_service_client, solution, repoll_tries):
37 """
38 Repoll the server for solution if it's still processing.
39
40 If solver is still busy solving, the job will be assigned a request id
41 and response is sent back in the format {"reqId": <REQUEST-ID>}.
42 """
43 if "reqId" in solution and "response" not in solution:
44 req_id = solution["reqId"]
45 for i in range(repoll_tries):
46 solution = cuopt_service_client.repoll(
47 req_id, response_type="dict"
48 )
49 if "reqId" in solution and "response" in solution:
50 break
51
52 # Sleep for a second before requesting
53 time.sleep(1)
54
55 return solution
56
57
58def main():
59 """Run the basic LP example."""
60 # Example data for LP problem
61 # The data is structured as per the OpenAPI specification for the server
62 data = {
63 "csr_constraint_matrix": {
64 "offsets": [0, 2, 4],
65 "indices": [0, 1, 0, 1],
66 "values": [3.0, 4.0, 2.7, 10.1],
67 },
68 "constraint_bounds": {
69 "upper_bounds": [5.4, 4.9],
70 "lower_bounds": ["ninf", "ninf"],
71 },
72 "objective_data": {
73 "coefficients": [-0.2, 0.1],
74 "scalability_factor": 1.0,
75 "offset": 0.0,
76 },
77 "variable_bounds": {
78 "upper_bounds": ["inf", "inf"],
79 "lower_bounds": [0.0, 0.0],
80 },
81 "maximize": False,
82 "solver_config": {"tolerances": {"optimality": 0.0001}},
83 }
84
85 # If cuOpt is not running on localhost:5000, edit ip and port parameters
86 cuopt_service_client = CuOptServiceSelfHostClient(
87 ip="localhost", port=5000, polling_timeout=25, timeout_exception=False
88 )
89
90 # Number of repoll requests to be carried out for a successful response
91 repoll_tries = 500
92
93 # Logging callback
94 def log_callback(log):
95 for i in log:
96 print("server-log: ", i)
97
98 solution = cuopt_service_client.get_LP_solve(
99 data, response_type="dict", logging_callback=log_callback
100 )
101
102 solution = repoll(cuopt_service_client, solution, repoll_tries)
103
104 print(json.dumps(solution, indent=4))
105
106
107if __name__ == "__main__":
108 main()
The response would be as follows:
1{
2 "response": {
3 "solver_response": {
4 "status": "Optimal",
5 "solution": {
6 "problem_category": "LP",
7 "primal_solution": [
8 1.8,
9 0.0
10 ],
11 "dual_solution": [
12 -0.06666666666666668,
13 0.0
14 ],
15 "primal_objective": -0.36000000000000004,
16 "dual_objective": 6.92188481708744e-310,
17 "solver_time": 0.006462812423706055,
18 "vars": {},
19 "lp_statistics": {
20 "primal_residual": 6.92114652678267e-310,
21 "dual_residual": 6.9218848170975e-310,
22 "gap": 6.92114652686054e-310,
23 "nb_iterations": 1
24 },
25 "reduced_cost": [
26 0.0,
27 0.0031070813207920247
28 ],
29 "milp_statistics": {}
30 }
31 },
32 "total_solve_time": 0.013341188430786133
33 },
34 "reqId": "c7f2e5a1-d210-4e2e-9308-4257d0a86c4a"
35}
Note
Warm start is only applicable to LP and not for MIP.
Warm Start#
Previously run solutions can be saved and be used as warm start for new requests using previously run reqIds as follows:
1# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2# SPDX-License-Identifier: Apache-2.0
3"""
4LP Warmstart Server Example
5
6This example demonstrates how to use warmstart functionality with the cuOpt server.
7Warmstart allows reusing solution context from a previous solve to speed up
8solving of similar problems.
9
10Note:
11 Warmstart is only applicable to LP, not for MIP.
12
13Important:
14 To use warm start with PDLP, presolve must be explicitly disabled.
15 Set "presolve": "off" in solver_config, as presolve transforms the problem
16 and the warm start solution from the original problem cannot be applied.
17
18Requirements:
19 - cuOpt server running (default: localhost:5000)
20 - cuopt_sh_client package installed
21
22Problem 1 & 2:
23 Minimize: -0.2*x1 + 0.1*x2
24 Subject to:
25 3.0*x1 + 4.0*x2 <= 5.4
26 2.7*x1 + 10.1*x2 <= 4.9
27 x1, x2 >= 0
28
29The second solve reuses the solution context from the first solve.
30"""
31
32from cuopt_sh_client import CuOptServiceSelfHostClient
33import json
34
35
36def main():
37 """Run the warmstart LP example."""
38 data = {
39 "csr_constraint_matrix": {
40 "offsets": [0, 2, 4],
41 "indices": [0, 1, 0, 1],
42 "values": [3.0, 4.0, 2.7, 10.1],
43 },
44 "constraint_bounds": {
45 "upper_bounds": [5.4, 4.9],
46 "lower_bounds": ["ninf", "ninf"],
47 },
48 "objective_data": {
49 "coefficients": [-0.2, 0.1],
50 "scalability_factor": 1.0,
51 "offset": 0.0,
52 },
53 "variable_bounds": {
54 "upper_bounds": ["inf", "inf"],
55 "lower_bounds": [0.0, 0.0],
56 },
57 "maximize": False,
58 "solver_config": {
59 "tolerances": {"optimality": 0.0001},
60 "pdlp_solver_mode": 1, # Stable2
61 "presolve": 0,
62 },
63 }
64
65 # If cuOpt is not running on localhost:5000, edit ip and port parameters
66 cuopt_service_client = CuOptServiceSelfHostClient(
67 ip="localhost", port=5000, timeout_exception=False
68 )
69
70 print("=== Solving Problem 1 ===")
71 # Set delete_solution to false so it can be used in next request
72 initial_solution = cuopt_service_client.get_LP_solve(
73 data, delete_solution=False, response_type="dict"
74 )
75
76 print(f"Problem 1 reqId: {initial_solution['reqId']}")
77 print(
78 f"Objective: {initial_solution['response']['solver_response']['solution']['primal_objective']}"
79 )
80
81 print("\n=== Solving Problem 2 with Warmstart ===")
82 # Use previous solution saved in server as warmstart for this request.
83 # That solution is referenced with previous request id.
84 solution = cuopt_service_client.get_LP_solve(
85 data, warmstart_id=initial_solution["reqId"], response_type="dict"
86 )
87
88 print(json.dumps(solution, indent=4))
89
90 # Delete saved solution if not required to save space
91 print("\n=== Cleaning Up ===")
92 cuopt_service_client.delete(initial_solution["reqId"])
93 print("Saved solution deleted")
94
95
96if __name__ == "__main__":
97 main()
The response would be as follows:
1{
2 "response": {
3 "solver_response": {
4 "status": "Optimal",
5 "solution": {
6 "problem_category": "LP",
7 "primal_solution": [
8 1.8,
9 0.0
10 ],
11 "dual_solution": [
12 -0.06666666666666668,
13 0.0
14 ],
15 "primal_objective": -0.36000000000000004,
16 "dual_objective": 6.92188481708744e-310,
17 "solver_time": 0.006613016128540039,
18 "vars": {},
19 "lp_statistics": {
20 "primal_residual": 6.921146112128e-310,
21 "dual_residual": 6.9218848170975e-310,
22 "gap": 6.92114611220587e-310,
23 "nb_iterations": 1
24 },
25 "reduced_cost": [
26 0.0,
27 0.0031070813207920247
28 ],
29 "milp_statistics": {}
30 }
31 },
32 "total_solve_time": 0.013310909271240234
33 },
34 "reqId": "6d1e278f-5505-4bcc-8a33-2f7f7d6f8a30"
35}
Using MPS or LP File Directly#
The self-hosted client accepts both MPS and LP format files — the client
dispatches on the file extension (.lp ⇒ LP parser, otherwise MPS) and
sends the parsed data model to the server. An example on using .mps files
as input is shown below:
1# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2# SPDX-License-Identifier: Apache-2.0
3"""
4LP MPS File Server Example
5
6This example demonstrates how to solve LP problems from MPS files using the
7cuOpt server. MPS (Mathematical Programming System) is a standard file format
8for representing optimization problems.
9
10Requirements:
11 - cuOpt server running (default: localhost:5000)
12 - cuopt_sh_client package installed
13
14Problem (in MPS format):
15 Minimize: -0.2*VAR1 + 0.1*VAR2
16 Subject to:
17 3*VAR1 + 4*VAR2 <= 5.4
18 2.7*VAR1 + 10.1*VAR2 <= 4.9
19 VAR1, VAR2 >= 0
20
21Expected Response:
22 {
23 "response": {
24 "solver_response": {
25 "status": "Optimal",
26 "solution": {
27 "primal_objective": -0.36,
28 "vars": {
29 "VAR1": 1.8,
30 "VAR2": 0.0
31 }
32 }
33 }
34 }
35 }
36"""
37
38from cuopt_sh_client import (
39 CuOptServiceSelfHostClient,
40 ThinClientSolverSettings,
41)
42import json
43import os
44
45
46def main():
47 """Run the MPS file LP example."""
48 data = "sample.mps"
49
50 # MPS file content
51 mps_data = """NAME good-1
52ROWS
53 N COST
54 L ROW1
55 L ROW2
56COLUMNS
57 VAR1 COST -0.2
58 VAR1 ROW1 3 ROW2 2.7
59 VAR2 COST 0.1
60 VAR2 ROW1 4 ROW2 10.1
61RHS
62 RHS1 ROW1 5.4 ROW2 4.9
63ENDATA
64"""
65
66 # Write MPS file
67 with open(data, "w") as file:
68 file.write(mps_data)
69
70 print(f"Created MPS file: {data}")
71
72 # If cuOpt is not running on localhost:5000, edit `ip` and `port` parameters
73 cuopt_service_client = CuOptServiceSelfHostClient(
74 ip="localhost", port=5000, timeout_exception=False
75 )
76
77 # Configure solver settings
78 ss = ThinClientSolverSettings()
79 ss.set_parameter("time_limit", 5)
80 ss.set_optimality_tolerance(0.00001)
81
82 print("\n=== Solving LP from MPS File ===")
83 solution = cuopt_service_client.get_LP_solve(
84 data, solver_config=ss, response_type="dict"
85 )
86
87 print(json.dumps(solution, indent=4))
88
89 # Delete the mps file after solving
90 if os.path.exists(data):
91 os.remove(data)
92 print(f"Deleted MPS file: {data}")
93
94
95if __name__ == "__main__":
96 main()
The response is:
1{
2 "response": {
3 "solver_response": {
4 "status": "Optimal",
5 "solution": {
6 "problem_category": "LP",
7 "primal_solution": [
8 1.8,
9 0.0
10 ],
11 "dual_solution": [
12 -0.06666666666666668,
13 0.0
14 ],
15 "primal_objective": -0.36000000000000004,
16 "dual_objective": 6.92188481708744e-310,
17 "solver_time": 0.008397102355957031,
18 "vars": {
19 "VAR1": 1.8,
20 "VAR2": 0.0
21 },
22 "lp_statistics": {
23 "primal_residual": 6.921146112128e-310,
24 "dual_residual": 6.9218848170975e-310,
25 "gap": 6.92114611220587e-310,
26 "nb_iterations": 1
27 },
28 "reduced_cost": [
29 0.0,
30 0.0031070813207920247
31 ],
32 "milp_statistics": {}
33 }
34 },
35 "total_solve_time": 0.014980316162109375
36 },
37 "reqId": "3f36bad7-6135-4ffd-915b-858c449c7cbb"
38}
Generate Datamodel using Problem File Parser#
Use a DataModel built with
Read() as input to get_LP_solve;
the client dispatches on the file extension (.mps / .qps vs .lp,
including .gz / .bz2 compressed variants). For solver settings see
convex optimization parameters and MIP parameters.
MPS Format#
1# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2# SPDX-License-Identifier: Apache-2.0
3"""
4LP DataModel from MPS file parser example
5
6This example demonstrates how to:
7- Read an MPS file using cuopt.linear_programming.Read
8- Create a DataModel from the parsed MPS
9- Solve using the DataModel via the server
10- Extract detailed solution information
11
12Requirements:
13 - cuOpt server running (default: localhost:5000)
14 - cuopt_sh_client package installed
15 - cuopt package installed
16
17Problem (in MPS format):
18 Minimize: -0.2*VAR1 + 0.1*VAR2
19 Subject to:
20 3*VAR1 + 4*VAR2 <= 5.4
21 2.7*VAR1 + 10.1*VAR2 <= 4.9
22 VAR1, VAR2 >= 0
23
24Expected Output:
25 Termination Reason: 1 (Optimal)
26 Objective Value: -0.36
27 Variables Values: {'VAR1': 1.8, 'VAR2': 0.0}
28"""
29
30from cuopt_sh_client import (
31 CuOptServiceSelfHostClient,
32 ThinClientSolverSettings,
33 PDLPSolverMode,
34)
35from cuopt.linear_programming import Read
36import time
37
38
39def main():
40 """Run the MPS DataModel example."""
41 # -- Parse the MPS file --
42
43 data = "sample.mps"
44
45 mps_data = """NAME good-1
46ROWS
47 N COST
48 L ROW1
49 L ROW2
50COLUMNS
51 VAR1 COST -0.2
52 VAR1 ROW1 3 ROW2 2.7
53 VAR2 COST 0.1
54 VAR2 ROW1 4 ROW2 10.1
55RHS
56 RHS1 ROW1 5.4 ROW2 4.9
57ENDATA
58"""
59
60 with open(data, "w") as file:
61 file.write(mps_data)
62
63 print(f"Created MPS file: {data}")
64
65 # Parse the MPS file and measure the time spent
66 print("\n=== Parsing MPS File ===")
67 parse_start = time.time()
68 data_model = Read(data)
69 parse_time = time.time() - parse_start
70 print(f"Parse time: {parse_time:.3f} seconds")
71
72 # -- Build the client object --
73
74 # If cuOpt is not running on localhost:5000, edit `ip` and `port` parameters
75 cuopt_service_client = CuOptServiceSelfHostClient(
76 ip="localhost", port=5000, timeout_exception=False
77 )
78
79 # -- Set the solver settings --
80
81 ss = ThinClientSolverSettings()
82
83 # Set the solver mode to Fast1 (Stable1 could also be used)
84 ss.set_parameter("pdlp_solver_mode", PDLPSolverMode.Fast1)
85
86 # Set the general tolerance to 1e-4 (default value)
87 ss.set_optimality_tolerance(1e-4)
88
89 # Optional: Set iteration and time limits
90 # ss.set_iteration_limit(1000)
91 # ss.set_time_limit(10)
92 ss.set_parameter("time_limit", 5)
93
94 # -- Call solve --
95
96 print("\n=== Solving with Server ===")
97 network_time = time.time()
98 solution = cuopt_service_client.get_LP_solve(data_model, ss)
99 network_time = time.time() - network_time
100
101 # -- Retrieve the solution object and print the details --
102
103 solution_status = solution["response"]["solver_response"]["status"]
104 solution_obj = solution["response"]["solver_response"]["solution"]
105
106 print("\n=== Results ===")
107 # Check Termination Reason
108 print(f"Termination Reason: {solution_status}")
109
110 # Check found objective value
111 print(f"Objective Value: {solution_obj.get_primal_objective()}")
112
113 print(f"MPS Parse time: {parse_time:.3f} sec")
114
115 # Check network time (client call - solve time)
116 network_time = network_time - (solution_obj.get_solve_time())
117 print(f"Network time: {network_time:.3f} sec")
118
119 # Check solver time
120 solve_time = solution_obj.get_solve_time()
121 print(f"Engine Solve time: {solve_time:.3f} sec")
122
123 # Check the total end to end time (mps parsing + network + solve time)
124 end_to_end_time = parse_time + network_time + solve_time
125 print(f"Total end to end time: {end_to_end_time:.3f} sec")
126
127 # Print the found decision variables
128 print(f"Variables Values: {solution_obj.get_vars()}")
129
130
131if __name__ == "__main__":
132 main()
LP Format#
1# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2# SPDX-License-Identifier: Apache-2.0
3"""
4LP DataModel from LP file parser example
5
6This example demonstrates how to:
7- Read an LP-format file using cuopt.linear_programming.Read
8- Create a DataModel from the parsed LP file
9- Solve using the DataModel via the server
10- Extract detailed solution information
11
12Requirements:
13 - cuOpt server running (default: localhost:5000)
14 - cuopt_sh_client package installed
15 - cuopt package installed
16
17Problem (in LP format; same instance as the MPS datamodel example):
18 Minimize: -0.2*VAR1 + 0.1*VAR2
19 Subject to:
20 3*VAR1 + 4*VAR2 <= 5.4
21 2.7*VAR1 + 10.1*VAR2 <= 4.9
22 VAR1, VAR2 >= 0
23
24Expected Output:
25 Termination Reason: 1 (Optimal)
26 Objective Value: -0.36
27 Variables Values: {'VAR1': 1.8, 'VAR2': 0.0}
28"""
29
30from cuopt_sh_client import (
31 CuOptServiceSelfHostClient,
32 ThinClientSolverSettings,
33 PDLPSolverMode,
34)
35from cuopt.linear_programming import Read
36import time
37
38
39def main():
40 """Run the LP file DataModel example."""
41 data = "sample.lp"
42
43 lp_data = r"""\ Same problem as mps_datamodel_example.py (good-1)
44Minimize
45 -0.2 VAR1 + 0.1 VAR2
46Subject To
47 ROW1: 3 VAR1 + 4 VAR2 <= 5.4
48 ROW2: 2.7 VAR1 + 10.1 VAR2 <= 4.9
49End
50"""
51
52 with open(data, "w") as file:
53 file.write(lp_data)
54
55 print(f"Created LP file: {data}")
56
57 print("\n=== Parsing LP File ===")
58 parse_start = time.time()
59 data_model = Read(data)
60 parse_time = time.time() - parse_start
61 print(f"Parse time: {parse_time:.3f} seconds")
62
63 cuopt_service_client = CuOptServiceSelfHostClient(
64 ip="localhost", port=5000, timeout_exception=False
65 )
66
67 ss = ThinClientSolverSettings()
68 ss.set_parameter("pdlp_solver_mode", PDLPSolverMode.Fast1)
69 ss.set_optimality_tolerance(1e-4)
70 ss.set_parameter("time_limit", 5)
71
72 print("\n=== Solving with Server ===")
73 network_time = time.time()
74 solution = cuopt_service_client.get_LP_solve(data_model, ss)
75 network_time = time.time() - network_time
76
77 solution_status = solution["response"]["solver_response"]["status"]
78 solution_obj = solution["response"]["solver_response"]["solution"]
79
80 print("\n=== Results ===")
81 print(f"Termination Reason: {solution_status}")
82 print(f"Objective Value: {solution_obj.get_primal_objective()}")
83 print(f"LP Parse time: {parse_time:.3f} sec")
84
85 network_time = network_time - (solution_obj.get_solve_time())
86 print(f"Network time: {network_time:.3f} sec")
87
88 solve_time = solution_obj.get_solve_time()
89 print(f"Engine Solve time: {solve_time:.3f} sec")
90
91 end_to_end_time = parse_time + network_time + solve_time
92 print(f"Total end to end time: {end_to_end_time:.3f} sec")
93 print(f"Variables Values: {solution_obj.get_vars()}")
94
95
96if __name__ == "__main__":
97 main()
Expected Output (Either Example, Same Problem Instance)#
1 Termination Reason: (1 is Optimal)
2 1
3 Objective Value:
4 -0.36000000000000004
5 MPS Parse time: 0.000 sec
6 Network time: 1.062 sec
7 Engine Solve time: 0.004 sec
8 Total end to end time: 1.066 sec
9 Variables Values:
10 {'VAR1': 1.8, 'VAR2': 0.0}
Example with DataModel is available in the Examples Notebooks Repository.
The data argument to get_LP_solve may be a dictionary of the format shown in LP Open-API spec. More details on the response can be found under the responses schema “get /cuopt/request” and “get /cuopt/solution” API spec.
Aborting a Running Job in Thin Client#
Please refer to the Aborting a Running Job in Thin Client in the MIP Example for more details.
LP CLI Examples#
Generic Example#
The following examples showcase how to use the cuopt_sh CLI to solve a simple LP problem.
echo '{
"csr_constraint_matrix": {
"offsets": [0, 2, 4],
"indices": [0, 1, 0, 1],
"values": [3.0, 4.0, 2.7, 10.1]
},
"constraint_bounds": {
"upper_bounds": [5.4, 4.9],
"lower_bounds": ["ninf", "ninf"]
},
"objective_data": {
"coefficients": [0.2, 0.1],
"scalability_factor": 1.0,
"offset": 0.0
},
"variable_bounds": {
"upper_bounds": ["inf", "inf"],
"lower_bounds": [0.0, 0.0]
},
"maximize": "False",
"solver_config": {
"tolerances": {
"optimality": 0.0001
}
}
}' > data.json
Invoke the CLI.
# Please update these values if the server is running on a different IP address or port
export ip="localhost"
export port=5000
cuopt_sh data.json -t LP -i $ip -p $port -sl
Response is as follows:
1{
2 "response": {
3 "solver_response": {
4 "status": "Optimal",
5 "solution": {
6 "problem_category": "LP",
7 "primal_solution": [1.8, 0.0],
8 "dual_solution": [-0.06666666666666668, 0.0],
9 "primal_objective": -0.36000000000000004,
10 "dual_objective": 6.92188481708744e-310,
11 "solver_time": 0.007324934005737305,
12 "vars": {},
13 "lp_statistics": {
14 "primal_residual": 6.921146112128e-310,
15 "dual_residual": 6.9218848170975e-310,
16 "gap": 6.92114611220587e-310,
17 "nb_iterations": 1
18 },
19 "reduced_cost": [0.0, 0.0031070813207920247],
20 "milp_statistics": {}
21 }
22 },
23 "total_solve_time": 0.014164209365844727
24 },
25 "reqId": "4665e513-341e-483b-85eb-bced04ba598c"
26}
Warm Start in CLI#
To use a previous solution as the initial/warm start solution for a new request ID, you are required to save the previous solution, which can be accomplished use option -k. Use the previous reqId in the next request as follows:
Note
Warm start is only applicable to LP and not for MIP.
# Please update these values if the server is running on a different IP address or port
export ip="localhost"
export port=5000
reqId=$(cuopt_sh -t LP data.json -i $ip -p $port -k | sed "s/'/\"/g" | sed 's/False/false/g' | jq -r '.reqId')
cuopt_sh data.json -t LP -i $ip -p $port -wid $reqId
In case the user needs to update solver settings through CLI, the option -ss can be used as follows:
# Please update these values if the server is running on a different IP address or port
export ip="localhost"
export port=5000
cuopt_sh data.json -t LP -i $ip -p $port -ss '{"tolerances": {"optimality": 0.0001}, "time_limit": 5}'
Aborting a Running Job In CLI#
Please refer to the Aborting a Running Job In CLI in the MIP Example for more details.
Note
Please use solver settings while using .mps files.