@ooo-razum/pi-open-webui

Dynamic Open WebUI model provider for the Pi coding agent with interactive /login setup, by RAZUM.

Packages

Package details

extension

Install @ooo-razum/pi-open-webui from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@ooo-razum/pi-open-webui
Package
@ooo-razum/pi-open-webui
Version
0.1.2
Published
Sep 1, 2026
Downloads
421/mo · 28/wk
Author
semenchuk
License
MIT
Types
extension
Size
16 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/open-webui-provider.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@ooo-razum/pi-open-webui

A RAZUM open-source package.

Dynamic Open WebUI model provider for the Pi coding agent. It adds Open WebUI to Pi's /login screen, securely stores the selected server and API token, and discovers every model available to that account.

Install

Install the package with Pi, not with npm install:

pi install npm:@ooo-razum/pi-open-webui

npm install @ooo-razum/pi-open-webui only places the package in the current project's node_modules; it does not register the extension with Pi.

Verify that Pi sees the package:

pi list

Restart Pi after installation, or run /reload in an existing Pi session.

You can also test a Git checkout without installing it permanently:

pi -e ./pi-open-webui

Authorize Open WebUI with /login

Before you begin

You need an Open WebUI API token. In Open WebUI, open Settings → Account → API Keys and create a token. If the API Keys section is missing, an Open WebUI administrator must enable API keys globally and grant the API Keys permission to your user or group.

Interactive setup

  1. Start Pi.

  2. Enter:

    /login
    
  3. Select Sign in with an API key.

  4. Select Open WebUI from the provider list.

  5. At Open WebUI URL, enter the address of your server, for example:

    https://webui.example.com
    

    The RAZUM deployment example is https://webui.razum.tools.

  6. At Open WebUI API token, paste the token created in Open WebUI. This is a masked secret field.

  7. Wait for the confirmation message:

    Connected to Open WebUI. Found N models.
    

You can also open this provider directly:

/login open-webui

After authorization, run /model, search for open-webui, and select one of your models. The extension validates credentials through /api/models and refreshes the model catalog automatically.

Pi stores the server URL and token in ~/.pi/agent/auth.json. The token is never included in this npm package. Use /logout open-webui to remove the saved credentials.

Linux note

Install and run Pi as the same operating-system user. Avoid sudo pi install ..., otherwise the package and credentials are stored under root instead of your normal user account.

Environment variables

Headless environments can configure the provider without /login:

export OPEN_WEBUI_BASE_URL="https://webui.example.com"
export OPEN_WEBUI_API_KEY="sk-..."
pi

Supported URL forms

All these values are normalized to the native Open WebUI API base URL:

  • https://webui.example.com
  • https://webui.example.com/api
  • https://webui.example.com/api/v1
  • https://webui.example.com/openai/v1

The extension uses /api/models for discovery and /api/chat/completions for model requests. This works even when Open WebUI's optional direct OpenAI passthrough is disabled.

Unencrypted HTTP is accepted for localhost. For other hosts, the login flow displays an explicit warning because a bearer token sent over HTTP can be intercepted.

Dynamic model catalog

The provider:

  • discovers models available to the authenticated Open WebUI user;
  • removes duplicate model IDs;
  • reads context/output limits and modality metadata when available;
  • caches the last successful catalog through Pi's model store;
  • refreshes the catalog after login and when Pi refreshes model providers.

Troubleshooting

Open WebUI does not appear in /login

Confirm that the package was installed through Pi:

pi list
pi install npm:@ooo-razum/pi-open-webui

Then restart Pi or run /reload. Check pi --version; Pi 0.84.4 or newer is recommended.

pi update says “No matching package found”

The package was likely installed with npm install instead of pi install. Register it first:

pi install npm:@ooo-razum/pi-open-webui

Authentication returns 401

Create a new API token in Open WebUI and repeat /login open-webui. The connection credential configured under Open WebUI's Admin → Connections is an upstream-provider credential and is not an Open WebUI user API token.

Remove credentials or package

/logout open-webui
pi remove npm:@ooo-razum/pi-open-webui

Development

npm install
npm test
npm run check
npm run pack:check

Security

Pi extensions execute with the user's full system permissions. Review package source before installing. Never commit Open WebUI tokens to source control, package files, examples, or issue reports.

About RAZUM

Built and maintained by RAZUM.

Author: Semenchul Alexandr — semenchuk@razum.life

License

MIT © Semenchul Alexandr / RAZUM