pi-merius-provider
v1.0.4
Published
Merius provider extension for pi - Open models on Merius's own GPUs via an OpenAI-compatible API
Maintainers
Readme
🪐 pi-merius-provider
Open models on Merius's own GPUs for pi
One OpenAI-compatible API to open models on Merius's own GPUs — DeepSeek, GLM, Kimi, MiniMax, and more.
Features
- OpenAI-compatible API — Uses Merius's
/v1/chat/completionsendpoint - Rich auto-synced catalogue — The Merius
/v1/modelsendpoint returns per-model pricing, context windows, max output, modalities, and supported features;models.jsonis generated directly from it - Public model list —
/v1/modelsis unauthenticated, so pi lists Merius models (and the background model sync runs) even before you set a key - Reasoning models — Thinking models are detected from the API's
supported_featuresand configured forreasoning_effortcontrol - Vision models — Image input is auto-detected from
input_modalities - Tool use — Function calling for models that advertise
toolssupport - Streaming — Real-time token streaming
- Prompt caching — Cached input is billed at a cheaper rate when the API reports an
input_cache_readprice
Available Models
| Model | Context | Vision | Reasoning | Input $/M | Output $/M | |-------|---------|--------|-----------|-----------|------------| | DeepSeek V4 Flash | 1.0M | ❌ | ✅ | $0.09 | $0.18 | | GLM-5.2 | 1.0M | ❌ | ✅ | $0.60 | $2.20 | | Kimi K3 | 1.0M | ✅ | ✅ | $2.50 | $13.00 | | MiniMax M3 | 524K | ❌ | ✅ | $0.30 | $1.20 |
The table above is regenerated by
node scripts/update-models.jsfrom the live Merius API. Costs are per million tokens (the API reports per-token prices). Prices subject to change — check docs.merius.ai/docs/pricing for current pricing.
Installation
Option 1: Using pi install (Recommended)
Install from npm (published as pi-merius-provider) or directly from GitHub:
# From npm
pi install npm:pi-merius-provider
# Or directly from GitHub
pi install https://github.com/monotykamary/pi-merius-providerThen set your API key and run pi:
# Recommended: add to auth.json
# See Authentication section below
# Or set as environment variable
export MERIUS_API_KEY=your-api-key-here
piGet your API key from merius.ai.
Option 2: Manual Clone
Clone this repository:
git clone https://github.com/monotykamary/pi-merius-provider.git cd pi-merius-providerSet your Merius API key:
# Recommended: add to auth.json # See Authentication section below # Or set as environment variable export MERIUS_API_KEY=your-api-key-hereRun pi with the extension:
pi -e /path/to/pi-merius-provider
Authentication
The Merius API key can be configured in multiple ways (resolved in this order):
auth.json(recommended) — Add to~/.pi/agent/auth.json:
The{ "merius": { "type": "api_key", "key": "your-api-key" } }keyfield supports literal values, env var names, and shell commands (prefix with!). See pi's auth file docs for details.- Runtime override — Use the
--api-keyCLI flag - Environment variable — Set
MERIUS_API_KEY
Get your API key from merius.ai.
Note: A key is only required to actually call a model. The model catalogue (
/v1/models) is public, so pi displays available Merius models and keeps them synced even before a key is configured.
Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| MERIUS_API_KEY | No | Your Merius API key (fallback if not in auth.json; only needed to call a model) |
Configuration
Add to your pi configuration for automatic loading:
{
"extensions": [
"/path/to/pi-merius-provider"
]
}Usage
Once loaded, select a model with:
/model merius minimax/minimax-m3Or use /models to browse all available Merius models.
Reasoning Effort
For reasoning models, control thinking depth:
/reasoning highValues: none, low, medium, high, max
API Compatibility
Merius provides an OpenAI-compatible API. Key notes:
| Aspect | Behavior |
|--------|----------|
| Endpoint | https://api.merius.ai/v1/chat/completions |
| Max tokens field | Both max_tokens and max_completion_tokens accepted |
| Thinking format | openai (reasoning_content in response, reasoning_effort in request) |
| Developer role | Not assumed (developer messages are converted to system) |
| Reasoning effort | Accepted by reasoning models |
| /v1/models | Public (no auth) — returns pricing, context, modalities, and features |
| Prompt caching | Cached input billed at a cheaper input_cache_read rate when the API exposes one |
Reasoning compat: The Merius
/v1/modelsendpoint reports which models support reasoning, but not the wire format each model expects. Reasoning models are given the standard OpenAI-compatible defaults (thinkingFormat: "openai",supportsReasoningEffort: true,supportsDeveloperRole: false). If a model on Merius needs a different format (for example DeepSeek's nativethinkingfield), override it inpatch.json— see AGENTS.md.
API Documentation
- Merius Docs: https://docs.merius.ai
- OpenAI-compatible endpoint:
https://api.merius.ai/v1 - Models endpoint (public):
https://api.merius.ai/v1/models - Pricing: https://docs.merius.ai/docs/pricing
Updating Models
Run the update script to fetch the latest models from Merius's API:
node scripts/update-models.jsThe /v1/models endpoint is public, so no API key is required. This will:
- Fetch models from
https://api.merius.ai/v1/models - Derive pricing, context windows, max output, vision, and reasoning support from the API metadata
- Apply overrides from
patch.json - Update
models.jsonand the README model table - Move delisted models into
deprecated-models.json(14-day grace period)
License
MIT
