All plugins

gaming-mode

Pause local llama.cpp inference to free VRAM for gaming: /gaming on vetoes new local-model turns and unloads the model, a daily auto-off re-arms it, and a boot catch-up fires a late auto-off after reboots. Disclosure — local-only: reads Hermes' managed llama.cpp endpoint file (runtimes/llamacpp/server.json, including its local API key) and calls only that loopback router to list and unload models; status runs nvidia-smi, rocm-smi, free (or vm_stat/sysctl on macOS) and reads /sys/class/drm counters; the agent can also switch gaming mode through the gaming tool; one in-process daemon thread runs the auto-off timer and dies with the gateway; no third-party network calls, no telemetry.

Essemito2Modelsv0.1.5Updated 1 hour ago

About

Pause local llama.cpp inference to free VRAM for gaming: /gaming on vetoes new local-model turns and unloads the model, a daily auto-off re-arms it, and a boot catch-up fires a late auto-off after reboots. Disclosure — local-only: reads Hermes' managed llama.cpp endpoint file (runtimes/llamacpp/server.json, including its local API key) and calls only that loopback router to list and unload models; status runs nvidia-smi, rocm-smi, free (or vm_stat/sysctl on macOS) and reads /sys/class/drm counters; the agent can also switch gaming mode through the gaming tool; one in-process daemon thread runs the auto-off timer and dies with the gateway; no third-party network calls, no telemetry.

gaming-mode (Hermes plugin)

Pause local llama.cpp inference to free VRAM
for gaming — from anywhere you can talk to Hermes (CLI, Telegram, Web UI, TUI).

/gaming on blocks new model turns, waits for in-flight work to drain, unloads the
model so the VRAM is actually freed, and confirms it. /gaming off resumes: open
sessions continue where they left off (conversation state is on disk) and the model
reloads lazily on the first request — native runtime behaviour, no restart.

Commands

CommandWhat it does
/gaming onGaming mode ON. New turns for the local model are blocked immediately; the model unloads after in-flight work finishes.
/gaming offGaming mode OFF. Everything resumes; the model reloads on the first request.
/gaming statusLive snapshot: mode, per-model status, GPU/RAM usage, auto-off schedule.
/gaming auto 5:30Daily auto-off at 05:30 local time (HH:MM; a bare hour like 5 means 05:00).
/gaming autoShow the current auto-off schedule.
/gaming auto offDisable auto-off.

The same operations are available to the agent as a gaming tool
({"command": "on"|"off"|"status"|"auto", "hour": 0-23, "minute": 0-59}), so it
can react to "pausa il modello, vado a giocare" without any slash command.

What happens to running work

Work pauses at the turn boundary: a multi-step agent loop finishes its current
step and is stopped at the next model call with a clear message:

⚡ Gaming mode is active — the local model is not loaded, so this turn was not
processed. In-flight work was paused and VRAM is being freed. When you are done
gaming, send /gaming off to resume.

Nothing is lost: conversation state lives on disk, and after /gaming off every
open session picks up on its next message. The model is reloaded automatically by
the runtime supervisor on the first request (same lazy path as the tray's auto-off).

How it works

  • A pre_llm_call hook vetoes calls that target a model staged on the local
    llama.cpp router while gaming mode is ON. Calls for other models (e.g. a cloud
    provider) pass through untouched.
  • Unloading uses the router's own HTTP API (POST /models/unload) — the same
    mechanism Hermes' local-runtime supervisor uses — with a busy probe
    (/slots + /metrics, autoload=false so reads never re-load the model).
  • The daily auto-off runs on an in-process timer (no systemd/cron needed). The
    schedule is stored in plugin state as minutes-of-day (HH:MM), so a bare hour
    like 5 and 5:30 both work. The deadline (first occurrence after the mode
    was turned ON) is re-derived on every timer tick, so changing the schedule —
    or turning the mode ON again — while the timer waits is picked up within one
    tick instead of sleeping toward the previous deadline.
  • State (active, model list, unloaded, auto-off schedule) is stored in the
    plugin's persistent state (ctx.state), so a gateway restart re-arms
    everything: if gaming mode was ON, the model is unloaded again at startup.
  • Boot catch-up: if gaming mode was ON and the auto-off that followed the
    on has already elapsed (e.g. the PC was off through it), it fires on the
    first gateway start instead of waiting another whole day.
  • Auto-off notification: when the auto-off fires (timer tick or boot
    catch-up), the status command is injected into the chat that sent
    /gaming on. It is a plain slash dispatch: no LLM turn, no model load.
    Requires plugins.entries.gaming-mode.allow_gateway_injection: true in
    ~/.hermes/config.yaml; without a registered chat, or if the injection is
    rejected, the off still happens and the event is only logged.

    Warning — terminal surfaces: if that chat lives in a terminal (classic
    CLI hermes or hermes tui), the notification will not show up. The
    gateway does deliver it to the session, but a terminal client sitting idle
    at the prompt does not render a response to a turn it did not start (Hermes
    core client behaviour, not a plugin bug). The auto-off itself still fires
    and the state flips correctly — only the message is invisible. Send
    /gaming on from Telegram or the Web UI to receive the notification there.

Disclosures

  • Local reads only. status probes local GPU/RAM counters best-effort
    (nvidia-smi, rocm-smi, /sys/class/drm, system RAM) and talks to the
    local llama.cpp router's own loopback HTTP API (/models/unload, /slots,
    /metrics). No network calls to third-party services, no telemetry, no
    credentials stored or read.
  • Background work. One in-process daemon thread runs the daily auto-off
    timer; it dies with the gateway. No external processes are spawned.
  • Turn vetoes. While gaming mode is ON, the pre_llm_call hook blocks new
    turns for the local model (the plugin's purpose); calls for other models pass
    through untouched.
  • Auto-off notification is a plain slash dispatch (/gaming status) into
    the chat that sent /gaming on — no LLM turn, no model load. It requires
    plugins.entries.gaming-mode.allow_gateway_injection: true in
    ~/.hermes/config.yaml; without it the off still fires, log-only. It is not
    visible from terminal surfaces (CLI/TUI) — see the warning in
    "How it works".

Requirements

  • Hermes Agent ≥ 0.23 with the llamacpp local runtime (a server.json must
    exist under your profile's runtimes/llamacpp/).
  • Multi-GPU and Windows are supported via the same router API; GPU memory
    counters in status probe nvidia-smi / rocm-smi / /sys/class/drm
    best-effort (on integrated GPUs it reports system RAM instead).

Install

hermes plugins install https://github.com/Essemito2/gaming-mode
hermes gateway restart   # or `hermes restart` in the CLI

Verify with /gaming status (works with the plugin enabled even while OFF —
it's a plain command, no model turn involved).

Develop

python3 -m unittest discover -s tests -v
hermes plugins validate .
hermes plugins install .            # local install for testing

The core (gaming/core.py) has zero Hermes imports: it is tested with a stub
router and a dict-backed state.

Language (i18n)

All user-facing strings live in gaming/i18n.py (English base, by design).
The active language follows the same precedence as Hermes itself:
HERMES_LANGUAGE env (per-profile .env) > the profile's display.language
config > en.

Adding a language is one JSON file in locales/ — no code changes, and a
missing key or file falls back to English per key:

// locales/it.json
{ "off_already": "Modalità gaming già spenta." }

The intended target set is the 17 languages Hermes bundles
(en base, af, ar, de, es, fr, ga, hu, it, ja, ko, pt,
ru, tr, uk, zh, zh-hant); catalogs are shipped as needed. See
locales/README.md for the full convention.

Relationship to hermes-gaming-tray

This plugin is the agent-side companion of the hermes-gaming-tray KDE
plasmoid. The tray gives you the desktop UX (double-click icon, settings,
notifications); the plugin gives you the same workflow from chat and to the
agent itself. They can coexist (the tray keeps its own state), or you can run
the tray only as the status/notify surface and drive everything from chat.

License

MIT — see LICENSE. Derived conceptually from hermes-gaming-tray
(itself derived from Scriptinator, © tubbadu, GPL-3.0-or-later); no code was
copied from the GPL project, only the workflow.

README from the reviewed commit abcc5e3; it updates when the author re-pins.

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section