Skip to content

Tasks

Run a Python script to completion on a matched GPU or CPU node — submit code, pick an image and hardware, stream the logs, and download the output files.

A task runs a Python script once, to completion, on a node matched to the hardware you pick. You submit the code, an image, and the hardware — Meshive schedules it, streams the logs live, uploads whatever the script writes to /outputs, and charges your prepaid credit only for the time the container actually ran.

Script (main.py + optional requirements.txt)
│ Submit — image + hardware + max run time
Runs on a matched node ──▶ logs stream live in the console
│ script exits (or hits max run time)
Files in /outputs uploaded ──▶ download from the console

Everything lives under Serverless › Tasks in your workspace console.

Serving keeps a model resident behind an always-on endpoint. Tasks run a script and stop.

ServingTasks
What runsA model behind an OpenAI-compatible endpointYour Python script, once
LifetimeUntil you pause or delete itUntil the script exits (or max run time)
You get backAPI responsesLive logs + files from /outputs
BillingGPU-hour × running replicasRuntime of the container, from prepaid credit

Typical task workloads: batch inference over a dataset, fine-tuning a model, data preprocessing — anything with a start and an end.

  1. Open Serverless › Tasks in your workspace console and click New task.

  2. Name the task.

  3. Add your script — write it in the code editor, or upload main.py plus an optional requirements.txt (see below).

  4. Pick an image — an official template, or your own image from a custom registry (see Container images).

  5. Pick hardware — a GPU model and count, or a CPU-only preset:

    PresetvCPURAM
    Micro28 GB
    Small416 GB
    Standard832 GB
    Balanced1664 GB
    Compute816 GB
    Compute L1632 GB
    Compute XL3264 GB
    Compute 2XL64128 GB
    Compute 3XL96192 GB
    Compute 4XL128256 GB
    High-mem864 GB
    High-mem XL16128 GB

    A preset with no node able to host it right now is shown as Unavailable.

  6. Environment variables & secrets (optional) — available to your script as regular env vars.

  7. Max run time — 1 to 24 hours. The task is stopped when it hits this ceiling (see Task billing & refunds).

  8. Webhook (optional) — get a signed POST when the task finishes (see Webhooks).

  9. Submit. The task card shows the live status, streaming logs, and Cost so far.

You can Stop a running task at any time — you’re charged for the time it actually ran, and no webhook event is sent for a manual stop.

If you attach a requirements.txt, pip install -r requirements.txt runs inside the container, before your script starts.

SourceRequirements
Official templateNone — guaranteed to work with tasks out of the box
Custom registry imageMust have python (with pip, if you use requirements.txt) on the PATH

A custom image without a working python fails at startup — that’s a user fault and is charged like any other user-code failure. Test the image locally first: docker run --rm <image> python --version.

Private registries use the registry credentials already connected to your workspace — the same ones used for custom pod templates.

Your script starts with /outputs as its working directory. Anything it writes there is uploaded automatically after the container exits and becomes downloadable from the task’s page in the console.

  • Relative writes (open("result.csv", "w")) already land in /outputs — no path handling needed.
  • _task.log is added automatically: a tail of the run’s log, archived alongside your files.
  • When the run ends, everything in /outputs becomes an asset in your workspace — kept until you delete it, and billed as storage if it lives in managed storage. Re-running the task adds a new version. Only _task.log follows the log retention policy.
  • The upload resumes after interruptions and retries automatically for up to ~3 days; its progress and state are shown on the task page. If you don’t need the files, Discard outputs on the task page stops the transfer and releases the storage.
Output limitValue
Max size per file5 GiB
Max number of files200
Output disk budget20 GiB

A task gets the same disk a pod does: it’s ephemeral (wiped when the task ends) and split into two parts, both counted against one on-node budget.

  • System storage — the container’s working space for package installs, model/HF caches, temp files, and logs. It’s sized automatically from your hardware, the same formula a GPU or CPU pod uses:
    • GPU: max(15 + 10 × GPU count, 5) GB
    • CPU: max(5 + 1 × vCPU, 5) GB
  • /outputs — a separate 20 GiB budget for the files you want back (see above).

The submit form shows both numbers for your selected hardware (e.g. a single 24 GB GPU → 25 GB system + 20 GB /outputs = 45 GB total).

Add a webhook to be notified when a task reaches a terminal state:

EventWhen
task.succeededScript exited with code 0
task.failedScript failed — non-zero exit, OOM, eviction, install failure, or a platform fault
task.timed_outMax run time reached
task.outputs_readyEvery output file has finished saving to Assets. Fires after the terminal event — outputs can still be uploading when task.succeeded arrives.

Terminal states only (plus task.outputs_ready once the outputs land). A manual Stop sends no event.

The payload envelope matches inference webhooks:

{
"id": "evt_3f9c1a2b4d5e6f70",
"type": "task.succeeded",
"created_at": 1780000000,
"data": {
"id": "task_abc123",
"name": "nightly-batch-embed",
"status": "succeeded",
"fault_class": "none",
"exit_code": 0,
"failure_reason": null,
"namespace_name": "my-workspace",
"gpu_model": "RTX 4090",
"created_at": 1779996400,
"finished_at": 1779999998,
"total_cost": "0.42000000"
}
}
  • fault_classnone (succeeded), user, or platform. This is what decides whether anything is refunded.
  • total_cost — the final, trued-up charge in credit.
  • Terminal payloads also carry output_upload_state — where the output transfer stands at that moment. Wait for task.outputs_ready before fetching files programmatically.

Deliveries carry the same X-Meshive-Signature HMAC header as every other Meshive webhook — verify it exactly as described in Webhooks → Verifying the signature. Retries, idempotency (dedupe on the event id), and security rules are also identical.

LimitValue
Max run time1 – 24 hours
Script + requirements.txt size~960 KiB combined
Environment variablesUp to 64, ~32 KiB total
GPUs per taskUp to 8
Concurrent tasksNo cap — every task is paid
Output files5 GiB / file · 200 files · 20 GiB total