CoolFace
Apppublic

ical-owens/HERMES

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes
App README

<!-- Badges --> ![GitHub Stars](https://github.com/NousResearch/hermes-agent) ![License: MIT](https://opensource.org/licenses/MIT) ![HF Space](https://huggingface.co/spaces) ![Hermes](https://github.com/NousResearch/hermes-agent)

Self-hosted Hermes AI agent gateway for Hugging Face Spaces. HuggingMes runs Nous Research 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

  • โ€”๐Ÿง  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, 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.
  • โ€”๐Ÿค– 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.

๐Ÿš€ Quick Start

Step 1: Duplicate this Space

![Duplicate this Space](https://huggingface.co/spaces/somratpro/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.

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.

ProviderPrefixExample `LLM_MODEL`Key env
OpenRouteropenrouter/openrouter/anthropic/claude-sonnet-4LLM_API_KEY -> OPENROUTER_API_KEY
Hugging Face Inference Providershuggingface/ or hf/huggingface/Qwen/Qwen3-235B-A22B-Thinking-2507LLM_API_KEY -> HF_TOKEN
AI Gateway / Vercel AI Gatewayai-gateway/ or vercel-ai-gateway/ai-gateway/openai/gpt-4oLLM_API_KEY -> AI_GATEWAY_API_KEY
Anthropicanthropic/anthropic/claude-sonnet-4-6LLM_API_KEY -> ANTHROPIC_API_KEY
OpenAI / OpenAI Codexopenai/ or openai-codex/openai/gpt-4oLLM_API_KEY -> OPENAI_API_KEY
Google Geminigoogle/ or gemini/google/gemini-2.5-flashLLM_API_KEY -> GOOGLE_API_KEY and GEMINI_API_KEY
DeepSeekdeepseek/deepseek/deepseek-chatLLM_API_KEY -> DEEPSEEK_API_KEY
Kimi / Moonshotkimi-coding/ or moonshot/kimi-coding/kimi-for-codingLLM_API_KEY -> KIMI_API_KEY
Kimi / Moonshot (China)kimi-coding-cn/kimi-coding-cn/kimi-k2.5LLM_API_KEY -> KIMI_CN_API_KEY
Arcee AIarcee/arcee/trinity-large-thinkingLLM_API_KEY -> ARCEEAI_API_KEY
GMI Cloudgmi/gmi/zai-org/GLM-5.1-FP8LLM_API_KEY -> GMI_API_KEY
MiniMaxminimax/minimax/MiniMax-M2.7LLM_API_KEY -> MINIMAX_API_KEY
MiniMax (China)minimax-cn/minimax-cn/MiniMax-M2.7LLM_API_KEY -> MINIMAX_CN_API_KEY
Alibaba Cloudalibaba/alibaba/qwen3.5-plusLLM_API_KEY -> DASHSCOPE_API_KEY
Alibaba Coding Planalibaba-coding-plan/alibaba-coding-plan/qwen3-coder-plusLLM_API_KEY -> DASHSCOPE_API_KEY
Xiaomi MiMoxiaomi/xiaomi/mimo-v2-proLLM_API_KEY -> XIAOMI_API_KEY
Tencent TokenHubtencent-tokenhub/tencent-tokenhub/hy3-previewLLM_API_KEY -> TOKENHUB_API_KEY
Z.ai / GLMzai/, z-ai/, z.ai/, or glm/zai/glm-5LLM_API_KEY -> GLM_API_KEY
NVIDIA NIMnvidia/nvidia/nemotron-3-super-120b-a12bLLM_API_KEY -> NVIDIA_API_KEY
xAI / Grokxai/ or grok/xai/grok-4-1-fast-reasoningLLM_API_KEY -> XAI_API_KEY
Kilo Codekilocode/kilocode/<model-id>LLM_API_KEY -> KILOCODE_API_KEY
OpenCode Zenopencode-zen/opencode-zen/<model-id>LLM_API_KEY -> OPENCODE_ZEN_API_KEY
OpenCode Goopencode-go/opencode-go/<model-id>LLM_API_KEY -> OPENCODE_GO_API_KEY

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.

ProviderHow to useNotes
Nous Portalhermes modelSubscription-based OAuth provider in Hermes
OpenAI Codexhermes modelChatGPT OAuth / Codex models
GitHub Copilothermes modelUses COPILOT_GITHUB_TOKEN, GH_TOKEN, or gh auth token
GitHub Copilot ACPhermes modelSpawns the Copilot CLI backend
Anthropic (OAuth / Claude Code)hermes modelAlso supports ANTHROPIC_API_KEY
Google Gemini (OAuth)hermes modelBrowser OAuth flow, including free-tier Gemini OAuth
Qwen Portal (OAuth)hermes modelAlibaba Qwen portal OAuth login
MiniMax (OAuth)hermes modelPortal login for MiniMax models
Hugging Face Inference Providershermes modelUnified HF provider routing with model suffixes like :fastest and :cheapest
AWS Bedrockhermes model or config.yamlUses AWS credentials chain, not an API key
Ollama Cloudhermes modelManaged Ollama catalog with OLLAMA_API_KEY
Arcee AIhermes modelFirst-class Hermes provider
GMI Cloudhermes modelFirst-class Hermes provider
Alibaba Cloud / DashScopehermes modelFirst-class Hermes provider for Qwen models
Tencent TokenHubhermes modelFirst-class Hermes provider
Custom endpointhermes model or config.yamlAny 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. 1.Create a bot via @BotFather: send /newbot, follow the prompts, and copy the bot token.
  2. 2.Find your Telegram user ID with @userinfobot โ€” send it any message and it replies with your numeric user ID.
  3. 3.Add TELEGRAM_ALLOWED_USERS as a comma-separated list of those numeric user IDs to restrict access.
  4. 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.

๐Ÿ’“ 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)

VariableDefaultDescription
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
SYNC_INTERVAL600Backup frequency in seconds
CLOUDFLARE_KEEPALIVE_ENABLEDtrueSet false to disable keep-awake worker
TELEGRAM_MODEwebhookwebhook or polling

๐Ÿ’ป 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.
  • โ€”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 โ€” all free, one-click deploy on HF Spaces:

ProjectWhat it runsHF SpaceGitHub
HuggingFlowDeerFlow โ€” deep research agentSpaceRepo
Hugging8nn8n โ€” workflow & automation platformSpaceRepo
HuggingClawOpenClaw โ€” Claude Code in the browserSpaceRepo
HuggingClipPaperclip โ€” AI agent orchestration platformSpaceRepo
HuggingPostPostiz โ€” social-media schedulerSpaceRepo

Made with โค๏ธ by [@somratpro](https://github.com/somratpro)