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

# Bring Your Own GPU

> Connect any machine to Alph using the CLI

## Why

Use your own hardware — a cloud GPU instance, a local workstation, or a beefy VM — while keeping Alph's notebook editor, AI assistance, and collaboration features. No compute charges from Alph.

## Setup

<Steps>
  <Step title="Install the CLI">
    On your machine:

    ```bash theme={null}
    pip install alphai
    ```
  </Step>

  <Step title="Authenticate">
    ```bash theme={null}
    alphai login
    ```
  </Step>

  <Step title="Start JupyterLab">
    ```bash theme={null}
    alphai jupyter lab --org my-org --project my-project
    ```

    This starts JupyterLab locally and connects it to your Alph project via a secure tunnel.
  </Step>
</Steps>

Your notebooks in Alph now execute on your machine's hardware.

## Cloud GPU Examples

### Shadeform

```bash theme={null}
# On your Shadeform GPU instance
pip install alphai
alphai login --token YOUR_TOKEN
alphai jupyter lab --org my-org --project gpu-training
```

### Lambda Labs / Vast.ai / RunPod

Same process — SSH in, install the CLI, and connect. Any machine with Python and internet access works.

### AWS

```bash theme={null}
# On your EC2 GPU instance
pip install alphai
alphai login --token YOUR_TOKEN
alphai jupyter lab --org my-org --project gpu-training
```

### Local Workstation

```bash theme={null}
alphai jupyter lab --org my-org --project local-dev --port 8889
```

## Firewall & Port Configuration

The CLI uses a secure outbound tunnel — no inbound ports need to be open for the notebook connection. However, if you want to expose a web app through Alph, make sure:

* The `--app-port` port (default 5000) is not blocked by your firewall
* Your cloud provider's security group or firewall rules allow the app to bind to `0.0.0.0` on that port

On most cloud GPU providers, outbound traffic is open by default. If you're behind a restrictive firewall, ensure outbound HTTPS (port 443) is allowed for the tunnel.

## What You Get

* **Your hardware, Alph's interface:** Edit notebooks in Alph, execute on your GPU
* **AI assistance:** Cell generation and chat work regardless of where compute runs
* **Team access:** Collaborators see your notebooks and outputs in Alph
* **Web apps:** Add `--app-port 5000` to expose a web app through Alph's tunnel
* **Custom domains:** Attach domains through the web UI — no restart needed

## Tips

* Use `--token` for headless authentication on remote servers
* Use `--port` to change the JupyterLab server port, `--app-port` for the web app port
* Use `tmux` or `screen` to keep the connection alive after disconnecting SSH
* The tunnel auto-reconnects on network interruptions
