This section details how to bring your decision model onto the Nextmv Platform using any of our solver integrations or custom logic.
- Install a Nextmv client.
- Nextmvify your model.
- Push your model to Nextmv cloud.
- Make a remote run.
Note: An active subscription with Nextmv is required to complete these steps. Sign up for an account or contact support@nextmv.io
to request access.
Install Nextmv development tooling
Python developers can pip install nextmv
to gain access to the Nextmv Python SDK containing helpful constructs for common patterns in decision models. Additionally, the Python SDK can be used to push your custom model up to the Nextmv cloud.
For non-Python developers, you can install the Nextmv CLI.
Nextmvify your model
Now, you're ready to Nextmvify your model to run on Nextmv as an app.
Input
Read model inputs from a file or stdin as JSON, TEXT, or CSV.
If reading from a file or files (required for CSV), your input data must be nested in and read from a folder called input
in your model code.
For Python users, you may use the load_local
function from the Nextmv Python SDK. If you are loading multiple CSVs from the input folder, your code might look like this:
Note, you may choose to expose configuration of your model via CLI flags. For Python users, you may optionally use the Options
and Parameter
functions from the Nextmv Python SDK, and your code might look like this:
load_local
then receives these custom options.
If you are reading your input from stdin instead, you may also use load_local
without specifying any arguments.
Statistics
Add statistics to your model and write them to stdout to conduct experiments and view run results in the UI.
Statistics must conform to the Nextmv statistics convention.
For Python users, you may optionally use the Output
function from the Nextmv Python SDK and your code might look like this:
Logs
Write logs to stderr to surface logs in the logs tab for each run.
For Python users, you may optionally use the log
function from the Nextmv Python SDK and your code might look like this:
Output
Write your model solution to a file or stdout as JSON, TEXT, or CSV. If reading from a file or files (required for CSV), your output data must be written to a folder called output
in your model code. This ensures we can find your output and render it appropriately on the Nextmv Console.
For Python users, you may optionally use the write_local
function to write an Output
from the Nextmv Python SDK, and your code might look like this:
Where options.output
is optional (required only for models with CSV input regardless of output type).
Manifest
Add an app manifest at the root of your project which will tell the Nextmv platform what runtime and requirements are needed to execute your custom model. For Python users, your app manifest might look like this:
Make your model an app
Now that your model is Nextmvified, you can push your model to your Nextmv account as an app.
Run your app
Now, you can visit the Nextmv Console. Click into your apps icon on the left, and select your app. From your appโs main details view, click the Run app button. This will load an empty user interface for adding the input and configuration for your run.
Paste in your input if JSON or upload a file for non-JSON inputs. Modify configuration if you exposed any configuration in your model.
Next, click the Start run button to run your app. This will load a new screen where you can view the details of your app run. Your run status will start with either queued
or running
and will move to successful
once it has completed.
Once the status reaches succeeded
click on the Result tab to view the result of your run. You should either see your solution output or a button to download the output.
Next steps
๐๐๐ You completed this brief introduction to using custom apps on the Nextmv Decision Platform. Here are some next steps:
- See the solvers that are supported.
- Begin exploring scenario tests and other experiments