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

# Quickstart

> From zero to a remote function in five minutes

## 1. Install the CLI and SDK

The `levers9` package is both: the `levers9` command and the Python module your scripts import.

**pip / uv**

```bash theme={null}
uv tool install levers9        # the CLI, isolated; in a project: uv add levers9   (pip install levers9 works too)
levers9 --version
```

**Homebrew (macOS)**

```bash theme={null}
brew tap gnomefin/levers9
brew install levers9
```

The formula lives at [github.com/gnomefin/homebrew-levers9](https://github.com/gnomefin/homebrew-levers9).

Python 3.10 to 3.12.

## 2. Sign in

```bash theme={null}
levers9 login
```

That opens the browser on the lab's sign-in page. Sign in with your Google account; the browser hands the
workspace token back to the command, which saves it in `~/.levers9/config`. You never copy a token by hand.
Your team (everyone with the same email domain) shares one workspace: the same apps, volumes and GPUs.

A workspace has **environments**. `levers9 login` gives you `main`; for a staging environment created in the
dashboard, sign in with `levers9 login --env staging --name staging` and switch contexts with `-c staging`.
Read [Workspaces and environments](https://levers9.mintlify.site/dashboard/workspaces.md).

Check it works:

```bash theme={null}
levers9 volume list
levers9 machine list          # what GPUs the cluster has right now
```

> [!NOTE]
>
> Self-hosting without sign-in? An admin gives you a token and you run `levers9 config create` with the controlplane
> host, port and token instead. Keep more than one context and switch with `levers9 config select` or `-c NAME`.

## 3. Run something

```python app.py theme={null}
from levers9 import job

@job(cpu=1, memory="512Mi")
def square(x: int) -> int:
    return x * x

if __name__ == "__main__":
    print(square.remote(12))                 # one container
    print(list(square.map(range(5))))        # one container per item
```

```bash theme={null}
python app.py                                # run it from the folder that contains app.py
levers9 deploy app.py:square --name square   # a versioned URL: POST /job/square/v1
```

> [!WARNING]
>
> Always run an app from its own folder. The SDK syncs the current directory into the container.

## 4. Use a GPU

Ask for one in the decorator. The first run builds the blueprint (a few minutes for torch); later runs reuse it.

```python theme={null}
from levers9 import Blueprint, job

@job(gpu="L40S", cpu=2, memory="8Gi", image=Blueprint(python_version="python3.11", python_packages=["torch"]))
def train(config: dict) -> dict:
    import torch
    ...
```

`gpu` also accepts a preference list, `gpu=["L40S", "A10G", "T4"]`; the scheduler takes the first type with capacity.

## 5. Watch it

Open the dashboard at [levers9-app.uselevers.com](https://levers9-app.uselevers.com): **Apps** lists your functions
and their calls in execution order, **Containers** shows what is running now, **Storage** browses your volumes,
and every line a container prints also streams back to your terminal while it runs. The Apps page shows a
Quickstart guide and featured examples until you have deployed something.

## Where next

> **[Every feature](https://levers9.mintlify.site/features.md)**
>
> The full map of the platform.

> **[Parameters](https://levers9.mintlify.site/sdk/parameters.md)**
>
> The knobs every decorator takes.

> **[Demos](https://levers9.mintlify.site/demos/cpu_job.md)**
>
> Each shape of work, with the exact commands.

> **[Notebooks](https://levers9.mintlify.site/guides/notebooks.md)**
>
> JupyterLab on a GPU, in one click.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.