> ## Documentation Index
> Fetch the complete documentation index at: https://runcrate.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Launch Jupyter Lab with AI Agents

> Use MCP tools to deploy a GPU instance, install JupyterLab, start the server, and get a ready-to-use URL — all through conversation.

export const RuncrateStyles = () => {
  if (typeof document !== 'undefined' && !document.getElementById('runcrate-overrides')) {
    const s = document.createElement('style');
    s.id = 'runcrate-overrides';
    s.textContent = `
      /* Match Runcrate's rounding scale (--radius: 0.75rem) */
      .rounded-sm { border-radius: 0.5rem !important; }   /* 8px */
      .rounded-md { border-radius: 0.625rem !important; } /* 10px */
      .rounded-lg { border-radius: 0.75rem !important; }  /* 12px */
      .rounded-l-sm { border-top-left-radius: 0.5rem !important; border-bottom-left-radius: 0.5rem !important; }
      .rounded-r-sm { border-top-right-radius: 0.5rem !important; border-bottom-right-radius: 0.5rem !important; }
      .rounded-l-md { border-top-left-radius: 0.625rem !important; border-bottom-left-radius: 0.625rem !important; }
      .rounded-r-md { border-top-right-radius: 0.625rem !important; border-bottom-right-radius: 0.625rem !important; }
      .rounded-l-lg { border-top-left-radius: 0.75rem !important; border-bottom-left-radius: 0.75rem !important; }
      .rounded-r-lg { border-top-right-radius: 0.75rem !important; border-bottom-right-radius: 0.75rem !important; }

      /* Cards: never pure white in light mode */
      .card { background-color: #fcfcfc !important; border-radius: 0.75rem !important; }
      html.dark .card { background-color: #141414 !important; }

      /* Docs hero box */
      .rc-hero { background-color: #fcfcfc; border: 1px solid #e0e0e0; }
      html.dark .rc-hero { background-color: #141414; border-color: #242424; }
      html.dark .rc-hero h1 { color: #f5f5f5; }

      /* Runcrate scrollbar — thin, transparent track, hide-until-hover thumb */
      ::-webkit-scrollbar { width: 6px; height: 6px; background-color: transparent; }
      ::-webkit-scrollbar-track { background-color: transparent; }
      ::-webkit-scrollbar-thumb { background-color: rgba(155, 155, 155, 0.5); border-radius: 10px; transition: opacity 0.3s ease; opacity: 0; }
      ::-webkit-scrollbar-thumb:hover { background-color: rgba(155, 155, 155, 0.7); }
      *:hover::-webkit-scrollbar-thumb,
      *:focus::-webkit-scrollbar-thumb,
      *:active::-webkit-scrollbar-thumb { opacity: 1; }
      * { scrollbar-width: thin; scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
    `;
    document.head.appendChild(s);
  }
  return null;
};

<RuncrateStyles />

Get a GPU-backed Jupyter Lab environment running in under five minutes. Your AI agent deploys the instance, installs JupyterLab, and returns the access URL.

***

## "Spin up a Jupyter Lab environment on an RTX 4090."

The agent handles the full setup:

1. **`list_gpu_types`** — confirms RTX 4090 availability (\$0.35/hr)
2. **`create_instance`** — deploys `jupyter-dev` with RTX 4090
3. **`instance_status`** — polls until running
4. **`ssh_execute`** — installs JupyterLab and common ML packages:
   ```
   pip install jupyterlab torch torchvision numpy pandas matplotlib scikit-learn
   ```
5. **`ssh_execute`** — starts JupyterLab with no-auth for quick access:
   ```
   nohup jupyter lab --ip=0.0.0.0 --port=8888 --no-browser \
     --allow-root --NotebookApp.token='' \
     > /root/jupyter.log 2>&1 &
   ```
6. **`get_instance`** — retrieves the public IP

> JupyterLab is running at:
>
> ```
> http://203.0.113.87:8888
> ```
>
> **Specs:** RTX 4090 (24 GB VRAM) | **Cost:** \$0.35/hr
>
> Pre-installed packages: PyTorch, torchvision, NumPy, Pandas, Matplotlib, scikit-learn.
> Open the URL in your browser and start coding.

<Note>This setup uses no authentication token for convenience. For longer-running notebooks, set a token: `--NotebookApp.token='your-secret'`.</Note>

***

## "Install some extra packages on my Jupyter instance — I need HuggingFace and Weights & Biases."

The agent installs without interrupting the running server:

1. **`ssh_execute`** — `pip install transformers datasets accelerate wandb`
2. **`ssh_execute`** — `python -c "import transformers; print(transformers.__version__)"` to verify

> Installed on **jupyter-dev**:
>
> * transformers 4.44.0
> * datasets 3.0.1
> * accelerate 0.34.0
> * wandb 0.18.0
>
> All available in your running JupyterLab session. Restart the kernel if you had a notebook open.

***

## "I'm done with the Jupyter instance. Download my notebook and shut it down."

The agent saves your work and cleans up:

1. **`ssh_execute`** — `ls /root/*.ipynb /workspace/*.ipynb 2>/dev/null` to find notebooks
2. **`file_download`** — downloads `/workspace/experiment.ipynb`
3. **`billing_usage`** — checks how much the session cost
4. **`delete_instance`** — terminates `jupyter-dev`

> Downloaded **experiment.ipynb** (142 KB).
>
> Session summary:
>
> * Duration: 3.5 hours
> * Cost: **\$1.23**
> * GPU: RTX 4090
>
> Instance **jupyter-dev** terminated. Billing stopped.

***

## Tools used in this workflow

| Tool                                  | Purpose                                        |
| ------------------------------------- | ---------------------------------------------- |
| `list_gpu_types`                      | Check GPU options and pricing                  |
| `create_instance` / `instance_status` | Deploy and wait for readiness                  |
| `ssh_execute`                         | Install JupyterLab, packages, start the server |
| `get_instance`                        | Get the public IP for the Jupyter URL          |
| `file_download`                       | Save notebooks before teardown                 |
| `delete_instance`                     | Clean up when done                             |
