SaKoRy/HermesFace
0
1# ═══════════════════════════════════════════════════════════════════════════2# HermesFace — Environment Configuration3# Deploy Hermes Agent on HuggingFace Spaces4# ═══════════════════════════════════════════════════════════════════════════5#6# Usage:7# Local Docker → cp .env.example .env → fill in values → docker run --env-file .env8# HF Spaces → Set each variable as a "Repository Secret" in Space Settings9#10# Legend:11# [REQUIRED] Must be set, or data persistence will not work12# [RECOMMENDED] Strongly recommended for production use13# [OPTIONAL] Fine-tune behavior; safe to leave empty14#15# ═══════════════════════════════════════════════════════════════════════════16 17 18# ─── DATA PERSISTENCE ────────────────────────────────────────────────────19#20# HermesFace auto-syncs the /opt/data directory to a private HF Dataset21# repo, so your conversations, skills, memories, and config survive restarts.22# Without these variables, all data is lost when the Space restarts.23#24# HuggingFace Access Token with WRITE permission.25# Create one at: https://huggingface.co/settings/tokens26# Scopes needed: read + write access to your repos.27#28# [REQUIRED]29#30HF_TOKEN=hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx31 32# Target Dataset repository for data backup.33# Format: your-username/repo-name34# Example: your-name/HermesFace-data35#36# Manual mode (default): create the repo yourself, then set this variable.37# Auto mode (AUTO_CREATE_DATASET=true): if not set, HermesFace derives38# it from your SPACE_ID → "your-username/HermesFace-data".39#40# [OPTIONAL in auto mode]41#42# HERMES_DATASET_REPO=your-username/HermesFace-data43 44# Whether to auto-create the Dataset repo if it doesn't exist.45# When true: HermesFace creates a PRIVATE dataset repo on first startup.46#47# [OPTIONAL] Default: true48#49AUTO_CREATE_DATASET=true50 51# How often (in seconds) to back up data to the Dataset repo.52# Lower values = safer but more API calls to HuggingFace.53#54# [OPTIONAL] Default: 6055#56# SYNC_INTERVAL=6057 58 59# ─── LLM PROVIDERS ────────────────────────────────────────────────────────60#61# HermesFace passes ALL environment variables directly to Hermes Agent.62# Any provider that Hermes supports works out of the box — just set the63# API key as a Secret in your HF Space settings.64#65# [RECOMMENDED] At least one of the following for AI conversations66#67# OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx68# OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx69# ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx70# NOUS_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx71# GOOGLE_API_KEY=AIza...72# MISTRAL_API_KEY=mis-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx73 74 75# ─── MESSAGING PLATFORMS ─────────────────────────────────────────────────76#77# Hermes Agent supports 16+ messaging platforms natively.78# Configure via environment variables.79#80# TELEGRAM_BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew1181# DISCORD_BOT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx82# SLACK_BOT_TOKEN=xoxb-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx83 84 85# ─── PERFORMANCE ──────────────────────────────────────────────────────────86#87# Timezone for log timestamps and scheduled tasks.88#89# [OPTIONAL] Default: UTC90#91# TZ=Asia/Shanghai92 93 94# ─── HERMES AGENT CONFIG ─────────────────────────────────────────────────95#96# Agent name displayed in messaging platforms.97#98# [OPTIONAL] Default: HermesFace99#100# AGENT_NAME=HermesFace101 102 103# ═══════════════════════════════════════════════════════════════════════════104# Hermes Agent 官方环境变量105# ═══════════════════════════════════════════════════════════════════════════106#107# HermesFace 启动 Hermes Agent 时透传整个环境(env=os.environ.copy()),108# 因此 Hermes Agent 官方文档中列出的 **所有** 环境变量在 HF Spaces / Docker 中109# 设置后均可直接生效。110#111# 常见类别(仅列举部分):112# API Keys: OPENROUTER_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY,113# NOUS_API_KEY, GOOGLE_API_KEY, MISTRAL_API_KEY114# Messaging: TELEGRAM_BOT_TOKEN, DISCORD_BOT_TOKEN, SLACK_BOT_TOKEN115# Terminal: TERMINAL_BACKEND, TERMINAL_TIMEOUT116# Browser: BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID117#118# ═══════════════════════════════════════════════════════════════════════════119#120# ═══════════════════════════════════════════════════════════════════════════121# HermesFace 新增变量一览(仅本仓库脚本使用)122# ═══════════════════════════════════════════════════════════════════════════123#124# ─── 持久化 (HuggingFace Dataset) ───────────────────────────────────────125# HF_TOKEN [必填] HF 访问令牌,需具备写入权限126# HERMES_DATASET_REPO [可选] 备份用 Dataset 仓库,如 your-name/HermesFace-data127# AUTO_CREATE_DATASET [可选] 是否自动创建仓库,默认 true128# SYNC_INTERVAL [可选] 备份间隔(秒),默认 60129# HF_HUB_DOWNLOAD_TIMEOUT [可选] 下载超时(秒),默认 300130# HF_HUB_UPLOAD_TIMEOUT [可选] 上传超时(秒),默认 600131#132# ─── LLM / 对话 API(至少配置其一以启用 AI 对话)────────────────────────133# 所有 Hermes Agent 支持的 API Key 环境变量均可直接使用,无需额外配置。134#135# ─── 消息渠道 ─────────────────────────────────────────────────────────136# Telegram、Discord、Slack、WhatsApp、Signal 等消息渠道均可通过环境变量配置。137#138# ─── HuggingFace Spaces 运行时(HF 自动注入,一般无需手动设)────────────139# SPACE_HOST 当前 Space 域名,如 xxx.hf.space140# SPACE_ID 仓库 ID,如 username/HermesFace141#142# ─── 运行配置 ───────────────────────────────────────────────────────143# AGENT_NAME [可选] Agent 名称,默认 HermesFace144# TZ [可选] 时区,如 Asia/Shanghai145#146# ═══════════════════════════════════════════════════════════════════════════147 