# Pi

[Pi](https://github.com/earendil-works/pi) ist ein minimaler KI-Coding-Harness für das Terminal. Du kannst Aqueduct als Provider nutzen, indem du es zu deiner Pi-Konfiguration hinzufügst.

!!! tip

    Wie du eigene Modelle und Provider allgemein konfigurierst, steht in der [Pi-Dokumentation](https://pi.dev/docs/latest).

## Einrichtung { #setup }

### 1. Provider konfigurieren { #1-configure-the-provider }

Füg Aqueduct zu deiner Pi-Modellkonfiguration (`~/.pi/agent/models.json`) hinzu:

``` 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 "Wichtige Einstellungen"

    - `"baseUrl"` – die Base-URL der OpenAI-kompatiblen API von Aqueduct.
    - `"api"` – Aqueduct spricht die OpenAI-API (`openai-completions`).
    - `"apiKey"` – ersetze den Platzhalter durch deinen eigenen Aqueduct-API-Key (siehe unten).
    - `"id"` – entspricht der Modell-ID auf Aqueduct.
    - `"thinkingLevelMap"` – blendet nicht unterstützte Thinking-Levels aus. Qwen 3.8 27B unterstützt die Reasoning Efforts `low`, `medium` und `xhigh`, GLM 5.3 und DeepSeek V4 Flash Vision Exp unterstützen `low`, `high` und `max`.
    - `"compat.thinkingFormat"` – `chat-template` mit Chat-Template-Kwargs, um das Reasoning zu steuern.

### 2. API-Key eintragen { #2-add-your-api-key }

Ersetze den Platzhalter `sk-PASTE-YOUR-AQUEDUCT-KEY-HERE` in deiner `models.json` durch einen echten Aqueduct-API-Key. Einen Key bekommst du unter [aqueduct.ai.datalab.tuwien.ac.at](https://aqueduct.ai.datalab.tuwien.ac.at/):

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

!!! tip
    Wenn du deinen Key nicht im Klartext speichern willst, kann Pi ihn auch aus einer Umgebungsvariable lesen (z. B. `"apiKey": "$AQUEDUCT_API_KEY"`) oder gespeicherte Zugangsdaten über `/login aqueduct` verwenden. Die unterstützte Syntax findest du in der [Pi-Dokumentation](https://pi.dev/docs/latest).

### 3. Loslegen { #3-start-coding }

``` bash
pi
```

Wähl dann mit `/model` eines der Aqueduct-Modelle aus, oder starte eine Session direkt mit einem bestimmten Modell:

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