Skip to content

Notebooks

These notebooks walk through a lifecycle one cell at a time. Synchronous calls such as job.wait() work in a notebook cell. The job, endpoint and image notebooks use the awaited twins (create_async, wait_async, …), which keep the kernel responsive while they wait. The task notebook uses sync calls only. See Async and notebooks.

View example files ↗ · Related reference: Jobs, Endpoints, Tasks →

Job lifecycle

job_lifecycle.ipynb runs one GPU job: checks the account, describes the job, dry-runs it, creates it, checks its status without blocking, waits, reads the logs, reloads it by id, and cancels it.

Endpoint workflow

endpoint_quickstart.ipynb runs the vLLM endpoint from First endpoint: checks the account, creates the endpoint, waits until the model answers, sends a chat request, reloads it by id, stops and starts it, and deletes it.

Evaluate a model in a notebook

task_eval.ipynb runs an evaluation function defined in a cell as a task on an H100: a blocking call, submit and the run's folder in the bucket, a failure with the job's traceback, and what happens to the job after a kernel restart.

Build an image

image.ipynb builds a Dockerfile with ns.Image on a CPU job: the dry run, the build or the reuse of an image built before, and a GPU job on the new image. It is the step-by-step version of First image.

The job and endpoint notebooks were run end to end on an H100, and GitHub shows them with their outputs.

Run them

From a checkout of the repository:

uv sync
uv run --with jupyter jupyter lab examples/quickstarts/notebooks

The image notebook is in examples/images/, next to its Dockerfile.

You need a Nebius CLI profile and quota for one on-demand H100. The task notebook also needs Object Storage credentials to read results. The endpoint notebook bills from create until its last cell deletes the endpoint: interrupting a cell does not delete it. Task jobs stop by themselves.