# Pi

[Pi](https://github.com/earendil-works/pi) is a minimal terminal AI coding harness. You can use Aqueduct as a provider by adding it to your Pi configuration.

!!! tip

    See the [Pi documentation](https://pi.dev/docs/latest) for general configuration of custom models and providers.

## Setup

### 1. Configure the provider

Add Aqueduct to your Pi model config (`~/.pi/agent/models.json`):

``` json
{
  "providers": {
    "aqueduct": {
      "baseUrl": "https://aqueduct.ai.datalab.tuwien.ac.at/v1/",
      "api": "openai-completions",
      "apiKey": "sk-PASTE-YOUR-AQUEDUCT-KEY-HERE",
      "models": [
        {
          "id": "qwen-3.8-27b",
          "name": "Qwen3.8-27B",
          "input": ["text", "image"],
          "contextWindow": 262144,
          "maxTokens": 65536,
          "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
          "reasoning": true,
          "thinkingLevelMap": {
            "minimal": null,
            "low": "low",
            "medium": "medium",
            "high": null,
            "xhigh": "xhigh",
            "max": null
          },
          "compat": {
            "thinkingFormat": "chat-template",
            "chatTemplateKwargs": {
              "thinking": { "$var": "thinking.enabled" },
              "reasoning_effort": { "$var": "thinking.effort" }
            }
          }
        },
        {
          "id": "glm-5.3-744b-experimental",
          "name": "GLM 5.3",
          "input": ["text"],
          "contextWindow": 262144,
          "maxTokens": 65536,
          "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
          "reasoning": true,
          "thinkingLevelMap": {
            "minimal": null,
            "low": "low",
            "medium": null,
            "high": "high",
            "xhigh": null,
            "max": "max"
          },
          "compat": {
            "thinkingFormat": "chat-template",
            "chatTemplateKwargs": {
              "thinking": { "$var": "thinking.enabled" },
              "reasoning_effort": { "$var": "thinking.effort" }
            }
          }
        },
        {
          "id": "deepseek-v4-vision-exp-284b",
          "name": "DeepSeek-V4-Flash-Vision-Exp",
          "input": ["text", "image"],
          "contextWindow": 393216,
          "maxTokens": 65536,
          "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
          "reasoning": true,
          "thinkingLevelMap": {
            "minimal": null,
            "low": "low",
            "medium": null,
            "high": "high",
            "xhigh": null,
            "max": "max"
          },
          "compat": {
            "thinkingFormat": "chat-template",
            "chatTemplateKwargs": {
              "thinking": { "$var": "thinking.enabled" },
              "reasoning_effort": { "$var": "thinking.effort" }
            }
          }
        }
      ]
    }
  }
}
```

!!! info "Key settings"

    - `"baseUrl"` – Aqueduct's OpenAI-compatible API base URL.
    - `"api"` – Aqueduct speaks the OpenAI API (`openai-completions`).
    - `"apiKey"` – Replace the placeholder with your own Aqueduct API key (see below).
    - `"id"` – Maps to the model ID on Aqueduct.
    - `"thinkingLevelMap"` – Hides unsupported thinking levels. Qwen 3.8 27B supports `low`, `medium` and `xhigh` reasoning efforts; GLM 5.3 and DeepSeek V4 Flash Vision Exp support `low`, `high` and `max`.
    - `"compat.thinkingFormat"` – `chat-template` with chat template kwargs for reasoning control.

### 2. Add your API key

Replace the `sk-PASTE-YOUR-AQUEDUCT-KEY-HERE` placeholder in your `models.json` with a real Aqueduct key. Get one at [aqueduct.ai.datalab.tuwien.ac.at](https://aqueduct.ai.datalab.tuwien.ac.at/):

``` json
"apiKey": "sk-YOUR-REAL-AQUEDUCT-KEY"
```

!!! tip
    If you prefer not to store your key in plain text, Pi also supports reading it from an env variable (e.g. `"apiKey": "$AQUEDUCT_API_KEY"`) or a stored credential via `/login aqueduct`. See the [Pi documentation](https://pi.dev/docs/latest) for the supported value syntax.

### 3. Start coding

``` bash
pi
```

Then use `/model` to select one of the Aqueduct models, or start a session with a specific model directly:

``` bash
pi -m qwen-3.8-27b
```