model-peak-switch
English · Русский
During the provider's peak hours, Hermes' current main model costs more. This plugin sends the
outgoing request to a cheaper backup model instead — without touching the model route in
config.yaml, agent.model or the delegate.
Install:
hermes plugins install npetroff24/hermes-plugin-model-peak-switch
Then set the backup model (required, no default):
hermes config set plugins.entries.model-peak-switch.settings.peak_model <model-id>
How it works
The llm_request middleware is the only mechanism. It reads model, provider, base_url,
platform and session_id from the request context, so it follows whatever model Hermes is
actually using — including /model in chat and fallback switching. When that model has
cost.multipliers with factor > 1 in the provider's public <base_url>/models catalog, the
outgoing model (plus reasoning level and max_tokens) is changed to peak_model. Outside the
windows the request stays on the model Hermes chose.
Delegates are skipped by platform == "subagent", not by comparing model names: a delegate may
inherit the parent's model id. The config/UI bar still shows the configured model — the plugin
does not rewrite it; the real outgoing model is shown in /peak, in the status-bar chip and in
the agent log.
Peak windows come from the public catalog, cached in memory and plugin state for six hours. The
request path never fetches over the network; /peak check and /peak windows refresh it. If the
cache is empty or peak_model is no longer listed by the provider, no rewrite happens.
Statuses
Status: deepseek-v4.1-flash has no peak hours — plugin idle
Status: deepseek-v4.1-flash has peak hours; set peak_model to switch
Status: peak model hy4-flash not found at provider — no switching
Status: peak, Hermes shows deepseek-v4.1-flash, requests go to hy4-flash
Next switch to deepseek-v4.1-flash at 14:00
/peak all adds slots, catalog URL, windows, last switch. /peak check validates both model ids,
reasoning levels and output limits. /peak windows refreshes the catalog. /peak on|off toggles
automatic switching.
Settings
| key | default | meaning |
|---|---|---|
peak_model | required | backup model on the same provider route |
peak_effort | high | reasoning level for the backup model (clamped to supported levels) |
auto_switch | true | automatic switching |
windows_source | auto | auto = cost.multipliers, manual = the string below |
manual_windows | "" | mon-fri 01:00-04:00,06:00-10:00 x2 (UTC) |
catalog_url | "" | explicit catalog URL; otherwise <context base_url>/models |
language | auto | auto follows Hermes display.language; en/ru force |
Desktop status bar
The package ships a desktop half (desktop/plugin.js) and a backend route
(dashboard/plugin_api.py + manifest.json). The app copies the desktop half into
desktop-plugins/model-peak-switch/, but a unified package's desktop half ships opt-in: enable
it once in Capabilities → Plugins (the model-peak-switch row's desktop toggle). Until then it
is inventoried but its register() never runs, so there is no chip. The chip shows one short line —
Active: <model the request actually uses> (⚠ prefix when the backup model is missing or not set)
— and the hover title carries the reason. The chip is not available in the terminal CLI — there
/peak and the log are the indicators.

Upgrading from 2.x → 3.0
base_provider, base_model, base_effort and peak_provider are gone — the main model now
comes from the request context. Set peak_model explicitly; old base_* keys can be deleted from
plugins.entries.model-peak-switch.settings. Run /peak check after upgrading.
Limits
config_schema.required only warns, it does not block installation (there is no public
on_install hook). Immediately after /model, before the first request, /peak may show the
previously recorded model; the status-bar chip uses the live app model. Switching across providers
is refused — the HTTP client and credentials belong to one route.
Disclosure
- Network:
GET <base_url>/models(or an explicitcatalog_url, or the opencode defaults) —
the provider's public model catalog, sent without credentials, only from/peak checkand
/peak windows. Thellm_requesthot path never makes a network call; the result is cached in
memory and plugin state for six hours. - Reads:
display.languageandmodel.defaultfrom the Hermes config, to follow the UI
language and the configured model. - Writes:
status.jsonin<hermes home>/plugin-data/model-peak-switch/(the snapshot the
desktop chip reads), and the plugin's ownauto_switchsetting on/peak on|off. The model
route inconfig.yaml,agent.modelanddelegation.*are never written. - Desktop: the optional chip polls
/api/plugins/model-peak-switch/statusevery 15 seconds. - Not used:
.env,auth.jsonor any credential store, shell commands, background processes,
telemetry, self-update.
Verify
hermes plugins validate /path/to/hermes-plugin-model-peak-switch --install-deps
python -m pytest tests -q -p no:cacheprovider --rootdir=tests
hermes -z "/peak"
MIT · https://github.com/npetroff24/hermes-plugin-model-peak-switch
README from the reviewed commit 4c9a299; it updates when the author re-pins.

npetroff24