Skip to content

mcowger/pi-plexus

Repository files navigation

pi-plexus monorepo

Adds Plexus as a provider to pi-compatible coding agents, dynamically discovering models from your Plexus instance.

This repository is a monorepo containing three packages:

Package npm Use as a plugin
@mcowger/pi-plexus npm Yes — install this in pi (earendil-works fork)
@mcowger/omp-plexus npm Yes — install this in oh-my-pi
@mcowger/plexus-models npm No — shared data layer used by the two packages above

Installation

pi (earendil-works fork)

pi install npm:@mcowger/pi-plexus

oh-my-pi

omp plugin install npm:@mcowger/omp-plexus

Configuration

Once installed, run the login command inside your agent:

/plexus login

You will be prompted for:

  1. Base URL — the root URL of your Plexus instance, e.g. https://plexus.example.com (no /v1 suffix)
  2. API key — your Plexus API key
  3. Default model (optional) — the model ID to use by default, e.g. deepseek-v4-flash

Credentials are stored in:

  • ~/.pi/agent/extensions/plexus/ (pi)
  • ~/.omp/agent/extensions/plexus/ (oh-my-pi)

Environment variables

As an alternative to /plexus login, set these before starting your agent:

export PLEXUS_BASE_URL=https://plexus.example.com
export PLEXUS_API_KEY=sk-...

Commands

Command Description
/plexus login Configure base URL and API key
/plexus refresh Re-fetch the model list from your Plexus instance

How it works

On startup the extension loads a cached model list so models are available immediately. On each session start it attempts a live refresh from /v1/models to pick up any changes.

Models are registered under the plexus provider and appear in /model alongside all other configured providers.

Provider-specific model fidelity via pi_provider / pi_model

Many models require provider-specific compatibility settings (e.g. DeepSeek needs system role instead of developer, different thinking formats, etc.). When models are proxied through Plexus, the agent can't auto-detect these because the provider and base URL belong to Plexus, not the original provider.

To solve this, configure Plexus to expose pi_provider and pi_model in its /v1/models response. When these fields are set, the extension looks up the full model definition from the agent's built-in model registry for maximum fidelity — correct api, compat, thinkingLevelMap, reasoning, contextWindow, maxTokens, and input modalities.

Plexus pi model configuration

For example, a DeepSeek V4 Flash entry configured with pi_provider: deepseek and pi_model: deepseek-v4-flash will automatically get the correct compat settings (including supportsDeveloperRole: false and thinkingFormat: deepseek), ensuring requests are formatted correctly even though they're routed through Plexus.

If pi_provider / pi_model are not set, the extension falls back to inferring settings from the Plexus API fields (preferred_api, supported_parameters, architecture, etc.).


Troubleshooting

The extension writes a debug log to:

  • ~/.pi/agent/extensions/plexus/plexus.log (pi)
  • ~/.omp/agent/extensions/plexus/plexus.log (oh-my-pi)
# pi
cat ~/.pi/agent/extensions/plexus/plexus.log

# oh-my-pi
cat ~/.omp/agent/extensions/plexus/plexus.log

Repository structure

packages/
├── plexus-models/    @mcowger/plexus-models — shared data layer, zero host imports
├── pi-plexus/        @mcowger/pi-plexus     — pi (earendil-works) extension
└── omp-plexus/       @mcowger/omp-plexus    — oh-my-pi extension

Each host package depends on @mcowger/plexus-models for fetching, parsing, caching, and config. The host packages handle mapping the generic model descriptors into their respective type systems and registering the provider.


Development

Releasing

All three packages are versioned in lockstep. To cut a release:

npm run release:patch   # 0.4.2 -> 0.4.3
npm run release:minor   # 0.4.2 -> 0.5.0
npm run release:major   # 0.4.2 -> 1.0.0

This bumps the root version, syncs it to all three packages, commits, tags, and pushes. CI picks up the new tag and publishes all three packages to npm automatically via OIDC trusted publishing.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors