omp packages

@vidaiuk/pi-provider0.1.2

Vidai as a model provider in pi: every model your Vidai key may call, governed by your organisation’s policies

GitHub Actions Published 4 days ago Apache-2.0 ~0 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

Vidai for pi

Use pi with every model your organisation offers through Vidai, the governance-first AI control room. Your calls go through your Vidai gateway, so your organisation's policies, guardrails, region rules and budgets apply to them, and they show in Vidai's request logs and costs.

Install

pi install npm:@vidaiuk/pi-provider

Or try it once without installing:

pi -e npm:@vidaiuk/pi-provider

Set up

Set two variables, from your Vidai admin or the Vidai console (Keys):

export VIDAI_BASE_URL=https://ai.example.com   # your Vidai gateway, with or without /v1
export VIDAI_API_KEY=vk_...                    # your Vidai key

Start pi and pick a model under Vidai in /model, or run pi --model vidai/<model>. pi --list-models vidai lists them.

What you get

  • Your models only. The list comes from your gateway with your key, so you see the models your key may call, including your organisation's aliases.
  • Each provider's own format. Claude models use Anthropic Messages, Gemini models use the Gemini API, OpenAI's models use the Responses API, and the rest use Chat Completions. Prompt caching and reasoning work as the provider made them.
  • pi's model details. Context window, output limit, image input and reasoning come from pi's own model catalog. Models it doesn't know get safe defaults.
  • Cost stays in Vidai. pi shows $0 for Vidai models. Your organisation's real cost for each call is in Vidai's Cost page and request logs.

If a model uses the wrong format

The package works out each model's format from its name. If your organisation uses a name that doesn't say what the model is (an Azure deployment, an alias), it uses Chat Completions, which your gateway translates. That works, but without the provider's own prompt caching. You can set the format yourself:

export VIDAI_MODEL_FORMATS="team-coder=anthropic-messages,prod-gpt=openai-responses"

Formats: anthropic-messages, openai-responses, google-generative-ai, openai-completions. Newer Vidai gateways report each model's provider, and the package then uses that.

Troubleshooting

  • "vidai: couldn't list models … 401": the key is wrong or revoked. Check VIDAI_API_KEY.
  • "… check VIDAI_BASE_URL": pi can't reach the gateway. Check the address and that you're on the right network.
  • 403 model_not_allowed: your key isn't allowed that model. Ask your Vidai admin.
  • Guardrail blocks: your organisation's policy stopped the request. The message says which rule; ask your Vidai admin.

Works with

Vidai 1.0.0-rc.3 and later, pi 1.4 and later. Full guide: Vidai docs: pi. The source is short (three files in src/); read it before installing, as with any pi extension.

Licence

Apache 2.0