npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mozilla-ai/pi-otari

v0.3.0

Published

Route Pi model requests through Otari with automatic model discovery

Downloads

682

Readme

Pi is a minimal, extensible terminal coding harness, while Otari is an AI control plane and gateway for routing model requests, managing provider credentials, and tracking usage, budgets, and traces. This extension connects them so Pi can use Otari-managed models.

Demo

Pi Otari extension demo

Requirements

  • Pi 0.81.0 or newer, installed and available as pi (older versions can install the package but the extension will remain disabled and show an upgrade message)
  • Node.js 22.19.0 or newer
  • An Otari workspace API key
  • At least one upstream provider and model enabled in your Otari workspace

Install and use

  1. Install the extension from npm:

    pi install npm:@mozilla-ai/pi-otari
  2. Start Pi:

    pi
  3. Run /login otari and enter your Otari workspace API key in Pi's secret authentication prompt. This is API-key authentication, not OAuth: the prompt is separate from chat, so the key is not added to model context or sent to an LLM.

    Pi stores the credential in ~/.pi/agent/auth.json, a plaintext file created with user-only permissions (0600). Keep that file out of source control and untrusted backups. Run /logout otari to remove the stored credential.

  4. Make Otari models available in Pi:

    • Run /scoped-models.
    • Search for otari.
    • Enable the models you want to use.
    • Press Ctrl+S to save the scope.
  5. Run /model and select one of the enabled otari models.

  6. Send a prompt normally. No Otari-specific slash command is required. When an Otari model is selected, Pi's status area shows Otari → <model-id>.

Pi sends requests for the selected provider to https://api.otari.ai/v1/chat/completions. Local Pi tools continue to run according to your Pi configuration.

To inspect the Otari models available to Pi from a shell, run:

pi --list-models otari

Update or remove

pi update npm:@mozilla-ai/pi-otari
pi remove npm:@mozilla-ai/pi-otari

Model discovery

After login and during provider refresh, the extension uses authenticated, workspace-scoped model discovery. Hosted Otari queries GET https://api.otari.ai/api/v1/models; custom and self-hosted installations query GET ${OTARI_BASE_URL}/models. Only models available through providers enabled for the authenticated workspace are registered. If the hosted endpoint responds with 404 or 405, the extension safely falls back to the public managed mzai catalog without sending the workspace token.

If no models are found, provide one or more explicit Otari selectors before starting or restarting Pi:

export OTARI_MODELS="anthropic:claude-sonnet-5,mistral:mistral-medium-3-5" # optional fallback or additional selectors
pi

These selectors are unverified until the first request. Otari must have the corresponding provider and model enabled for the workspace.

Reasoning levels

Otari models expose Pi's minimal, low, medium, high, xhigh, and max reasoning levels. The extension forwards the selected level unchanged. Pi's default remains medium unless the user configures or selects another level.

Until Otari discovery provides per-model reasoning capabilities, these levels are optimistic: an upstream model may reject a level it does not support. The extension preserves that error without silently retrying at a different level or without reasoning. When the upstream error reports supported values, they appear in Pi's error message.

Non-interactive authentication

For CI, containers, and other noninteractive environments, provide the API key through OTARI_API_KEY:

OTARI_API_KEY=tk_example pi

A key stored through /login otari takes precedence over OTARI_API_KEY. Running /logout otari removes the stored key, but Pi will continue using OTARI_API_KEY if it is set.

Self-hosted Otari

export OTARI_BASE_URL=https://otari.example.com/v1
pi

Then run /login otari. For noninteractive use, set both OTARI_BASE_URL and OTARI_API_KEY.

HTTP is accepted only for loopback development endpoints.

Configuration

| Variable | Default | Description | |---|---|---| | OTARI_API_KEY | none | Workspace token or standalone key fallback when no stored credential exists | | OTARI_BASE_URL | https://api.otari.ai/v1 | OpenAI-compatible base URL | | OTARI_DISCOVERY_TIMEOUT_MS | 5000 | Discovery timeout from 1000 to 30000 ms | | OTARI_MODELS | none | Conditional fallback or additional model selectors |

Privacy and security

Model requests using otari/* pass through Otari and the selected upstream provider. The extension does not maintain its own credential file. When you use /login otari, Pi stores the API key in ~/.pi/agent/auth.json; when you use OTARI_API_KEY, the key remains environment-provided. The extension stores no prompts, responses, tool content, or telemetry. Pi persists provider model metadata in its native model store. Discovery rejects redirects and never sends a token to the public managed-catalog fallback.

Troubleshooting

  • “pi-otari requires Pi 0.81.0 or newer”: run pi update, then restart Pi. The package uses wildcard Pi peer dependencies, as required for Pi packages, and checks host compatibility at runtime instead of installing a second copy of Pi.
  • No Otari models in /model: run /scoped-models, search for otari, enable models, and press Ctrl+S. If no models are available there, set OTARI_MODELS before starting or restarting Pi.
  • Missing credentials: run /login otari, or set OTARI_API_KEY before starting or restarting Pi.
  • 401/403: run /login otari with a valid replacement key, or update OTARI_API_KEY when no stored credential exists and restart Pi; then confirm workspace access.
  • Unknown model: the selected provider or model is not enabled in your Otari workspace. Enable it in Otari, refresh the provider, or select a different Otari model in Pi.

Contributing

See CONTRIBUTING.md for development, testing, dependency updates, and release instructions.

License

Apache-2.0