diff --git a/website/docs/reference/environment-variables.md b/website/docs/reference/environment-variables.md index 7c14d9f3da4..0d5823bf6c9 100644 --- a/website/docs/reference/environment-variables.md +++ b/website/docs/reference/environment-variables.md @@ -261,6 +261,7 @@ For cloud sandbox backends, persistence is filesystem-oriented. `TERMINAL_LIFETI | `API_SERVER_CORS_ORIGINS` | Comma-separated browser origins allowed to call the API server directly (for example `http://localhost:3000,http://127.0.0.1:3000`). Default: disabled. | | `API_SERVER_PORT` | Port for the API server (default: `8642`) | | `API_SERVER_HOST` | Host/bind address for the API server (default: `127.0.0.1`). Use `0.0.0.0` for network access only with `API_SERVER_KEY` and a narrow `API_SERVER_CORS_ORIGINS` allowlist. | +| `API_SERVER_MODEL_NAME` | Model name advertised on `/v1/models`. Defaults to the profile name (or `hermes-agent` for the default profile). Useful for multi-user setups where frontends like Open WebUI need distinct model names per connection. | | `MESSAGING_CWD` | Working directory for terminal commands in messaging mode (default: `~`) | | `GATEWAY_ALLOWED_USERS` | Comma-separated user IDs allowed across all platforms | | `GATEWAY_ALLOW_ALL_USERS` | Allow all users without allowlists (`true`/`false`, default: `false`) | diff --git a/website/docs/user-guide/features/api-server.md b/website/docs/user-guide/features/api-server.md index 71732285e75..58ae201fae4 100644 --- a/website/docs/user-guide/features/api-server.md +++ b/website/docs/user-guide/features/api-server.md @@ -152,7 +152,7 @@ Delete a stored response. ### GET /v1/models -Lists `hermes-agent` as an available model. Required by most frontends for model discovery. +Lists the agent as an available model. The advertised model name defaults to the [profile](/docs/user-guide/features/profiles) name (or `hermes-agent` for the default profile). Required by most frontends for model discovery. ### GET /health @@ -193,6 +193,7 @@ The default bind address (`127.0.0.1`) is for local-only use. Browser access is | `API_SERVER_HOST` | `127.0.0.1` | Bind address (localhost only by default) | | `API_SERVER_KEY` | _(none)_ | Bearer token for auth | | `API_SERVER_CORS_ORIGINS` | _(none)_ | Comma-separated allowed browser origins | +| `API_SERVER_MODEL_NAME` | _(profile name)_ | Model name on `/v1/models`. Defaults to profile name, or `hermes-agent` for default profile. | ### config.yaml @@ -242,6 +243,36 @@ Any frontend that supports the OpenAI API format works. Tested/documented integr | OpenAI Python SDK | — | `OpenAI(base_url="http://localhost:8642/v1")` | | curl | — | Direct HTTP requests | +## Multi-User Setup with Profiles + +To give multiple users their own isolated Hermes instance (separate config, memory, skills), use [profiles](/docs/user-guide/features/profiles): + +```bash +# Create a profile per user +hermes profile create alice +hermes profile create bob + +# Configure each profile's API server on a different port +hermes -p alice config set API_SERVER_ENABLED true +hermes -p alice config set API_SERVER_PORT 8643 +hermes -p alice config set API_SERVER_KEY alice-secret + +hermes -p bob config set API_SERVER_ENABLED true +hermes -p bob config set API_SERVER_PORT 8644 +hermes -p bob config set API_SERVER_KEY bob-secret + +# Start each profile's gateway +hermes -p alice gateway & +hermes -p bob gateway & +``` + +Each profile's API server automatically advertises the profile name as the model ID: + +- `http://localhost:8643/v1/models` → model `alice` +- `http://localhost:8644/v1/models` → model `bob` + +In Open WebUI, add each as a separate connection. The model dropdown shows `alice` and `bob` as distinct models, each backed by a fully isolated Hermes instance. See the [Open WebUI guide](/docs/user-guide/messaging/open-webui#multi-user-setup-with-profiles) for details. + ## Limitations - **Response storage** — stored responses (for `previous_response_id`) are persisted in SQLite and survive gateway restarts. Max 100 stored responses (LRU eviction). diff --git a/website/docs/user-guide/messaging/open-webui.md b/website/docs/user-guide/messaging/open-webui.md index 7d4eaee3615..71860d367fa 100644 --- a/website/docs/user-guide/messaging/open-webui.md +++ b/website/docs/user-guide/messaging/open-webui.md @@ -60,7 +60,7 @@ docker run -d -p 3000:8080 \ ### 4. Open the UI -Go to **http://localhost:3000**. Create your admin account (the first user becomes admin). You should see **hermes-agent** in the model dropdown. Start chatting! +Go to **http://localhost:3000**. Create your admin account (the first user becomes admin). You should see your agent in the model dropdown (named after your profile, or **hermes-agent** for the default profile). Start chatting! ## Docker Compose Setup @@ -106,7 +106,7 @@ If you prefer to configure the connection through the UI instead of environment 7. Click the **checkmark** to verify the connection 8. **Save** -The **hermes-agent** model should now appear in the model dropdown. +Your agent model should now appear in the model dropdown (named after your profile, or **hermes-agent** for the default profile). :::warning Environment variables only take effect on Open WebUI's **first launch**. After that, connection settings are stored in its internal database. To change them later, use the Admin UI or delete the Docker volume and start fresh. @@ -196,6 +196,49 @@ Hermes Agent may be executing multiple tool calls (reading files, running comman Make sure your `OPENAI_API_KEY` in Open WebUI matches the `API_SERVER_KEY` in Hermes Agent. +## Multi-User Setup with Profiles + +To run separate Hermes instances per user — each with their own config, memory, and skills — use [profiles](/docs/user-guide/features/profiles). Each profile runs its own API server on a different port and automatically advertises the profile name as the model in Open WebUI. + +### 1. Create profiles and configure API servers + +```bash +hermes profile create alice +hermes -p alice config set API_SERVER_ENABLED true +hermes -p alice config set API_SERVER_PORT 8643 +hermes -p alice config set API_SERVER_KEY alice-secret + +hermes profile create bob +hermes -p bob config set API_SERVER_ENABLED true +hermes -p bob config set API_SERVER_PORT 8644 +hermes -p bob config set API_SERVER_KEY bob-secret +``` + +### 2. Start each gateway + +```bash +hermes -p alice gateway & +hermes -p bob gateway & +``` + +### 3. Add connections in Open WebUI + +In **Admin Settings** → **Connections** → **OpenAI API** → **Manage**, add one connection per profile: + +| Connection | URL | API Key | +|-----------|-----|---------| +| Alice | `http://host.docker.internal:8643/v1` | `alice-secret` | +| Bob | `http://host.docker.internal:8644/v1` | `bob-secret` | + +The model dropdown will show `alice` and `bob` as distinct models. You can assign models to Open WebUI users via the admin panel, giving each user their own isolated Hermes agent. + +:::tip Custom Model Names +The model name defaults to the profile name. To override it, set `API_SERVER_MODEL_NAME` in the profile's `.env`: +```bash +hermes -p alice config set API_SERVER_MODEL_NAME "Alice's Agent" +``` +::: + ## Linux Docker (no Docker Desktop) On Linux without Docker Desktop, `host.docker.internal` doesn't resolve by default. Options: