> For the complete documentation index, see [llms.txt](https://docs.robbie.run/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.robbie.run/getting-started/notebook-runner.md).

# Notebook Runner

{% @storylane/embed subdomain="robbie" linkValue="eclrnyt2m14v" url="<https://robbie.storylane.io/share/eclrnyt2m14v>" %}

This example shows how to run an entire Jupyter Notebook on Robbie as a long-running training job, instead of an individual function.

The Notebook Runner is great for when you are done experimenting in an interactive notebook and want to execute a long-running training job that could take hours or days.

To run your first notebook job on Robbie, open a command prompt and type:

```
jupyter lab
```

Create two new cells in the notebook.

In the first cell paste:

```
import robbie
robbie.init()
```

In the second cell paste:

```
import os
os.system('nvidia-smi')
```

* The first cell imports the Robbie Python package and then initializes it. If you have not previously logged in to Robbie, you will be prompted for your username and password.
* The second cell contains the Python code that will be run in the Robbie cloud.

Save the notebook (!\[A blue and white logo

Description automatically generated]\(/files/xgX0nqdEzOUdFebgGKw9) on a Mac or ![](/files/CKtfpCqYB0Guup9Reer7) on Windows)

Run the first cell by pressing the ![](/files/UE1omjMMiD0U97lvxlAS) button.

You should see a small UI directly in the notebook.

![](/files/SfhHDLfUPHLWTdmVU8dR)

Select your desired Hardware, from the dropdown and tick the `Tail the remote machine stdout` check box.

Next, press the !\[A green and black sign with a black arrow

Description automatically generated]\(/files/71impgG09S0VeKy3lz15) button.

You should then see the command program executing.

![A screenshot of a computer program](/files/j0ohRykn1taoXr85v2eF)

So, what did Robbie do?

1. Converted your notebook to a Python `.py` file and removed any notebook-specific constructs like `!` `%`, or `%%`.
2. Automatically determined the Python dependencies from the `.py` file and generated a `requirement.txt` file.
3. Selected a default GPU compute instance (`NERC Small)` in the Robbie cloud
4. Set billing for the job to your \`Personal\` funds (including free trial)
5. Create a new ‘run’ called `intermediate_macaw`
6. Copied the local workspace file, including the `.py` to the remote machine
7. Vended a deep link so you can track the progress of the run in the Robbie portal
8. Launched the run in the Robbie cloud
9. Printed out the duration and cost of the job once it was complete

For more examples, see [Jupyter Notebook Examples](https://github.com/Positron-Networks/robbie-examples/tree/main/notebook_runner).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.robbie.run/getting-started/notebook-runner.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
