omp packages

@midpath/gptmitra-pi1.4.0

GPT Mitra provider for Pi with per-call supplier pricing and persisted session costs

midpath Published 12 days ago MIT ~289 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

GPT Mitra for Pi

Use GPT Mitra's OpenAI-compatible API in Pi with per-call supplier pricing and persisted session costs.

Install

pi install npm:@midpath/gptmitra-pi
export GPTMITRA_API_KEY='your-consumer-key'

Restart Pi or run /reload. Add your model to ~/.pi/agent/models.json:

{
  "providers": {
    "gptmitra": {
      "api": "gptmitra",
      "baseUrl": "https://app.gptmitra.in/v1",
      "models": [{
        "id": "your-model-id",
        "name": "Your model",
        "input": ["text"],
        "reasoning": false,
        "contextWindow": 32768,
        "maxTokens": 4096
      }]
    }
  }
}

Select the model under the gptmitra provider. Replace the example ID and capabilities with those supported by your supplier. A consumer key needs an enabled owned or shared supplier serving that model. See GPT Mitra setup.

Keep api: gptmitra; using openai-completions bypasses cost handling. For another deployment, change baseUrl, retaining /v1.

Costs

Uses the server's final cost, or complete token usage with the response's supplier rates. Missing usage is marked unavailable, not treated as free; Pi's numeric total excludes unavailable costs and the extension warns that the total is incomplete. Costs persist in Pi sessions. No local prices or additional requests are needed.

Targets Pi's @earendil-works provider API; tested with Pi 1.4.0. This is not a budget or payment system.

Publish

From the repository, after npm login:

./pi-extension/scripts/publish.sh

Runs tests and publishes publicly. The npm prepack hook syncs the version from root VERSION.txt; no Go build is required. Bump that file before subsequent releases. To preview without publishing, pass --dry-run.