# CLI: Catalog & Serverless

> Check live GPU and CPU availability, browse templates and model sets, register Hugging Face models, deploy serverless servings, and submit or inspect batch tasks via the meshive CLI.

Source: https://docs.meshive.ai/sdk-cli/cli/serverless/

Catalog, model registration, serverless serving, and task commands in the `meshive` CLI. See [CLI Overview & Options](/sdk-cli/cli/) for global flags and write confirmation rules, and [CLI: Pods & Ports](/sdk-cli/cli/pod-access/#meshive-logs-task-logs) for `meshive task-logs`.

## `meshive gpus`

Lists the GPU tiers you can rent right now — one row per (model, VRAM) pair — with the per-GPU hourly price, how many GPUs are available in total, the most you can put in one pod, and how many machines offer that tier.

```bash
meshive gpus
meshive gpus --rental spot            # price for spot instead of on-demand
meshive gpus --vram 40                # only tiers with at least 40 GB VRAM
meshive gpus --model h100             # substring match on the model (client-side)
```

`--rental` and `--vram` are applied by the API; `--model` narrows the result locally. Availability is a live snapshot and changes as pods start and stop.

## `meshive cpus`

Lists the CPU lines you can rent for CPU pods right now — each a CPU vendor, product line and generation with a fixed RAM type — with the hourly price per vCPU and per GiB of RAM.

```bash
meshive cpus
meshive cpus --rental spot            # price for spot instead of on-demand
```

Columns: **LINE** (the value for `pod-create --cpu-line`), **CPU**, **RAM** (DDR generation), **RENTAL**, **PER vCPU/HR**, **PER GiB/HR**, **MAX vCPU** and **MAX RAM** (the most one pod can get on a single machine), **MACHINES**. Like `gpus`, it is a live snapshot.

## `meshive templates`

Lists official templates. Add `--workspace` to include that workspace's custom templates as well. Custom templates are created in the console — see [Templates](/documentation/templates/).

```bash
meshive templates
meshive templates --workspace <workspace>
meshive templates --type ide          # ide, framework, db, mlops, llmops, inference, generative, science, os, custom
meshive templates --name jupyter      # substring match (client-side)
```

Columns: **NAME**, **ID**, **TYPE**, **SOURCE** (`official` / `custom`), **HARDWARE**, **IMAGE**.

## `meshive template`

Shows a single template. A custom template can only be read together with the workspace that owns it.

```bash
meshive template <id>
meshive template <id> --workspace <workspace>     # custom template
```

Environment variables, endpoints, volume mounts and semantic paths are in the JSON payload (`-o json`).

## `meshive model-sets`

Lists the model sets a template can start with — ready-made bundles of model files, like the console's model set tiles (see [Bundled ComfyUI workflows](/assets/using/#bundled-comfyui-workflows)).

```bash
meshive model-sets <workspace> --template <id>
```

Columns: **SLUG** (the value for [`pod-create --model-set`](/sdk-cli/cli/pod-create-update/#meshive-pod-create)), **NAME**, **TASK**, **FILES**, **SIZE**, **MIN VRAM** (`~` marks an estimate) and **LICENSE** (with a count of files whose license isn't known). A template that adds its own set automatically, or has no model folders, takes no model set; the command says so and why. `-o json` lists each set's files and workflows, and `-o name` prints the slugs. From 1.3, a set gated on Hugging Face gets a line saying where to accept its license and to create the pod from its Quick Deploy template with `pod-create --hf-token`.

## `meshive servings`

Lists the serverless serving deployments in a workspace.

```bash
meshive servings <workspace>
meshive servings <workspace> --status active      # provisioning, active, scaling, draining, error
meshive servings <workspace> --name llama         # substring match on the model name
```

Columns: **NAME** (model), **ID**, **STATUS** (with a `(paused)` marker), **REPLICAS** (current, and the configured min-max), **HEALTHY**, **PRICE/HR** (shown while the deployment is billing).

## `meshive serving`

Shows a single serving deployment, including its endpoint URL. Replica details and live metrics are in the JSON payload.

```bash
meshive serving <id>
```

## `meshive tasks`

Lists the serverless tasks in a workspace, newest first.

```bash
meshive tasks <workspace>
meshive tasks <workspace> --status running,failed     # applied by the API
meshive tasks <workspace> --limit 20 --offset 20      # paging (limit 1-200, default 50)
meshive tasks <workspace> --name train                # substring match (client-side)
```

Valid task statuses:

```text
queued  scheduling  pulling  fetching  running
succeeded  failed  timed_out  stopped
```

Columns: **NAME**, **ID**, **STATUS**, **OUTPUTS**, **GPU**, **COST** (so far), **CREATED**. **OUTPUTS** says where saving a finished task's outputs stands, such as `uploading 48/126` or `partly saved 2,000/2,431`; it appears when the server reports it.

## `meshive task`

Shows a single task: image, GPU/CPU/RAM, price and cost, timestamps, exit code, and the failure reason if it failed. It also shows its input assets, the asset a failed download stopped on, an `outputs:` line that says where saving the outputs stands — with a note on how many files were saved when only some were — the last upload error, and when its archived log was deleted. The script, requirements, environment (secret values are masked) and the compute/disk cost breakdown are in the JSON payload (`-o json`), along with the task's `outputs` status, whose `phase` says where saving the outputs stands (see the [SDK reference](/sdk-cli/sdk/models/#task)).

```bash
meshive task <id>
```

## `meshive task-outputs`

Lists a task's output files, or saves them with `--download`.

```bash
meshive task-outputs <task_id>
meshive task-outputs <task_id> --download ./results
```

`-o json` includes each file's temporary download link.

## `meshive model-detect`, `model-register`, `models`, `model-delete`, `hf-tokens`

Register a Hugging Face model for serving without the console.

```bash
meshive model-detect <workspace> Qwen/Qwen3-0.6B            # can it be served? exits 1 if not
meshive model-register <workspace> Qwen/Qwen3-0.6B [--name <label>] [--framework vllm] [--context <tokens>] [--hf-token <id>]
meshive models <workspace>                                  # registrations; ID goes to serving-deploy
meshive model-delete <id> [-y]
meshive hf-tokens <workspace>                               # token IDs for gated or private repos (added in the console)
```

Registering is free — the model downloads when you deploy it — so `model-register` doesn't ask for confirmation. Registering the same repo again returns the existing registration. Text models are served with vLLM, the default, so `--framework` only takes `vllm`. `model-delete` fails while a serving of that model is deployed.

## `meshive serving-deploy`, `serving-scale`, `serving-pause`, `serving-resume`, `serving-delete`

```bash
meshive serving-deploy <workspace> <model-id> --price-cap <USD> [--min-replicas 1] [--max-replicas 3] [--no-autoscale] [--max-context <tokens>] [--share-idle] [-y]
meshive serving-scale <id> [--min-replicas n] [--max-replicas n] [--autoscale|--no-autoscale] [--price-cap <USD>] [-y]
meshive serving-pause <id>
meshive serving-resume <id> [-y]
meshive serving-delete <id> [-y]
```

`serving-deploy` deploys a registered model by its registration ID — the **ID** column of `meshive models`. `--price-cap` is the hourly cap **per replica**, so the worst case is `price-cap × max-replicas` per hour. Paused servings stop billing and stop answering requests; `serving-resume` asks for confirmation because billing resumes. `serving-scale` asks when the change can raise the hourly cost (a larger replica range, `--autoscale` on a serving that had it off, a higher `--price-cap`); shrinking the range, `--no-autoscale` or a lower cap applies immediately. Replicas beyond the new range are removed within ~30 seconds and the requests they're handling fail: with autoscale off a serving keeps `--min-replicas`, with it on up to `--max-replicas`. A lower cap doesn't move running replicas — it applies to replicas started afterwards.

## `meshive task-submit`, `task-stop`

```bash
meshive task-submit <workspace> <name> (--script <file> | --script-text <code>) (--image <image> | --template <id>) (--gpu <model> | --cpu-preset <preset>) [options]
meshive task-stop <id>
```

Runs a Python script to completion on a GPU or CPU and stops billing when it ends.

| Option | Meaning |
| --- | --- |
| `--script <file>` / `--script-text <code>` | The script (max 256 KiB). Use `print(..., flush=True)` so output reaches the logs. |
| `--image <image>` / `--template <id>` | Container image, or a template to take it from. |
| `--gpu <model>`, `--gpu-count <n>`, `--vram <GB>` | GPU task. |
| `--cpu-preset <preset>` | CPU task, e.g. `micro-2c8g`, `small-4c16g`, `standard-8c32g`. |
| `--requirements <file>` | A `requirements.txt` installed before the script runs. |
| `--env KEY=VALUE`, `--secret KEY`, `--arg <value>` | Environment and script arguments (repeatable). Use `--arg=--flag` for values that start with a dash. |
| `--max-duration <s>` | Hard stop, 3600–86400 seconds (default 3600). |
| `--input-asset <id>` | Attach an [asset](/assets) under `/inputs` (repeatable). The files fetched are whatever the asset holds at that time. An old `<id>:<version>` still works: the CLI warns and drops the version (assets no longer have versions). |
| `--output-include <glob>` | Upload only the files in `/outputs` that match, e.g. `--output-include '*.safetensors'` (repeatable). Without it, every file is uploaded. See [Choosing which files to save](/serverless/tasks/outputs/#choosing-which-files-to-save). Needs `meshive` **1.5** or later. |
| `--webhook <url>`, `--max-price <USD>`, `--estimate`, `-y` | As above. |

The estimate quotes compute per hour when available, not a total-cost ceiling. `max_duration` bounds script runtime; input fetching can add compute charges, and volume/Asset Hub retention is separate. `max_cost` is therefore unknown even for GPU tasks. CPU presets have an unknown hourly estimate when their machine rate cannot be quoted.
