hermes-agent/gateway/platforms
teknium1 3273678ff9 feat: OpenAI-compatible HTTP server platform adapter
Salvaged from PR #956 (teknium1) onto current main.

Adds an OpenAI-compatible HTTP server as a new gateway platform
adapter. Any frontend that speaks the OpenAI format — Open WebUI,
LobeChat, LibreChat, AnythingLLM, NextChat, ChatBox, etc. — can
connect to hermes-agent by pointing at http://localhost:8642/v1.

Endpoints:
- POST /v1/chat/completions — stateless chat (full conversation per request)
- POST /v1/responses — stateful via previous_response_id or named conversations
- GET/DELETE /v1/responses/{id} — retrieve/delete stored responses
- GET /v1/models — model discovery
- GET /health — health check

Key features:
- Real SSE streaming via stream_delta_callback
- Responses API with server-side conversation state (in-memory LRU, max 100)
- Named conversations via 'conversation' parameter
- System prompt layering (frontend prompts add to core agent prompt)
- Bearer token auth (optional, via HTTP_SERVER_KEY)
- CORS support for browser-based frontends
- Binds to 127.0.0.1 by default (secure)
- Uses aiohttp (existing dependency, no new deps)

Files:
- gateway/platforms/http_server.py — adapter implementation
- gateway/config.py — Platform.HTTP_SERVER enum + env var overrides
- gateway/run.py — adapter factory branch
- toolsets.py — hermes-http_server toolset
- hermes_cli/config.py — setup env vars
- .env.example — HTTP server env vars
- tests/gateway/test_http_server.py — 72 tests
- website/docs/ — HTTP server guide, Open WebUI integration guide

Closes #956
2026-03-17 05:21:22 -07:00
..
__init__.py Enhance CLI with multi-platform messaging integration and configuration management 2026-02-02 19:01:51 -08:00
ADDING_A_PLATFORM.md docs: finish cron terminology cleanup 2026-03-14 19:20:58 -07:00
base.py feat(gateway): inject reply-to message context for out-of-session replies (#1594) 2026-03-17 02:31:27 -07:00
dingtalk.py fix(dingtalk): requirements check passes with only one credential set 2026-03-17 03:50:45 -07:00
discord.py Merge pull request #1661 from NousResearch/fix/discord-thread-persistence 2026-03-17 02:27:09 -07:00
email.py fix: email send_typing metadata + ☤ Hermes staff symbol (#1431, #1420) 2026-03-17 02:37:40 -07:00
homeassistant.py fix: Home Assistant event filtering now closed by default (#1169) 2026-03-13 07:40:38 -07:00
http_server.py feat: OpenAI-compatible HTTP server platform adapter 2026-03-17 05:21:22 -07:00
matrix.py fix(gateway): SMS persistent HTTP session + Matrix MIME media types 2026-03-17 04:35:14 -07:00
mattermost.py fix(gateway): Matrix and Mattermost never report as connected 2026-03-17 04:01:02 -07:00
signal.py fix(signal): align send() signature with base class (content, reply_to, metadata) 2026-03-10 15:18:26 -07:00
slack.py refactor: centralize slash command registry (#1603) 2026-03-16 23:21:03 -07:00
sms.py fix(gateway): SMS persistent HTTP session + Matrix MIME media types 2026-03-17 04:35:14 -07:00
telegram.py fix(telegram): aggregate split text messages before dispatching (#1674) 2026-03-17 02:49:57 -07:00
whatsapp.py fix(cli): respect HERMES_HOME in all remaining hardcoded ~/.hermes paths 2026-03-13 21:32:53 -07:00