111 lines
6.0 KiB
Markdown
111 lines
6.0 KiB
Markdown
# Native Hermes audio separation — 18 October 2026
|
|
|
|
Direct Hermes plugin using the documented `plugin.yaml` / `register(ctx)` tool
|
|
interface. This is our integration code, not an upstream Hermes feature or patch.
|
|
No MCP server, extra container, custom image, startup script or Python package
|
|
installation is involved. Existing Athena Deck performs the separation.
|
|
|
|
## Use
|
|
|
|
Start a **new Hermes session** after activation (the running gateway reports that
|
|
new toolsets take effect on the next session). Attach an MP3 and ask:
|
|
|
|
> Trenne diese MP3 in Gesang und Instrumental. Gib mir beide Dateien einzeln zurück.
|
|
|
|
The tool `athena_separate_audio` receives the gateway-local attachment path. It
|
|
starts `/api/v1/separator-chat/start`, checks the same job through
|
|
`/api/v1/separator-tests`, then downloads the two WAVs through
|
|
`/api/v1/separator-tests/audio`. It uses the same BS-RoFormer checkpoint as the
|
|
existing OpenWebUI integration. Inputs may be MP3/WAV/FLAC/M4A/OGG/OPUS/AAC/AIFF/
|
|
WebM, up to 256 MiB and 20 minutes. Existing FFmpeg normalizes them to stereo
|
|
44.1-kHz PCM16; temporary converted input is deleted.
|
|
|
|
Long jobs return a job ID after about 15 seconds of polling. Hermes must poll
|
|
that ID until completion instead of starting the input again. Per-session
|
|
locking and input fingerprints prevent simultaneous/retried duplicate starts.
|
|
An unconfirmed POST is not automatically retried. Athena errors and replaced
|
|
remote jobs fail closed; no other user's result is adopted.
|
|
|
|
Two durable files, `Vocals.wav` and `Instrumental.wav`, are saved under
|
|
`$HERMES_HOME/audio-separation/<session-hash>/<job-id>/`. The result instructs
|
|
Hermes to put both native `MEDIA:<path>` lines in its final reply. These are
|
|
ordinary downloadable audio attachments, not a ZIP, voice message or temporary
|
|
Athena URL. Attachment rendering is the client's responsibility.
|
|
|
|
**Delivery limitation:** Hermes' upstream automatic media-repair allowlist only
|
|
contains its own TTS/image tools. This custom tool therefore relies on the model
|
|
including the two supplied MEDIA lines in its final response; it does not patch
|
|
that allowlist. Desktop/Conduit support the native media notation. The live
|
|
technical test below verifies generated files and the download policy, not an
|
|
actual user's Desktop/iOS rendering or LLM tool selection. Those remain a user
|
|
acceptance check. Do not claim a UI roundtrip was tested until it is observed.
|
|
|
|
Deck retains ownership of GPU arbitration. Existing requests finish before its
|
|
exclusive audio reservation; the plugin never kills GPU workers, changes the
|
|
operating mode, enables disabled profiles or downloads model weights. The next
|
|
chat request reloads its chat profile through the regular Deck path.
|
|
|
|
## Installed instance
|
|
|
|
Only `Hermes-Agent-Desktop` is changed:
|
|
|
|
- Host: `/mnt/nvme-storage/appdata/Hermes-Agent-Desktop/plugins/athena-audio`.
|
|
- Container: `/opt/data/plugins/athena-audio`, inside the existing persistent home.
|
|
- Private settings: `plugins.entries.athena-audio.settings.base_url` and `api_key`
|
|
in that instance's private `config.yaml`; no credentials in this repository.
|
|
- Base URL: `http://192.168.1.212:8108` (existing Deck management API).
|
|
- An existing Athena service credential was reused internally, without printing it.
|
|
- Official `hermes plugins doctor` passed; `hermes plugins enable athena-audio`
|
|
reloaded the gateway's plugins without container restart. Tools apply to new
|
|
sessions. Retained old Hermes/WebUI containers are unchanged.
|
|
|
|
## Install / update / restore
|
|
|
|
For any supported native Linux Hermes installation, place `plugin.yaml`,
|
|
`__init__.py` and `separator.py` in the **active profile's**
|
|
`$HERMES_HOME/plugins/athena-audio/`, owned by its service user. Requirements:
|
|
Hermes with native plugin support, Python 3.11+, FFmpeg/FFprobe, and network
|
|
access to an installed/enabled Athena separator profile. Only the Python
|
|
standard library is used by this plugin. Install FFmpeg on fresh Debian with
|
|
the system package manager; the current official desktop image already has it.
|
|
|
|
Use Hermes' native Plugins settings to set the Deck base URL and existing
|
|
service token privately, then run as the service user:
|
|
|
|
```sh
|
|
hermes plugins doctor "$HERMES_HOME/plugins/athena-audio"
|
|
hermes plugins enable athena-audio
|
|
```
|
|
|
|
Updates replace these plugin files, followed by the official plugin reload /
|
|
disable-enable workflow when no tool call is running. No image rebuild needed.
|
|
Remove with `hermes plugins disable athena-audio` before removing its directory;
|
|
result files remain independent of code removal.
|
|
|
|
Encrypted backups must cover the entire own Hermes home: plugin code, private
|
|
config/credentials, enabled toolset selection, uploaded originals and
|
|
`audio-separation/` results/records. Preserve service-user ownership on restore.
|
|
Git reproduces the public code and this recipe, not private credentials or user
|
|
audio. This integration does not establish a full fresh-host restore drill.
|
|
|
|
## Verification
|
|
|
|
- `python3 test_separator.py`: real local HTTP multipart upload plus two WAV
|
|
downloads against a synthetic API, FFmpeg conversion, retry idempotency,
|
|
cross-session rejection and remote-job replacement rejection passed.
|
|
- Official installed Hermes Plugin Doctor: discovery/manifest/import/registration
|
|
passed with one native tool and no hooks.
|
|
- Fresh native plugin manager found `athena_separate_audio` in its scoped registry.
|
|
- Real Athena run from the Hermes container: synthetic 3-second MP3 completed,
|
|
producing `Vocals.wav` (529244 bytes) and `Instrumental.wav` (529278 bytes).
|
|
Both passed WAV parsing and the native `/opt/data` managed-download policy.
|
|
- Athena reported zero active requests before the GPU test. No LLM test, Athena
|
|
restart, OpenCode restart or Hermes container restart was performed.
|
|
- This is a transport/functionality test with synthetic audio, **not** a music
|
|
separation quality assessment or client UI acceptance test.
|
|
|
|
Official interfaces:
|
|
- https://hermes-agent.nousresearch.com/docs/developer-guide/plugins
|
|
- https://github.com/NousResearch/hermes-agent/blob/main/hermes_cli/web_routers/files.py
|
|
- https://github.com/NousResearch/hermes-agent/blob/main/gateway/platforms/base.py
|