(Experimental) Pi extension for interacting with the API of the UniGPT platform
  • TypeScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Benjamin Hackl 7cf9a494fa
Some checks failed
CI / test (22) (push) Failing after 29s
CI / test (24) (push) Failing after 29s
Point package metadata and install instructions at the Uni Graz Gitea
2026-11-03 20:39:34 +01:00
.gitea/workflows Point package metadata and install instructions at the Uni Graz Gitea 2026-11-03 20:39:34 +01:00
src UniGPT provider for pi 2026-11-03 20:01:28 +01:00
test UniGPT provider for pi 2026-11-03 20:01:28 +01:00
.gitignore UniGPT provider for pi 2026-11-03 20:01:28 +01:00
LICENSE UniGPT provider for pi 2026-11-03 20:01:28 +01:00
package.json Point package metadata and install instructions at the Uni Graz Gitea 2026-11-03 20:39:34 +01:00
pnpm-lock.yaml UniGPT provider for pi 2026-11-03 20:01:28 +01:00
pnpm-workspace.yaml UniGPT provider for pi 2026-11-03 20:01:28 +01:00
README.md Point package metadata and install instructions at the Uni Graz Gitea 2026-11-03 20:39:34 +01:00
tsconfig.json UniGPT provider for pi 2026-11-03 20:01:28 +01:00

pi-unigpt

Use UniGPT, the University of Graz's MyGPT platform, as a model provider in pi.

  • Log in with /login unigpt; your key is checked before pi saves it.
  • Models are discovered automatically. No model list to maintain.
  • Context size, output limit, and image support come from pi's own model catalog, so they stay current as pi updates.
  • Tool calling, streaming, and image input work through pi's built-in OpenAI Responses support.

Requires pi 1.5.x and Node.js 22.19+.

Install

pi install git:imsc.uni-graz.at/git/behackl/pi-unigpt

This follows the latest version; pi update --extensions pulls updates. To stay on one release instead, pin its tag: pi install git:imsc.uni-graz.at/git/behackl/pi-unigpt@v0.1.0.

Then start pi (or run /reload in a running session) and log in:

/login unigpt

Paste your UniGPT API key into the masked dialog, not into the chat. Pi confirms how many models your key can use. Pick one with /model; UniGPT models are listed under unigpt.

To try the extension without installing it:

pi -e git:imsc.uni-graz.at/git/behackl/pi-unigpt

Commands

Command What it does
/login unigpt Save and verify your API key
/logout Remove the saved key from pi (it stays valid at UniGPT)
/model Pick a model; also reloads the model list
/unigpt-refresh Reload the UniGPT model list now and show how many models you have

How models are described

UniGPT's API only lists deployment IDs such as gpt-5.4. Those IDs are OpenAI model names, so the extension looks each one up in pi's bundled model catalog and uses its name, context window, output limit, and image support. Where OpenAI and Azure list different limits, the smaller one is used.

IDs that pi does not know get pi's standard defaults for custom models: 128k context, 16k output, text only. Update pi to pick up newer models.

Two things are deliberately not taken from the catalog:

  • Thinking levels are off for every model. UniGPT ignores the requested reasoning effort and uses a fixed one per deployment, so pi's thinking levels would have no effect. Reasoning models still reason.
  • Costs are shown as zero. That means "not tracked", not "free".

You can override any value in ~/.pi/agent/models.json:

{
  "providers": {
    "unigpt": {
      "modelOverrides": {
        "gpt-5.4": { "contextWindow": 200000 }
      }
    }
  }
}

Your API key

Pi stores the key under unigpt in ~/.pi/agent/auth.json. That file is private to your user account but not encrypted. To keep the key out of it, replace the stored value with an environment variable or a password manager command; pi resolves either when it needs the key:

{
  "unigpt": { "type": "api_key", "key": "${UNIGPT_API_KEY}" }
}
{
  "unigpt": { "type": "api_key", "key": "!op read op://Private/UniGPT/credential" }
}

Upgrading from a models.json setup

If you configured UniGPT by hand before, delete the unigpt entry under providers in ~/.pi/agent/models.json (overrides as shown above are fine). Otherwise your old model list and key take precedence over the extension. Then run /reload and /login unigpt.

Troubleshooting

  • No UniGPT models in /model: run /unigpt-refresh; it reports the exact problem (rejected key, unreachable server, empty model list).
  • pi -p says a UniGPT model was not found: print mode only reads the saved model list and never fetches it. Start pi interactively once after logging in; later print runs reuse that list.
  • A specific model fails with HTTP 500: some deployments are misconfigured on the server side; try another model and tell the UniGPT team.

Feedback

Please report problems and ideas at https://imsc.uni-graz.at/git/behackl/pi-unigpt/issues. Include the output of /unigpt-refresh and the model you used, but never your API key.

Development

pnpm install
pnpm run ci   # type check + tests

Tests use fake keys and a local HTTP server; they never contact UniGPT or read your pi configuration.

License

MIT