Spaces:
Paused
Paused
File size: 23,405 Bytes
90e0d20 1428d20 cf96b21 b9d12d1 90e0d20 b9d12d1 9277464 d6626e0 b9d12d1 9277464 0f02e7f b9d12d1 0f02e7f b9d12d1 9277464 b9d12d1 0f02e7f 37b2a5e 90e0d20 0f02e7f b9d12d1 9277464 b9d12d1 0f02e7f e04b24a 0f02e7f 158cba5 0f02e7f 43301b6 9277464 0f02e7f 0613ee9 9277464 0f02e7f e04b24a 0f02e7f e04b24a 9277464 43301b6 9277464 43301b6 9277464 e04b24a 158cba5 0f02e7f e04b24a 0f02e7f 08d8db1 7d3cdc1 08d8db1 0f02e7f 08d8db1 9277464 08d8db1 9277464 37b2a5e 08d8db1 9277464 08d8db1 9277464 08d8db1 0f02e7f 08d8db1 9277464 08d8db1 9277464 08d8db1 0f02e7f 08d8db1 9277464 08d8db1 9277464 b9d12d1 9277464 d6626e0 9277464 b9d12d1 0f02e7f b9d12d1 4226d57 b9d12d1 0f02e7f 728bb65 9277464 728bb65 9277464 728bb65 9277464 728bb65 43301b6 7d3cdc1 43301b6 9277464 728bb65 9277464 b9d12d1 9277464 b9d12d1 0f02e7f 9277464 37b2a5e 9277464 0f02e7f 43301b6 a06ec5d d6461a9 d6626e0 d6461a9 43301b6 0613ee9 d6461a9 d6626e0 d6461a9 37b2a5e d6461a9 37b2a5e d6461a9 37b2a5e d6461a9 0613ee9 617d143 0613ee9 617d143 0613ee9 a06ec5d 617d143 0613ee9 b9d12d1 0f02e7f b9d12d1 0f02e7f b9d12d1 0f02e7f b9d12d1 0f02e7f a06ec5d 9277464 0f02e7f b9d12d1 0f02e7f b9d12d1 9277464 b9d12d1 0f02e7f b9d12d1 0f02e7f b9d12d1 0f02e7f 6283613 0f02e7f b9d12d1 0f02e7f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | ---
title: HuggingMes
emoji: πͺ½
colorFrom: blue
colorTo: indigo
sdk: docker
app_port: 7861
pinned: true
license: mit
secrets:
- name: LLM_API_KEY
description: "Your LLM provider API key for direct providers such as OpenRouter, Anthropic, OpenAI, Google, DeepSeek, xAI, and others."
- name: MIMO_API_KEY
description: "Optional official MiMo API key. If set, the built-in MiMo proxy uses the official /v1 API instead of free compatibility mode."
- name: LLM_MODEL
description: "Model or provider model ID, such as openrouter/anthropic/claude-sonnet-4 or openai/gpt-4o."
- name: GATEWAY_TOKEN
description: "Strong token to secure your dashboard and API (generate: openssl rand -hex 32)."
- name: TELEGRAM_BOT_TOKEN
description: "Telegram bot token from @BotFather."
- name: TELEGRAM_ALLOWED_USERS
description: "Comma-separated list of numeric user IDs allowed to use the bot."
- name: HF_TOKEN
description: "Hugging Face token with write access. Used for automatic workspace backup and HF providers."
- name: CLOUDFLARE_WORKERS_TOKEN
description: "Cloudflare API token for automatic Worker proxy and KeepAlive setup."
- name: CLOUDFLARE_TUNNEL_TOKEN
description: "Optional Cloudflare Tunnel token for SSH access to the Space."
---
<!-- Badges -->
[](https://github.com/NousResearch/hermes-agent)
[](https://opensource.org/licenses/MIT)
[](https://huggingface.co/spaces)
[](https://github.com/NousResearch/hermes-agent)
**Self-hosted Hermes AI agent gateway for Hugging Face Spaces.** HuggingMes runs [Nous Research Hermes Agent](https://github.com/NousResearch/hermes-agent) on HuggingFace Spaces, giving you a 24/7 personal AI assistant with a management dashboard, persistent HF Dataset backup, and automatic connectivity fixes for blocked outbound traffic. HuggingMes directly wires the startup providers listed below, and it can also use Hermes providers configured through `hermes model` or `config.yaml`.
## Table of Contents
- [β¨ Features](#-features)
- [π₯ Video Tutorial](#-video-tutorial)
- [π Quick Start](#-quick-start)
- [π Access Control](#-access-control)
- [π€ LLM Providers](#-llm-providers)
- [π± Telegram Setup](#-telegram-setup)
- [π Cloudflare Proxy](#-cloudflare-proxy)
- [πΎ Backup & Persistence](#-backup--persistence)
- [π¦ Ephemeral Package Re-install](#-ephemeral-package-re-install-optional)
- [π API Key Rotation](#-api-key-rotation-optional)
- [π Staying Alive](#-staying-alive-recommended-on-free-hf-spaces)
- [π Security & Advanced](#-security--advanced)
- [π» Terminal Access (JupyterLab)](#-terminal-access-jupyterlab)
- [ποΈ Architecture](#-architecture)
- [π Troubleshooting](#-troubleshooting)
- [π More Projects](#-more-projects)
## β¨ Features
- π§ **Hermes Core:** Runs Hermes Agent for multi-turn chat, tools, memory, and agent workflows.
- π **Secure by Default:** Protects the dashboard and API with a single gateway token.
- π **Built-in Connectivity:** Adds Cloudflare Worker proxy support for Telegram and other blocked outbound traffic.
- π **Dashboard:** Real-time view of uptime, sync health, model, provider, and agent status at `/`.
- πΎ **Persistent Backup:** Syncs chats, config, and session data to a private HF Dataset.
- β° **Keep-Alive:** Can provision a cron-triggered Cloudflare Worker to keep the Space awake.
- π» **Terminal Out of the Box:** JupyterLab terminal at `/terminal/` auto-enabled when `GATEWAY_TOKEN` is set β no extra config needed.
- π **Self-Healing Gateway:** Gateway, dashboard, health server, and JupyterLab are all monitored and automatically restarted if they exit unexpectedly.
- π¦ **Ephemeral Package Replay:** Install packages from the terminal and they survive restarts β shell wrappers record `apt`/`pip`/`uv`/`npm`/`hermes` installs and replay them on every boot.
- π **Startup Scripts:** Run arbitrary bash at boot via `HUGGINGMES_RUN` or `HUGGINGMES_APT/PIP/NPM_PACKAGES` variables.
- π **API Key Pool Rotation:** Supply comma-separated key pools (e.g. `ANTHROPIC_API_KEYS=key1,key2`) and the first key is promoted automatically.
- π€ **Broad Provider Support:** Supports Hermes' native providers, direct API-key providers, OAuth providers, and custom OpenAI-compatible endpoints.
## π₯ Video Tutorial
Watch a quick walkthrough on YouTube: [Deploying HuggingMes on HF Spaces](https://www.youtube.com/watch?v=kagB1ID-NtE).
## π Quick Start
### Step 1: Duplicate this Space
[](https://huggingface.co/spaces/DLZZ021/HuggingMes?duplicate=true)
### Step 2: Add Your Secrets
In your Space's **Settings β Variables and secrets**, add these under **Secrets**:
- `LLM_API_KEY` - Your provider API key for direct providers.
- `LLM_MODEL` - The model ID to use, such as `openrouter/anthropic/claude-sonnet-4`, `openai/gpt-4o`, or `google/gemini-2.5-flash`.
- `GATEWAY_TOKEN` - A strong token to secure the dashboard.
- `TELEGRAM_BOT_TOKEN` - Telegram bot token from BotFather.
- `TELEGRAM_ALLOWED_USERS` - Comma-separated numeric Telegram user IDs.
- `HF_TOKEN` - Hugging Face token with write access for backups and HF providers.
- `CLOUDFLARE_WORKERS_TOKEN` - Cloudflare token for outbound proxying and keep-alive automation.
- `CLOUDFLARE_TUNNEL_TOKEN` - Cloudflare Tunnel token for SSH access.
### Step 3: Deploy & Run
After the Space builds, open it and click **Open Hermes UI** to access the agent interface.
## π Access Control
Hermes' built-in dashboard is wrapped by HuggingMes:
- **Dashboard:** Opening `/app/` requires `GATEWAY_TOKEN`.
- **API:** Routes under `/v1/*` require `Authorization: Bearer <GATEWAY_TOKEN>`.
## π€ LLM Providers
HuggingMes supports Hermes providers in two different ways:
- **Direct startup providers:** Set `LLM_API_KEY` and `LLM_MODEL`, and HuggingMes maps them during boot.
- **Hermes-native providers:** Use `hermes model` after the Space starts, or edit `config.yaml` through the Hermes UI.
- **Custom OpenAI-compatible endpoints:** Point Hermes at your own `/v1` endpoint.
### Direct startup providers
These are the providers that HuggingMes maps directly from `LLM_MODEL` and `LLM_API_KEY` at startup.
| Provider | Prefix | Example `LLM_MODEL` | Key env |
| :--- | :--- | :--- | :--- |
| OpenRouter | `openrouter/` | `openrouter/anthropic/claude-sonnet-4` | `LLM_API_KEY` -> `OPENROUTER_API_KEY` |
| Hugging Face Inference Providers | `huggingface/` or `hf/` | `huggingface/Qwen/Qwen3-235B-A22B-Thinking-2507` | `LLM_API_KEY` -> `HF_TOKEN` |
| AI Gateway / Vercel AI Gateway | `ai-gateway/` or `vercel-ai-gateway/` | `ai-gateway/openai/gpt-4o` | `LLM_API_KEY` -> `AI_GATEWAY_API_KEY` |
| Anthropic | `anthropic/` | `anthropic/claude-sonnet-4-6` | `LLM_API_KEY` -> `ANTHROPIC_API_KEY` |
| OpenAI / OpenAI Codex | `openai/` or `openai-codex/` | `openai/gpt-4o` | `LLM_API_KEY` -> `OPENAI_API_KEY` |
| Google Gemini | `google/` or `gemini/` | `google/gemini-2.5-flash` | `LLM_API_KEY` -> `GOOGLE_API_KEY` and `GEMINI_API_KEY` |
| DeepSeek | `deepseek/` | `deepseek/deepseek-chat` | `LLM_API_KEY` -> `DEEPSEEK_API_KEY` |
| Kimi / Moonshot | `kimi-coding/` or `moonshot/` | `kimi-coding/kimi-for-coding` | `LLM_API_KEY` -> `KIMI_API_KEY` |
| Kimi / Moonshot (China) | `kimi-coding-cn/` | `kimi-coding-cn/kimi-k2.5` | `LLM_API_KEY` -> `KIMI_CN_API_KEY` |
| Arcee AI | `arcee/` | `arcee/trinity-large-thinking` | `LLM_API_KEY` -> `ARCEEAI_API_KEY` |
| GMI Cloud | `gmi/` | `gmi/zai-org/GLM-5.1-FP8` | `LLM_API_KEY` -> `GMI_API_KEY` |
| MiniMax | `minimax/` | `minimax/MiniMax-M2.7` | `LLM_API_KEY` -> `MINIMAX_API_KEY` |
| MiniMax (China) | `minimax-cn/` | `minimax-cn/MiniMax-M2.7` | `LLM_API_KEY` -> `MINIMAX_CN_API_KEY` |
| Alibaba Cloud | `alibaba/` | `alibaba/qwen3.5-plus` | `LLM_API_KEY` -> `DASHSCOPE_API_KEY` |
| Alibaba Coding Plan | `alibaba-coding-plan/` | `alibaba-coding-plan/qwen3-coder-plus` | `LLM_API_KEY` -> `DASHSCOPE_API_KEY` |
| Xiaomi MiMo | `xiaomi/` | `xiaomi/mimo-v2-pro` | `LLM_API_KEY` -> `XIAOMI_API_KEY` |
| Tencent TokenHub | `tencent-tokenhub/` | `tencent-tokenhub/hy3-preview` | `LLM_API_KEY` -> `TOKENHUB_API_KEY` |
| Z.ai / GLM | `zai/`, `z-ai/`, `z.ai/`, or `glm/` | `zai/glm-5` | `LLM_API_KEY` -> `GLM_API_KEY` |
| NVIDIA NIM | `nvidia/` | `nvidia/nemotron-3-super-120b-a12b` | `LLM_API_KEY` -> `NVIDIA_API_KEY` |
| xAI / Grok | `xai/` or `grok/` | `xai/grok-4-1-fast-reasoning` | `LLM_API_KEY` -> `XAI_API_KEY` |
| Kilo Code | `kilocode/` | `kilocode/<model-id>` | `LLM_API_KEY` -> `KILOCODE_API_KEY` |
| OpenCode Zen | `opencode-zen/` | `opencode-zen/<model-id>` | `LLM_API_KEY` -> `OPENCODE_ZEN_API_KEY` |
| OpenCode Go | `opencode-go/` | `opencode-go/<model-id>` | `LLM_API_KEY` -> `OPENCODE_GO_API_KEY` |
| MiMo Proxy | `mimo/`, `mimo-proxy/`, or `xiaomi-mimo/` | `mimo/mimo-auto` or `mimo/mimo-v2.5-pro` | Built-in proxy; optional `LLM_API_KEY`/`MIMO_API_KEY` for official API mode |
### Hermes-native providers and OAuth flows
These providers are supported by Hermes and can be used in HuggingMes once the agent config is set through `hermes model` or `config.yaml`. HuggingMes does not auto-map them from `LLM_MODEL` at boot unless Hermes itself handles that provider.
| Provider | How to use | Notes |
| :--- | :--- | :--- |
| Nous Portal | `hermes model` | Subscription-based OAuth provider in Hermes |
| OpenAI Codex | `hermes model` | ChatGPT OAuth / Codex models |
| GitHub Copilot | `hermes model` | Uses `COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, or `gh auth token` |
| GitHub Copilot ACP | `hermes model` | Spawns the Copilot CLI backend |
| Anthropic (OAuth / Claude Code) | `hermes model` | Also supports `ANTHROPIC_API_KEY` |
| Google Gemini (OAuth) | `hermes model` | Browser OAuth flow, including free-tier Gemini OAuth |
| Qwen Portal (OAuth) | `hermes model` | Alibaba Qwen portal OAuth login |
| MiniMax (OAuth) | `hermes model` | Portal login for MiniMax models |
| Hugging Face Inference Providers | `hermes model` | Unified HF provider routing with model suffixes like `:fastest` and `:cheapest` |
| AWS Bedrock | `hermes model` or `config.yaml` | Uses AWS credentials chain, not an API key |
| Ollama Cloud | `hermes model` | Managed Ollama catalog with `OLLAMA_API_KEY` |
| Arcee AI | `hermes model` | First-class Hermes provider |
| GMI Cloud | `hermes model` | First-class Hermes provider |
| Alibaba Cloud / DashScope | `hermes model` | First-class Hermes provider for Qwen models |
| Tencent TokenHub | `hermes model` | First-class Hermes provider |
| Custom endpoint | `hermes model` or `config.yaml` | Any OpenAI-compatible endpoint |
### Custom and self-hosted endpoints
HuggingMes also works with any OpenAI-compatible server. Common examples include local Ollama, LM Studio, llama.cpp / llama-server, vLLM, SGLang, LocalAI, Jan, LiteLLM, ClawRouter, Together AI, Groq, Fireworks AI, Azure OpenAI, and similar services.
Use either the Hermes model wizard or a direct `config.yaml` entry with a `base_url`, `model`, and optional API key. For local servers that do not require auth, leave the key empty.
### Recommended provider choices
- **Just want it to work:** OpenRouter or Hermes' Nous Portal.
- **Want local models:** Ollama, LM Studio, llama.cpp, vLLM, or SGLang through a custom endpoint.
- **Need cloud APIs:** OpenAI, Anthropic, Google Gemini, DeepSeek, xAI, Hugging Face, or any other direct provider above.
- **Need routing or fallback:** Use a custom endpoint such as LiteLLM or ClawRouter.
## π± Telegram Setup
To use Hermes via Telegram:
1. Create a bot via [@BotFather](https://t.me/BotFather): send `/newbot`, follow the prompts, and copy the bot token.
2. Find your Telegram user ID with [@userinfobot](https://t.me/userinfobot) β send it any message and it replies with your numeric user ID.
3. Add `TELEGRAM_ALLOWED_USERS` as a comma-separated list of those numeric user IDs to restrict access.
4. Add `CLOUDFLARE_WORKERS_TOKEN` if you need automatic outbound proxying for Telegram API traffic.
## π Cloudflare Proxy
Hugging Face Spaces often block outbound calls to APIs used by Telegram and some provider backends. HuggingMes can provision a Cloudflare Worker proxy automatically when you add `CLOUDFLARE_WORKERS_TOKEN`.
## πΎ Backup & Persistence *(Optional)*
Set `HF_TOKEN` with write access to enable backup. HuggingMes syncs workspace data to a private HF Dataset named `huggingmes-backup` every 600 seconds by default.
| Variable | Default | Description |
| :--- | :--- | :--- |
| `HF_TOKEN` | β | HF token with **Write** access |
| `BACKUP_DATASET_NAME` | `huggingmes-backup` | Dataset name for backup |
| `SYNC_INTERVAL` | `600` | Backup frequency in seconds |
## π¦ Ephemeral Package Re-install *(Optional)*
Install packages in the terminal and they survive Space restarts β no extra config needed. Shell wrappers record every successful `apt install`, `pip install`, `uv pip install`, `npm install -g`, and `hermes plugins install` into `workspace/startup.sh`, which is backed up and replayed automatically on next boot.
For packages you want installed from day one (before the terminal is even opened), use the startup variables:
| Variable | What to put in it |
| :--- | :--- |
| `HUGGINGMES_RUN` | Full bash script to run on every startup (multi-line, heredocs, `if` blocks all work) |
| `HUGGINGMES_APT_PACKAGES` | Space- or comma-separated apt packages to install |
| `HUGGINGMES_PIP_PACKAGES` | Space- or comma-separated Python packages to install |
| `HUGGINGMES_NPM_PACKAGES` | Space- or comma-separated npm packages to install globally |
**Example:**
```bash
HUGGINGMES_RUN="""
pip install pandas matplotlib
npm install -g tsx
sudo apt-get install -y ffmpeg
"""
```
For scripts with complex quoting, base64-encode them:
```bash
# locally
base64 -w0 setup.sh
# HF Variable
HUGGINGMES_RUN=base64:<paste-output-here>
```
## π API Key Rotation *(Optional)*
Spread requests across multiple API keys to avoid rate limits. Supply a comma-separated pool β the first key is promoted to the provider's singular env var, and Hermes picks it up automatically.
```bash
ANTHROPIC_API_KEYS=sk-ant-key1,sk-ant-key2
OPENAI_API_KEYS=sk-oai-key1,sk-oai-key2
OPENROUTER_API_KEYS=sk-or-key1,sk-or-key2
```
Supported pool vars: `OPENROUTER_API_KEYS`, `ANTHROPIC_API_KEYS`, `OPENAI_API_KEYS`, `GOOGLE_API_KEYS`, `GEMINI_API_KEYS`, `DEEPSEEK_API_KEYS`, `KIMI_API_KEYS`, `MINIMAX_API_KEYS`, `NVIDIA_API_KEYS`, `XAI_API_KEYS`, `KILOCODE_API_KEYS`, `GLM_API_KEYS`, `ARCEEAI_API_KEYS`, `DASHSCOPE_API_KEYS`, `GMI_API_KEYS`, `TOKENHUB_API_KEYS`.
## π Staying Alive
With `CLOUDFLARE_WORKERS_TOKEN` set, HuggingMes can create a keep-alive worker that pings the Space's `/health` endpoint on a schedule so the free tier stays awake longer.
## π Security & Advanced *(Optional)*
| Variable | Default | Description |
| :--- | :--- | :--- |
| `GATEWAY_TOKEN` | β | Token for dashboard and API auth |
| `HF_TOKEN` | β | HF token with write access for backups and HF providers |
| `CLOUDFLARE_WORKERS_TOKEN` | β | Cloudflare API token for proxying and keep-awake |
| `CLOUDFLARE_TUNNEL_TOKEN` | *(empty)* | Cloudflare Tunnel token for SSH access |
| `CLOUDFLARE_TUNNEL_HOSTNAME` | *(empty)* | Optional display-only hostname, such as `ssh.example.com` |
| `CLOUDFLARE_TUNNEL_ENABLED` | `auto` | Set `false` to disable the tunnel connector even when a token exists |
| `CLOUDFLARE_TUNNEL_PROTOCOL` | `http2` | Tunnel transport protocol; use `quic` only if your runtime/network supports it |
| `SYNC_INTERVAL` | `600` | Backup frequency in seconds |
| `CLOUDFLARE_KEEPALIVE_ENABLED` | `true` | Set `false` to disable keep-awake worker |
| `TELEGRAM_MODE` | `webhook` | `webhook` or `polling` (webhook auto-configured from `SPACE_HOST`) |
| `DEV_MODE` | `true` | Set `false` to disable JupyterLab terminal at `/terminal/` |
| `JUPYTER_TOKEN` | *(uses `GATEWAY_TOKEN`)* | Override terminal password (optional) |
| `SSH_PUBLIC_KEY` | β | Enables root SSH with this public key in `/root/.ssh/authorized_keys` |
| `SSH_PORT` | `2222` | Internal SSH port |
| `SSH_BIND_HOST` | `127.0.0.1` | Internal SSH bind address; keep localhost for tunnels |
| `SSH_ENABLED` | `auto` | Set `false` to disable SSH even when `SSH_PUBLIC_KEY` is present |
| `MIMO_PROXY_ENABLED` | `auto` | Starts the built-in MiMo OpenAI-compatible proxy when enabled or selected by `LLM_MODEL` |
| `MIMO_PROXY_AS_PROVIDER` | `false` | Set `true` to use the MiMo proxy as Hermes' default provider |
| `MIMO_PROXY_MODE` | `auto` | `auto`, `free`, or `api`; `auto` uses official API mode when `MIMO_API_KEY` is present |
| `MIMO_API_KEY` | *(empty)* | Optional official MiMo API key for proxy `api` mode; `tp-*` keys automatically use token-plan base URL |
| `MIMO_UPSTREAM_MODEL` | `mimo-v2.5-pro` in api mode | Official MiMo model used when Hermes requests `mimo-auto` |
| `MIMO_PROXY_PORT` | `9100` | Internal MiMo proxy port |
| `MIMO_PROXY_KEY` | *(generated)* | API key accepted by the local MiMo proxy |
| `WEBHOOK_URL` | β | Endpoint for POST JSON restart notifications |
| `GATEWAY_RESTART_DELAY` | `5` | Seconds between gateway restart attempts |
| `GATEWAY_MAX_RESTARTS` | `0` (unlimited) | Maximum gateway restart count before container exits |
## MiMo Proxy Provider (Optional)
Set `LLM_MODEL=mimo/mimo-auto` to start the built-in MiMo OpenAI-compatible proxy and wire Hermes to it automatically. HuggingMes runs the proxy as a regular background process, writes logs to `/opt/data/logs/mimo-proxy.log`, and restarts it if it exits.
The proxy has two upstream modes:
- `MIMO_PROXY_MODE=auto` (default): uses official API mode when `MIMO_API_KEY` or `LLM_API_KEY` is set; otherwise uses MiMo free compatibility mode.
- `MIMO_PROXY_MODE=api`: uses `https://api.xiaomimimo.com/v1` with `MIMO_API_KEY` or `LLM_API_KEY`. `tp-*` keys use `https://token-plan-cn.xiaomimimo.com/v1`.
- `MIMO_PROXY_MODE=free`: uses the mimocode free endpoint and adds the mimocode-compatible request fields required by that gateway.
For the most stable setup, set `LLM_MODEL=mimo/mimo-v2.5-pro` and provide `LLM_API_KEY` or `MIMO_API_KEY`. For a no-key setup, keep `LLM_MODEL=mimo/mimo-auto`.
To run the proxy without switching Hermes' default model, set `MIMO_PROXY_ENABLED=true`. To force Hermes to use it regardless of `LLM_MODEL`, set `MIMO_PROXY_AS_PROVIDER=true`.
Test inside the Space with:
```bash
curl -fsS http://127.0.0.1:9100/health -H "Authorization: Bearer $MIMO_PROXY_KEY"
tail -80 /opt/data/logs/mimo-proxy.log
```
## SSH Access (Optional)
Set `SSH_PUBLIC_KEY` to your local public key, such as the contents of `~/.ssh/id_ed25519.pub`. On startup HuggingMes runs `sshd` for root on `127.0.0.1:2222`, with password login disabled.
HF Spaces do not expose arbitrary TCP ports directly. For external access, use a Cloudflare Tunnel public hostname that points to this local SSH service.
Cloudflare Zero Trust setup:
1. Go to `Zero Trust > Networks > Tunnels`, create a Cloudflared tunnel, and copy the tunnel token.
2. Add a Public Hostname such as `ssh.example.com`.
3. Set the service type to `SSH`.
4. Set the service URL to `ssh://127.0.0.1:2222`.
5. Add `CLOUDFLARE_TUNNEL_TOKEN` to the Space secrets. Optionally add `CLOUDFLARE_TUNNEL_HOSTNAME=ssh.example.com` for clearer logs.
Test inside the Space with:
```bash
sudo ss -ltnp | grep 2222
tail -80 /opt/data/logs/sshd.log
tail -80 /opt/data/logs/cloudflared.log
```
Local SSH client setup:
```sshconfig
Host huggingmes
HostName ssh.example.com
User root
IdentityFile ~/.ssh/id_ed25519
ProxyCommand cloudflared access ssh --hostname %h
```
Connect with:
```bash
ssh huggingmes
```
## π» Terminal Access (JupyterLab)
HuggingMes includes a JupyterLab terminal at `/terminal/` for direct shell access to the container β useful for running `hermes` commands, inspecting files, installing packages, and debugging. Enabled by default when `GATEWAY_TOKEN` is set.
### Setup
The terminal is **on by default** β no extra configuration needed. Click **Open Terminal β** on the dashboard, then log in with your `GATEWAY_TOKEN`.
To disable it, set `DEV_MODE=false`. To use a separate terminal password, set `JUPYTER_TOKEN` to a different value.
> **Security:** JupyterLab grants full shell access to the container. The terminal will not start if no `GATEWAY_TOKEN` is set.
### What you can do
- Run `hermes` CLI commands directly
- Browse and edit files in the workspace
- Install Python packages with `pip` or `uv pip`
- Check logs, inspect config, debug issues
## π» Local Development
```bash
docker compose up --build
# Dashboard: http://localhost:7861
# Hermes App: http://localhost:7861/app/
```
## ποΈ Architecture
- **Dashboard (`/`)**: Real-time management and monitoring.
- **Hermes App (`/app/`)**: Secure proxied access to the Hermes UI.
- **API (`/v1/*`)**: Proxied OpenAI-compatible agent API.
- **Terminal (`/terminal/`)**: JupyterLab terminal (auto-enabled when `GATEWAY_TOKEN` is set; set `DEV_MODE=false` to disable).
- **Health Check (`/health`)**: Readiness probe for HF and keep-alive.
- **Sync Engine**: Python background task for HF Dataset persistence.
## π Troubleshooting
- **Telegram bot not responding:** Ensure `CLOUDFLARE_WORKERS_TOKEN` is set and check logs for the proxy setup step.
- **Authentication failed:** Clear browser cookies or use an incognito window if `GATEWAY_TOKEN` changed.
- **Data not persisting:** Ensure `HF_TOKEN` has write access.
- **Provider not showing up:** If it is a Hermes-native provider, run `hermes model` and complete the provider-specific setup there. If it is a custom endpoint, verify the `base_url` exposes `/v1/models` or `/v1/chat/completions`.
- **Space keeps sleeping:** Add `CLOUDFLARE_WORKERS_TOKEN` to enable automatic keep-awake monitoring.
## π More Projects
Similar projects by [@somratpro](https://github.com/somratpro) β all free, one-click deploy on HF Spaces:
| Project | What it runs | HF Space | GitHub |
| :--- | :--- | :--- | :--- |
| **HuggingFlow** | DeerFlow β deep research agent | [Space](https://huggingface.co/spaces/somratpro/HuggingFlow) | [Repo](https://github.com/somratpro/HuggingFlow) |
| **Hugging8n** | n8n β workflow & automation platform | [Space](https://huggingface.co/spaces/somratpro/Hugging8n) | [Repo](https://github.com/somratpro/hugging8n) |
| **HuggingClaw** | OpenClaw β Claude Code in the browser | [Space](https://huggingface.co/spaces/somratpro/HuggingClaw) | [Repo](https://github.com/somratpro/huggingclaw) |
| **HuggingClip** | Paperclip β AI agent orchestration platform | [Space](https://huggingface.co/spaces/somratpro/HuggingClip) | [Repo](https://github.com/somratpro/huggingclip) |
| **HuggingPost** | Postiz β social-media scheduler | [Space](https://huggingface.co/spaces/somratpro/HuggingPost) | [Repo](https://github.com/somratpro/huggingpost) |
---
*Made with β€οΈ by [@somratpro](https://github.com/somratpro)*
|