Explore New Model Cli

Explore Nextmv with a new model and the CLI

A tutorial to explore the Nextmv Platform using a new decision model and the CLI.

โŒ›๏ธ Approximate time to complete: 10 min.

In this tutorial you will learn how to use community apps to explore new decision models and the Nextmv Platform, from scratch. Complete this tutorial if you:

  • Don't have a pre-existing decision model and you want to explore the Nextmv Platform.
  • Are fluent using a language of your preference, such as Python, Java, Go, etc.

Community apps are Nextmv Applications that showcase how to solve different decision problems with various languages and solvers. They are a great way to explore new decision models and the Nextmv Platform. You can think of community apps as examples that serve as strong references when building and customizing your own decision models.

At a high level, this tutorial will go through the following steps:

  1. Clone a community app locally.
  2. Push the model to Nextmv Cloud.
  3. Run the model remotely.
  4. Perform scenario testing.

Letโ€™s dive right in ๐Ÿคฟ.

1. Create an account

The full suite of benefits starts with a Nextmv Cloud account.

  1. Visit the Nextmv Console to sign up for an account at https://cloud.nextmv.io.
  2. Verify your account.
    • Youโ€™ll receive an email asking to verify your account.
    • Follow the link in that email to sign in.
  3. Log in to your account. The Nextmv Console is ready to use!

Once you have logged in to your account, you need to fetch your API key. You can do so from your settings.

API keys

When you have your API key, it is convenient to save it as an environment variable so that you can use it for the rest of this tutorial.

export NEXTMV_API_KEY="<YOUR-API-KEY>"
Copy

2. Install the Nextmv CLI

Run the following script to install Nextmv CLI:

export NEXTMV_BASE_URL=https://api.cloud.nextmv.io
curl -sS "https://cloud.nextmv.io/install-cli.txt" | bash -
Copy

After downloading and installing, the last step is to configure Nextmv CLI with your account:

nextmv configure --api-key $NEXTMV_API_KEY
Copy

To check if the installation was successful, run the following command to show the help menu:

nextmv --help
Copy

3. Clone a community app

To work with community apps you have two options:

  1. Clone the GitHub repository locally.
  2. Use the Nextmv CLI to clone a specific community app.

This tutorial will use the second option.

You can list the available community apps with the following command:

$ nextmv community list

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Name                                    โ”‚ Type   โ”‚ Latest      โ”‚ Description                                                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ go-hello-world                          โ”‚ go     โ”‚ v20251006.0 โ”‚ Get started with Go and Nextmv.                              โ”‚
โ”‚ go-highs-knapsack                       โ”‚ go     โ”‚ v20251006.0 โ”‚ Use Go and HiGHS - knapsack.                                 โ”‚
โ”‚ go-highs-orderfulfillment               โ”‚ go     โ”‚ v20251126.0 โ”‚ Use Go and HiGHS - order fulfillment.                        โ”‚
โ”‚ go-highs-shiftscheduling                โ”‚ go     โ”‚ v20251006.0 โ”‚ Use Go and HiGHS - shift scheduling.                         โ”‚
โ”‚ go-nextroute                            โ”‚ go     โ”‚ v20251112.0 โ”‚ Use Go and Nextroute - VRP.                                  โ”‚
โ”‚ java-gurobi-knapsack                    โ”‚ java   โ”‚ v20251006.0 โ”‚ Use Java and Gurobi - knapsack.                              โ”‚
โ”‚ java-gurobi-multiknapsack-multiexcel    โ”‚ java   โ”‚ v20251006.0 โ”‚ Use Java and Gurobi - multi knapsack via Excel.              โ”‚
โ”‚ java-hello-world                        โ”‚ java   โ”‚ v20251006.0 โ”‚ Get started with Java and Nextmv.                            โ”‚
โ”‚ java-hexaly-knapsack                    โ”‚ java   โ”‚ v20251006.0 โ”‚ Use Java and Hexaly - knapsack.                              โ”‚
โ”‚ java-ortools-knapsack                   โ”‚ java   โ”‚ v20251006.0 โ”‚ Use Java and OR-Tools - knapsack.                            โ”‚
โ”‚ java-ortools-routing                    โ”‚ java   โ”‚ v20251006.0 โ”‚ Use Java and OR-Tools - VRP.                                 โ”‚
โ”‚ python-ampl-facilitylocation            โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and AMPL - facility location.                     โ”‚
โ”‚ python-ampl-knapsack                    โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and AMPL - knapsack.                              โ”‚
โ”‚ python-ampl-priceoptimization           โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and AMPL - price optimization.                    โ”‚
โ”‚ python-cuopt-routing                    โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and cuOpt - VRP.                                  โ”‚
โ”‚ python-gams-cutstock                    โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and GAMS - cutstock.                              โ”‚
โ”‚ python-gamspy-traveling-salesman        โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and Gamspy - traveling salesman.                  โ”‚
โ”‚ python-gurobi-knapsack                  โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and Gurobi - knapsack.                            โ”‚
โ”‚ python-gurobi-price-optimization        โ”‚ python โ”‚ v20251201.0 โ”‚ Use a Nextmvified Gurobi notebook for price optimization.    โ”‚
โ”‚ python-hello-world                      โ”‚ python โ”‚ v20251201.0 โ”‚ Get started with Python and Nextmv.                          โ”‚
โ”‚ python-hexaly-generic                   โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and Hexaly - hxm models.                          โ”‚
โ”‚ python-hexaly-knapsack                  โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and Hexaly - knapsack.                            โ”‚
โ”‚ python-highs-knapsack                   โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and HiGHS - knapsack.                             โ”‚
โ”‚ python-nextmv-gurobipy-knapsack         โ”‚ python โ”‚ v20251118.0 โ”‚ Use the Python Nextmv & gurobipy integration - knapsack.     โ”‚
โ”‚ python-nextmv-scikit-learn-diabetes     โ”‚ python โ”‚ v20250507.0 โ”‚ Use the Python Nextmv & scikit-learn integration - diabetes. โ”‚
โ”‚ python-nextroute                        โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and Nextroute - VRP.                              โ”‚
โ”‚ python-ortools-costflow                 โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and OR-Tools - cost flow.                         โ”‚
โ”‚ python-ortools-demandforecasting        โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and OR-Tools - demand forecasting.                โ”‚
โ”‚ python-ortools-knapsack                 โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and OR-Tools - knapsack.                          โ”‚
โ”‚ python-ortools-knapsack-multicsv        โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and OR-Tools - multi CSV knapsack.                โ”‚
โ”‚ python-ortools-multiknapsack-multiexcel โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and OR-Tools - multi knapsack via Excel.          โ”‚
โ”‚ python-ortools-region-allocation        โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and OR-Tools - region allocation.                 โ”‚
โ”‚ python-ortools-routing                  โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and OR-Tools - VRP.                               โ”‚
โ”‚ python-ortools-shiftassignment          โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and OR-Tools - shift assignment.                  โ”‚
โ”‚ python-ortools-shiftplanning            โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and OR-Tools - shift planning.                    โ”‚
โ”‚ python-pyomo-knapsack                   โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and Pyomo - knapsack.                             โ”‚
โ”‚ python-pyomo-shiftassignment            โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and Pyomo - shift assignment.                     โ”‚
โ”‚ python-pyomo-shiftplanning              โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and Pyomo - shift planning.                       โ”‚
โ”‚ python-pyoptinterface-knapsack          โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and PyOptInterface - knapsack.                    โ”‚
โ”‚ python-pyvroom-routing                  โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and Pyvroom - VRP.                                โ”‚
โ”‚ python-scip-knapsack                    โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and SCIP - knapsack.                              โ”‚
โ”‚ python-tr-ortools-region-allocation     โ”‚ python โ”‚ v20251201.0 โ”‚ Use tracked runs in Python - region allocation.              โ”‚
โ”‚ python-vroom-premium-api-routing        โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and Vroom Premium API - VRP.                      โ”‚
โ”‚ python-wf-custom-visuals                โ”‚ python โ”‚ v20251006.0 โ”‚ Use workflows in Python - custom visuals.                    โ”‚
โ”‚ python-wf-ortools-region-allocation     โ”‚ python โ”‚ v20251201.0 โ”‚ Use workflows in Python - region allocation.                 โ”‚
โ”‚ python-xpress-knapsack                  โ”‚ python โ”‚ v20251201.0 โ”‚ Use Python and Xpress - knapsack.                            โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Copy

This command is saved as app1.sh in the full tutorial code.

For this tutorial, we will be using the python-highs-knapsack community app, which solves a knapsack problem using the HiGHS solver and Python. To clone this community app, run the following command:

$ nextmv community clone -a python-highs-knapsack

โœ… Successfully cloned the "python-highs-knapsack" community app using version "latest" in path: ...
Copy

This command is saved as app2.sh in the full tutorial code.

Once the app has been cloned, you should see a structure similar to the following:

python-highs-knapsack
โ”œโ”€โ”€ app.yaml
โ”œโ”€โ”€ input.json
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ main.ipynb
โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ requirements.txt
Copy

4. Run the community app locally

You can run the executable code locally to verify that everything is working as expected. Each community app comes with a README.md file that contains detailed instructions on how to run the app locally. Letโ€™s follow those steps to run the app.

  1. Make sure you are standing at the root of the cloned community app, where the app.yaml manifest is located.

  2. Install the required dependencies:

    pip install -r requirements.txt
    
    Copy
  3. Run the app:

    $ python main.py -input input.json -output output.json -duration 30
    Solving knapsack problem:
     - items: 11
     - capacity: 50
    
    Copy
  4. Verify that an output.json file has been created with the results of the run.

    $ cat output.json
    
    {
      "options": {
        "input": "input.json",
        "output": "output.json",
        "duration": 30,
        "version": "1.9.0"
      },
      "solution": {
        "items": [
          {
            "id": "cat",
            "value": 100,
            "weight": 20
          },
          {
            "id": "water",
            "value": 40,
            "weight": 2
          },
          {
            "id": "phone",
            "value": 6,
            "weight": 1
          },
          {
            "id": "book",
            "value": 63,
            "weight": 10
          },
          {
            "id": "rx",
            "value": 81,
            "weight": 1
          },
          {
            "id": "coat",
            "value": 44,
            "weight": 9
          },
          {
            "id": "keys",
            "value": 92,
            "weight": 1
          },
          {
            "id": "nuts",
            "value": 18,
            "weight": 4
          }
        ]
      },
      "statistics": {
        "run": {
          "duration": 0.002505064010620117
        },
        "result": {
          "value": 444.0,
          "custom": {
            "status": "HighsStatus.kOk",
            "variables": 11,
            "constraints": 1
          }
        },
        "schema": "v1"
      },
      "assets": []
    }
    
    Copy

5. Subscribe to a Nextmv Plan

If you already have an active Nextmv Plan, you can skip this step.

If a Nextmv member provides different instructions for activating a Nextmv Plan, please follow those instructions instead.

Running a custom application remotely in Nextmv Cloud requires a paid plan. However, plans come with a 14-day free trial that can be canceled at any time. You can upgrade your account and subscribe to a plan in Nextmv Console by clicking the Upgrade button in the header, or navigating to the Settings-> Plan section. Upgrading to a plan will allow you to complete the rest of the tutorial.

Plans

In the example shown, you will be subscribing to an Innovator plan. A pop-up window will appear, and you will need to fill in your payment details.

Innovator

Once your account has been upgraded, you will see an active plan in your account.

Active plan

6. Create your Nextmv Cloud Application

Run the following command:

$ nextmv app create -n test-community-app -a test-community-app

{
  "id": "test-community-app",
  "name": "test-community-app",
  "description": "",
  "type": "custom",
  "default_instance": ""
}
Copy

This will create a new application in Nextmv Cloud. Note that the name and app ID can be different, but for simplicity this tutorial uses the same name and app ID. This command is saved as app3.sh in the full tutorial code. You can also create applications directly from Nextmv Console.

You can go to the Apps section in the Nextmv Console where you will see your applications.

Apps

7. Push your Nextmv Application

So far, your application has run locally. You are going to push your app to Nextmv Cloud. Once an application has been pushed, you can run it remotely, perform testing, experimentation, and much more. Pushing is the equivalent of deploying an application, this is, taking the executable code and sending it to Nextmv Cloud.

At the root of your local project (where the app.yaml manifest is located), deploy your app (push it) to Nextmv Cloud:

$ nextmv app push -a test-community-app

๐Ÿ’ฝ Starting build for Nextmv application.
๐Ÿ Bundling Python dependencies.
๐Ÿ“‹ Copied files listed in "app.yaml" manifest.
๐Ÿ“ฆ Packaged application (25.49 MiB, 2120 files).
๐ŸŒŸ Pushing to application: "test-community-app".
๐Ÿ’ฅ๏ธ Successfully pushed to application: "test-community-app".
{
  "app_id": "test-community-app",
  "endpoint": "api.cloud.nextmv.io",
  "instance_url": "https://api.cloud.nextmv.io/v1/applications/test-community-app/runs?instance_id=devint"
}
Copy

This command is saved as app4.sh in the full tutorial code.

You can go to the Apps section in the Nextmv Console where you will see your application. You can click on it to see more details. Once you are in the overview of the application in the Nextmv Console, it should show the following:

Pushed app

  • There is now a pushed executable.
  • There is an auto-created latest instance, assigned to the executable.

An instance is like the endpoint of the application.

8. Run the Nextmv Application remotely

To run the Nextmv Application remotely, you have several options. For this tutorial, we will be using the Nextmv Console and CLI.

In the Nextmv Console, in the app overview page:

  1. Press the New run button.
  2. Drop the data files that you want to use. You will get a preview of the data. You can drop the input.json file that comes with the community app.
  3. Optionally, configure your run according to the options that can be passed. In this case, you can configure the duration.
  4. Start the run.

New run Community App

You can use the Nextmv Console to browse the information of the run:

  • Summary
  • Output
  • Input
  • Metadata
  • Logs

Nextmv is built for collaboration, so you can invite team members to your account and share run URLs.

Run summary Run metadata

Alternatively, you can run your Nextmv Application using the Nextmv CLI. Here is an example command you can run from the root of the app.

$ nextmv app run -a test-community-app -i input.json

{
  "run_id": "devint-jjk3M1Zvg"
}
Copy

This command is saved as app5.sh in the full tutorial code.

9. Perform a scenario test

We are going to take full advantage of the Nextmv Platform by creating a scenario test. Scenario tests are generally used as an exploratory test to understand the impacts to business metrics (or KPIs) on situations such as:

  • Updating a model with a new feature, such as an additional constraint.
  • Comparing how the same model performs in different conditions, such as low demand vs. high demand.
  • Doing a sensitivity analysis to understand how the model behaves when changing a parameter.

Start by creating an input set. As the name suggests, it is a set of inputs, and it serves as a base so that we can perform runs varying one or more configurations (options). To create an input set, you have several options. For this tutorial, we will be using the Nextmv Console and CLI. You may follow these steps for both examples.

  1. Navigate to the "Input sets" section.
  2. Set a name for your input set.
  3. Use the "Instance + date range" creation type given that we already have a few runs on the latest instance.
  4. Create the input set.

Input set

Another option for creating the input set is using the Nextmv CLI. Here is an example command.

$ nextmv experiment input-set create -a test-community-app -i latest -s input-set-2 -n "Input set 2"

{
  "id": "input-set-2",
  "name": "Input set 2",
  "description": "",
  "app_id": "test-community-app",
  "created_at": "2025-12-02T15:24:35.980849238Z",
  "updated_at": "2025-12-02T15:24:35.980849238Z",
  "input_ids": [
    "latest-BnZOZ1ZDg",
    "latest-5qrIm1ZDg"
  ],
  "inputs": []
}
Copy

This command is saved as app6.sh in the full tutorial code.

Once your input set has been created, we are going to create a scenario test. Similarly to runs and input sets, you may use the Console or CLI, amongst other options. We will continue to use the Nextmv Console in this tutorial. You may follow these steps for both examples.

  1. Navigate to the Scenario section.
  2. Set a name for your scenario test.
  3. Select the input set you just created in the previous step.
  4. Select the latest instance.
  5. Create configuration combinations, which will be factored in to create the scenarios. We are setting duration to be 5, 10, 20 and 30 seconds.
  6. Optionally, you may configure repetitions. These are useful when the results are not deterministic.
  7. Create the scenario test. Review and confirm the number of scenarios that will be created.

Scenario test Community Apps

Once all the runs in the scenario test are completed, you can visualize the result of the test. A pivot table is provided to create useful comparisons of your metrics (statistics) across the scenario test runs.

Scenario test result

๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰ Congratulations, you have finished this tutorial!

Full tutorial code

You can find the consolidated code examples used in this tutorial in the tutorials GitHub repository. The explore-new-model-cli dir contains all the code that was shown in this tutorial.

Go into the directory for instructions about running the decision model.

Page last updated

Go to on-page nav menu