Skip to content

The echo app

Several examples assume you have a Nextmv application called echo. This is just a simple application created for demonstration purposes. It takes the input and echoes it with some minor modifications.

Let's get set up with the echo application. Before starting:

  1. Sign up for a Nextmv account.
  2. Get your API key. Go to Settings > API Key.

Make sure that you have your API key set as an environment variable:

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

Now that you have a valid Nextmv account and API key, let's create the echo Nextmv app (start in an empty directory).

First let's create a uv project.

uv init --bare
Initialized project `echo`

Create a file called main.py with the code for the basic app that echoes the input.

main.py
import sys
import time

import nextmv

before = time.time()
input = nextmv.load()
solution = {
    "echo": {
        "data": input.data,
        "args": sys.argv[1:],
    },
}
metrics = {
    "run_duration": time.time() - before,
}
nextmv.write(solution=solution, metrics=metrics)

Note that the application uses the nextmv Python SDK. This library is a dependency of Nextpipe and should be installed automatically when you install Nextpipe. For this simple example, let's add the nextmv dependency so that we can run the app locally.

uv add nextmv

Now, add an app.yaml manifest that configures this as a json application.

app.yaml
type: python
runtime: ghcr.io/nextmv-io/runtime/python:3.11
python:
  pip-requirements: pyproject.toml
files:
  - main.py
configuration:
  content:
    format: json

At this point, your project directory should look like this:

.
├── app.yaml
├── main.py
├── pyproject.toml
└── uv.lock

We can now run the simple application locally to test it. This app will read the input from stdin, and then write a modified version of the input to stdout.

echo '{"hello": "world!"}' | uv run main.py
{
  "options": {},
  "solution": {
    "echo": {
      "data": {
        "hello": "world!"
      },
      "args": []
    }
  },
  "assets": [],
  "metrics": {
    "run_duration": 0.0006737709045410156
  }
}

The last step is to push the application to Nextmv Cloud. We can do this with the CLI. Before pushing, create an application with the ID echo.

nextmv cloud app create --app-id echo
 Creating application...
{
  "id": "echo",
  "name": "echo",
  "description": "",
  "type": "custom",
  "default_instance": "",
  "default_experiment_instance": "",
  "subscription_id": "",
  "locked": false,
  "created_at": "2026-07-29T17:21:30.030047Z",
  "updated_at": "2026-07-29T17:21:30.030047Z"
}

Lastly, push the application to your Nextmv account.

nextmv cloud app push --app-id echo
💿 Starting build for Nextmv application echo.
🐍 Bundling Python dependencies.
     34/34 compressed dependencies found in cache.
📋 Copying files listed in app.yaml manifest.
💾 Compressing application into tarball.
    🛠  Appending application files.
📦 Packaged application (2 app files, 51.27 MiB with dependencies).
🌟 Pushing to application: echo.
💥 Successfully pushed to application: echo.
{
  "app_id": "echo",
  "endpoint": "https://api.cloud.nextmv.io",
  "instance_url": "v1/applications/echo/runs?instance_id=latest"
}

🎉🎉🎉 Congratulations, you are ready to run the examples!