# Install

> Pie ships as a single 60 MB binary with no Python or PyTorch dependencies.

Source: https://pie-project.org/docs/install  

The install script detects your OS and GPU, downloads [Pie 0.6.0](https://github.com/pie-project/pie/releases/tag/0.6.0), and installs the WebAssembly runtimes for Python and JavaScript inferlets.

Linux and macOS:

```bash
curl -fsSL https://pie-project.org/install.sh | bash
```

Windows (PowerShell):

```powershell
irm https://pie-project.org/install.ps1 | iex
```

On Linux, macOS, and WSL, the script places `pie` in `~/.local/bin` and the language runtimes in `~/.pie`. On Windows, run the command in PowerShell; it places `pie.exe` in `%LOCALAPPDATA%\Pie\bin`.

## Serve a model in three commands

**Step 1.**

Create a default configuration file at `~/.pie/config.toml`.

```bash
pie config init
```

**Step 2.**

Download a checkpoint from Hugging Face and convert it for your GPU.

```bash
pie model import Qwen/Qwen3.5-0.8B
```

**Step 3.**

Start the server in the foreground on `127.0.0.1:8080`.

```bash
pie serve
```

`pie serve` exposes the OpenAI, Anthropic, and Gemini APIs on port 8080 with no API key required. Existing SDKs connect without code changes:

```python
from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
reply = client.chat.completions.create(
    model="default",
    messages=[{"role": "user", "content": "Hi"}],
)
print(reply.choices[0].message.content)
```

## Platform builds

Each release provides one binary per OS and GPU backend. The installer picks CUDA on machines with an NVIDIA driver and Metal on Apple silicon Macs. Intel Macs are not supported.

| Platform | Build | Runs on |
|---|---|---|
| Linux x86_64 | [`cuda13.0`](https://github.com/pie-project/pie/releases/download/0.6.0/pie-x86_64-linux-cuda13.0.tar.gz) (default) | NVIDIA GPU, driver 580 or newer |
| Linux x86_64 | [`vulkan`](https://github.com/pie-project/pie/releases/download/0.6.0/pie-x86_64-linux-vulkan.tar.gz) | Any Vulkan 1.2 device |
| Linux x86_64 | [`wgpu`](https://github.com/pie-project/pie/releases/download/0.6.0/pie-x86_64-linux-wgpu.tar.gz) | Vulkan through WebGPU |
| Linux aarch64 | [`cuda13.0`](https://github.com/pie-project/pie/releases/download/0.6.0/pie-aarch64-linux-cuda13.0.tar.gz) (default) | NVIDIA GPU, driver 580 or newer |
| Linux aarch64 | [`vulkan`](https://github.com/pie-project/pie/releases/download/0.6.0/pie-aarch64-linux-vulkan.tar.gz) | Any Vulkan 1.2 device |
| macOS, Apple silicon | [`metal`](https://github.com/pie-project/pie/releases/download/0.6.0/pie-aarch64-macos-metal.tar.gz) (default) | Apple GPU through Metal |
| macOS, Apple silicon | [`wgpu`](https://github.com/pie-project/pie/releases/download/0.6.0/pie-aarch64-macos-wgpu.tar.gz) | Metal through WebGPU |
| Windows x86_64 | [`cuda`](https://github.com/pie-project/pie/releases/download/0.6.0/pie-x86_64-windows-cuda.zip) (default) | NVIDIA GPU |
| Windows x86_64 | [`vulkan`](https://github.com/pie-project/pie/releases/download/0.6.0/pie-x86_64-windows-vulkan.zip) | Any Vulkan 1.2 device |

On Linux or Windows machines without an NVIDIA GPU, set `PIE_FLAVOR` to select another backend such as Vulkan:

Linux:

```bash
curl -fsSL https://pie-project.org/install.sh | PIE_FLAVOR=vulkan bash
```

Windows:

```powershell
$env:PIE_FLAVOR = "vulkan"; irm https://pie-project.org/install.ps1 | iex
```

## Installer variables

Set these environment variables before running the install script to override defaults:

| Variable          | Effect                                                                                                   |
| ----------------- | -------------------------------------------------------------------------------------------------------- |
| `PIE_FLAVOR`      | Backend build to install from the table above. Required on Linux without an NVIDIA GPU.                  |
| `PIE_VERSION`     | Release version to install. Defaults to 0.6.0.                                                  |
| `PIE_INSTALL_DIR` | Target directory for the `pie` binary. Defaults to `~/.local/bin` (`%LOCALAPPDATA%\Pie\bin` on Windows). |
| `PIE_HOME`        | Directory for config, models, and language runtimes. Defaults to `~/.pie`.                               |

## Manual installation

Download the archive for your platform from the [release page](https://github.com/pie-project/pie/releases/tag/0.6.0), install the binary, and register the language runtimes:

```bash
tar -xzf pie-x86_64-linux-cuda13.0.tar.gz
install pie ~/.local/bin/
pie language install pie-language-python.tar.gz
pie language install pie-language-javascript.tar.gz
```

## Other ways to run Pie

To try Pie without installing anything, open the [Playground](https://pie-project.org/playground). It runs Pie inside your browser tab on WebGPU.

### In Python

`pie-server` embeds the Pie server inside a Python process and returns its local URL and client handle:

```bash
pip install pie-server
```

### In JavaScript

`@pie-project/server` runs the native server in Node.js. When bundled with Vite or webpack, the same package resolves to the WebGPU browser build:

```bash
npm install @pie-project/server
```

See [Embed in your app](https://pie-project.org/docs/serve/embed) for usage in Python, Node.js, browsers, Swift, Kotlin, and C.

### From source

Select a backend at compile time with `--features` (`cuda`, `rocm`, `metal`, `vulkan`, `wgpu`, or `xla`). The `vulkan` backend requires `slangc` on your `PATH`.

```bash
git clone https://github.com/pie-project/pie.git
cd pie
cargo build --release -p pie --bin pie --features metal
```
