OpenRouter presets, finally selectable in Pi /model
The itch: I found a cheaper provider for DeepSeek V4.1. It is open weights, served by 31 providers on OpenRouter, and priced from 0.09 / 0.18 per million tokens up to 2.25 combined. Pinning the cheap one is a routing block:
"provider": { "only": ["decart"], "sort": { "by": "price" } }OpenRouter
presets let me save that server-side under a slug, alongside the
model, routing, system prompt, sampling parameters and tools, then ask
for it as model: "@preset/<slug>" instead of
repeating the block in every request. Retuning it later needs no deploy
either.
The problem: using that preset in Pi. Pi resolves
models from a catalog it knows, and @preset/<slug> is
not in it. The preset sat on my account while the harness I actually use
could not select it.
The solution: pi-openrouter-presets.
It registers a provider beside the built-in openrouter and
lists your presets as models in /model.
pi install npm:pi-openrouter-presetsMaking the presets is a prerequisite. They are created in the OpenRouter dashboard, and the extension only surfaces what is already there.
/presets # refresh and list
/model openrouter-presets/@preset/cheap-flash
Credentials come from the OpenRouter login you already have. Each preset’s context window, max output, reasoning support and price are copied from its base model in Pi’s catalog, and the list is cached and restored at startup, so presets work offline. MIT, Pi 1.0.0 or newer.
Source: jan5o7o/pi-openrouter-presets