# How it works

## Renting Compute on w\.ai

Renting compute on w\.ai provides a dedicated Jupyter Notebook or SSH environment backed by real GPU hardware from our distributed compute network. You gain full access to a sandboxed container, choosing between CUDA for NVIDIA GPUs, ROCm for AMD GPUs, or MLX for Apple Silicon, billed by the minute using w\.ai points.

***

### Step-by-Step Guide

#### Browse Available GPUs

Visit the **Compute** page at <https://app.w.ai/compute> to see live GPU inventory. Each card displays:

* **GPU Model** — e.g., NVIDIA RTX 5090, Apple M4 Pro
* **VRAM** — Total GPU memory available
* **Backend** — CUDA, ROCm, Metal, or Vulkan
* **Price** — Cost in w\.ai points per hour
* **Availability** — Number of workers offering this hardware

Use the search bar and category filters (NVIDIA, Apple, AMD, Intel) to find the right GPU for your workload.

#### Select Duration & Rent

Choose your rental duration from available options:

| Duration     | Use Case                            |
| ------------ | ----------------------------------- |
| 5–30 minutes | Quick experiments, testing code     |
| 1 hour       | Standard development sessions       |
| 2 hours      | Training runs, larger experiments   |
| 4–12 hours   | Extended compute jobs               |
| 24 hours     | Long-running training or processing |

The UI shows your **total cost** before confirmation. Ensure you have sufficient w\.ai points to cover the duration. Click **Rent** to confirm.

#### Wait for Provisioning

Upon confirmation, your rental enters a **Pending** state as:

1. The network matches a worker with your requested hardware.
2. The worker provisions an isolated container environment.
3. The Jupyter Notebook and SSH server starts and becomes accessible, typically taking under \~1 minute.

#### Access Your Jupyter Notebook or SSH terminal

Once active, your rental card shows:

* **Session URL** — Your unique Jupyter Notebook endpoint
* **Access Token** — Authentication token
* **Time Remaining** — Live countdown

For SSH, you will see your SSH credentials (username, host, etc.)

Click **Details** on My Rentals for full access credentials, then **Open Jupyter Notebook** or Open Web Terminal to launch your environment in a new tab.

***

### Your Environment

Each rental provides a fully configured Jupyter Notebook or SSH environment with Python 3.11, pip, and a comprehensive set of pre-installed packages.

> **Note:** The environment is ephemeral. All files are deleted when the session ends. Download any results before your rental expires.

#### Pre-Installed Python Packages

**Linux / Windows (CUDA & ROCm)**

| Category               | Packages                                                                     |
| ---------------------- | ---------------------------------------------------------------------------- |
| **Notebooks**          | JupyterLab, ipywidgets, tqdm                                                 |
| **Data Science**       | NumPy, Pandas, SciPy, scikit-learn                                           |
| **Visualization**      | Matplotlib, Seaborn, Pillow                                                  |
| **ML / Deep Learning** | PyTorch (CUDA/ROCm/CPU), TorchVision, TorchAudio, MLX-CUDA, Unsloth          |
| **Hugging Face**       | Transformers, Datasets, Hugging Face Hub, Accelerate, Diffusers, Safetensors |

**macOS (Apple Silicon)**

| Category               | Packages                                          |
| ---------------------- | ------------------------------------------------- |
| **Notebooks**          | JupyterLab, ipywidgets                            |
| **Data Science**       | NumPy, Pandas, SciPy, scikit-learn                |
| **Visualization**      | Matplotlib                                        |
| **ML / Deep Learning** | PyTorch (MPS), TorchVision                        |
| **Hugging Face**       | Transformers, Diffusers, Accelerate, Safetensors  |
| **Apple MLX**          | MLX, mlx-lm, mlx-vlm, mlx-audio, mlx-video, MFlux |

#### Base Container Images

Each environment is built on a minimal, production-grade base image depending on the backend:

| Backend           | Base Image                                                                                                                                                                                |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **CUDA (NVIDIA)** | [nvidia/cuda:12.1.1-devel-ubuntu22.04](https://hub.docker.com/layers/nvidia/cuda/12.1.1-devel-ubuntu22.04/images/sha256-327c9e046fbf662275be0934742f7e5412f9b24402ee90bf4d649c1a21707912) |
| **ROCm (AMD)**    | [rocm/dev-ubuntu-22.04:7.1.1](https://hub.docker.com/layers/rocm/dev-ubuntu-22.04/7.1.1/images/sha256-2d390c574e5e7e49e40e3bb376a88608c750d3f6c64b29d6adbc5834bee6c9be)                   |
| **Vulkan**        | [ubuntu:22.04](https://hub.docker.com/layers/library/ubuntu/22.04/images/sha256-965fbcae990b0467ed5657caceaec165018ef44a4d2d46c7cdea80a9dff0d1ea?context=explore)                         |

All images also include: `curl`, `git`, `ca-certificates`, `glib`, **Python 3.11.14**, and **uv** (fast Python package installer).

> **Need an additional system package?** [Contact us](https://w.ai/support) to request additions to the base image.

***

### Managing Your Rentals

Visit **My Rentals** in the sidebar to manage all sessions.

#### Extending a Session

Need more time? Click **Extend** to add minutes or hours. Extensions charge the same per-minute rate and require a sufficient point balance.

#### Stopping Early

Click **Stop Rental** to end a session early. Billing is **pro-rated by the minute** — you are charged only for the minutes used and remaining reserved points are refunded.

***

### Pricing

Rental pricing depends on:

* **GPU Performance** — Higher-tier GPUs cost more points per hour
* **VRAM** — More memory increases the base price
* **Network Earnings** — Prices reflect actual GPU earning rates on the network

A minimum charge of **1 point per minute** applies to all sessions. Pro-rated billing refunds unused reserved points if a session ends early. Prices are displayed on each GPU card in the Compute marketplace.

***

### Networking Restrictions

For security, outbound network access from rental environments is restricted to an allowlist of trusted domains required for ML development:

| Category                       | Domain                         |
| ------------------------------ | ------------------------------ |
| **Package Registries**         | `pypi.org`                     |
|                                | `files.pythonhosted.org`       |
| **ML / Dataset Platforms**     | `huggingface.co`               |
|                                | `hf.co`                        |
|                                | `kaggle.com`                   |
|                                | `openml.org`                   |
|                                | `archive.ics.uci.edu`          |
| **ML Frameworks**              | `download.pytorch.org`         |
|                                | `tensorflow.org`               |
| **Research Data Repositories** | `zenodo.org`                   |
|                                | `figshare.com`                 |
|                                | `osf.io`                       |
|                                | `dataverse.harvard.edu`        |
|                                | `datadryad.org`                |
|                                | `archive.org`                  |
| **Source Code Hosting**        | `github.com`                   |
|                                | `githubusercontent.com`        |
|                                | `gitlab.com`                   |
|                                | `bitbucket.org`                |
|                                | `sourceforge.net`              |
| **Cloud / CDN Storage**        | `dl.fbaipublicfiles.com`       |
|                                | `storage.googleapis.com`       |
|                                | `storage.cloud.google.com`     |
|                                | `s3.amazonaws.com`             |
|                                | `blob.core.windows.net`        |
|                                | `cloudfront.net`               |
|                                | `r2.cloudflarestorage.com`     |
|                                | `download.microsoft.com`       |
| **File Sharing Services**      | `drive.google.com`             |
|                                | `drive.usercontent.google.com` |
|                                | `dropbox.com`                  |
|                                | `dl.dropboxusercontent.com`    |
| **Government / Research Labs** | `nersc.gov`                    |
|                                | `nasa.gov`                     |
|                                | `cern.ch`                      |
|                                | `noaa.gov`                     |
|                                | `nist.gov`                     |
| **Web-Scale Datasets**         | `commoncrawl.org`              |
|                                | `dumps.wikimedia.org`          |
| **Computer Vision Datasets**   | `image-net.org`                |
|                                | `cocodataset.org`              |
|                                | `cs.toronto.edu`               |
| **Biomedical Data**            | `ncbi.nlm.nih.gov`             |
|                                | `ebi.ac.uk`                    |
|                                | `physionet.org`                |
| **Speech / Audio Data**        | `openslr.org`                  |

**All other outbound network traffic is strictly blocked.** This includes general web browsing, SSH connections, and access to arbitrary external services.

> **Need access to an additional domain?** Contact us on Discord to request additions to the network allowlist.

***

### Security

w\.ai compute sessions are designed with defense-in-depth isolation to protect both renters and workers.

#### Linux / Windows

* All Linux capabilities dropped — containers run with the minimal possible privilege set
* **Non-root user** — system package installation is disabled inside the container
* **Network isolation** — outbound traffic restricted to the allowlist above; all other traffic denied
* **Resource limits** — CPU, memory, and ulimits are enforced to prevent resource abuse
* Container filesystem is ephemeral and fully destroyed on session termination

#### macOS (Apple Silicon)

* **Network isolation** — very limited networking restricted to the allowlist above
* **Locked-down sandbox** — all system access is blocked outside the sandbox directory
* **Restricted shell** — only a very limited set of shell commands are enabled; all others are blocked
* **Minimal kernel access** — only essential kernel services are available to the sandbox environment

***

### Worker Requirements

To contribute your machine as a compute rental worker, you must meet these minimum requirements:

#### All Platforms

* **20 GB available storage** — required for container images, models, and session data

#### Linux

* System packages: `uidmap`, `iptables`
* NVIDIA GPUs additionally require: `nvidia-container-toolkit`

#### Windows

* NVIDIA GPU required
* WSL (Windows Subsystem for Linux) must be installed
  * The w\.ai worker will attempt to install WSL automatically if missing — a system reboot is required to complete setup

#### macOS

* Apple Silicon (M1 or later) required
* No additional system packages needed

#### Running the Worker

Start the worker in the foreground:

```bash
wai run w.ai
```

Or run in the background (detached mode):

```bash
wai run w.ai -d
```

Manage background workers with:

```bash
wai list              # List running instances
wai logs -f           # Follow live logs
wai stop <name>       # Stop a worker (or "wai stop all")
wai restart <name>    # Restart a worker
```

Workers earn **w\.ai points** for every minute a rental session is active on their hardware.


---

# Agent Instructions: 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:

```
GET https://docs.w.ai/compute-rentals/how-it-works.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
