# omp-hyper-provider

An [Oh My Pi (OMP)][omp] plugin that registers Charm's [Hyper] inference
provider with OMP, supporting API keys or OAuth, dynamic model discovery, and
optionally showing your team name and Hypercredit balance in the status line.

> [!NOTE]
> This is a fork of Charm's [`pi-hyper-provider`][upstream], adapted to run
> under **Oh My Pi (OMP)** instead of upstream Pi. OMP's internal fork of
> `pi-ai` dropped the `createProvider` / `openAICompletionsApi` surface the
> original extension relies on, so this fork registers the provider through
> OMP's own flat `ProviderConfig` contract. Use this with `omp`, not `pi`.

[omp]: https://github.com/can1357/oh-my-pi
[upstream]: https://github.com/charmbracelet/pi-hyper-provider
[Hyper]: https://hyper.charm.land

```sh
# via the marketplace (recommended — enables `omp plugin upgrade` / `omp update --plugins`)
omp plugin marketplace add Immortal-Web/omp-hyper-provider
omp plugin install omp-hyper-provider@immortal-web

# or directly from git
omp plugin install github:Immortal-Web/omp-hyper-provider
```

## Usage

- To authenticate with OAuth, open `omp`, send `/login`, pick `Subscription`, and select the
  `Charm Hyper` provider.
- To authenticate with an API key, set the `HYPER_API_KEY` environment variable
  then open `omp`.

Pick a Hyper model by sending `/model` and filtering by either provider name
`hyper` or `model-name` like `glm-5.1`.

After Hyper credentials are configured, OMP discovers available models and
persists the latest successful catalog in its standard model store. A previously
discovered catalog remains available when a later refresh fails. By default,
your remaining Hypercredit balance is shown in the status line while a Hyper
model is active.

Use `/hyper-status` to configure the status line interactively and toggle things
on/off or reset to the defaults. `teamName` defaults to `false` and
`hypercredits` defaults to `true`. You can also set values directly:

```sh
/hyper-status teamName true
/hyper-status hypercredits false
/hyper-status reset
```

## Contributing

See the [contributing guide](https://github.com/Immortal-Web/omp-hyper-provider?tab=contributing-ov-file#contributing).

## Releasing

1. `mise run release:bump <patch|minor|major|prepatch|preminor|premajor|prerelease>`
   to increment the version (also syncs the `.omp-plugin/marketplace.json`
   catalog version so marketplace installs see the release)
2. `mise run release:pack` to dry-run build the release tarball
3. `mise run release:publish` to publish

## License

[MIT](https://github.com/Immortal-Web/omp-hyper-provider/raw/main/LICENSE)

---

Adapted from [Charm](https://charm.land)'s [pi-hyper-provider][upstream] for Oh
My Pi. Hyper is a Charm service; this fork is community-maintained and not
affiliated with Charm.
