Spaces:
Paused
Paused
Allow startup without model secrets
Browse files10 unmodified lines1112131415161719 unmodified lines3738394041424310 unmodified lines- name: LLM_API_KEYdescription: "Your LLM provider API key. HuggingMess maps it to the right Hermes provider env var."- name: LLM_MODELdescription: "Model ID, e.g. openrouter/anthropic/claude-sonnet-4 or anthropic/claude-opus-4.6."- name: TELEGRAM_BOT_TOKENdescription: "Telegram bot token from @BotFather."- name: TELEGRAM_ALLOWED_USERS19 unmodified lines| Secret | Required | Notes || :--- | :--- | :--- || `LLM_MODEL` | Yes | Examples: `openrouter/anthropic/claude-sonnet-4`, `anthropic/claude-opus-4.6`, `google/gemini-2.5-flash` || `LLM_API_KEY` | Usually | Used to populate the provider-specific env var automatically || `TELEGRAM_BOT_TOKEN` | For Telegram | Bot token from BotFather || `TELEGRAM_ALLOWED_USERS` | Recommended | Comma-separated numeric Telegram user IDs |10 unmodified lines1112131415161719 unmodified lines3738394041424310 unmodified lines- name: LLM_API_KEYdescription: "Your LLM provider API key. HuggingMess maps it to the right Hermes provider env var."- name: LLM_MODELdescription: "Optional model ID override, e.g. openrouter/anthropic/claude-sonnet-4 or anthropic/claude-opus-4.6."- name: TELEGRAM_BOT_TOKENdescription: "Telegram bot token from @BotFather."- name: TELEGRAM_ALLOWED_USERS19 unmodified lines| Secret | Required | Notes || :--- | :--- | :--- || `LLM_MODEL` | Optional | Model override. If unset, HuggingMess leaves Hermes default/restored config alone. || `LLM_API_KEY` | Usually | Used to populate the provider-specific env var automatically || `TELEGRAM_BOT_TOKEN` | For Telegram | Bot token from BotFather || `TELEGRAM_ALLOWED_USERS` | Recommended | Comma-separated numeric Telegram user IDs |
161 unmodified lines16216316416516616716816917017117217321 unmodified lines19519619719819920020120220320420520628 unmodified lines235236237238239240241242161 unmodified lines[ -n "$LLM_API_KEY" ] && export OPENAI_API_KEY="${OPENAI_API_KEY:-$LLM_API_KEY}"fiif [ -z "$MODEL_FOR_CONFIG" ]; thenecho "Missing LLM_MODEL or HERMES_MODEL."echo "Add it in HF Spaces -> Settings -> Variables or Secrets."exit 1fiexport MODEL_FOR_CONFIG PROVIDER_FOR_CONFIGexport CUSTOM_BASE_URL="${CUSTOM_BASE_URL:-}"export CUSTOM_API_KEY="${CUSTOM_API_KEY:-${LLM_API_KEY:-}}"21 unmodified linesexcept FileNotFoundError:config = {}model = config.setdefault("model", {})model["default"] = os.environ["MODEL_FOR_CONFIG"]model["provider"] = os.environ["PROVIDER_FOR_CONFIG"]custom_base = os.environ.get("CUSTOM_BASE_URL", "").strip()if custom_base:model["base_url"] = custom_base.rstrip("/")if os.environ.get("CUSTOM_API_KEY"):model["api_key"] = os.environ["CUSTOM_API_KEY"]28 unmodified linesPYecho ""echo "Hermes model : ${MODEL_FOR_CONFIG}"echo "Provider : ${PROVIDER_FOR_CONFIG}"echo "Public port : ${PUBLIC_PORT}"if [ -n "${TELEGRAM_BOT_TOKEN:-}" ]; thenecho "Telegram : enabled"161 unmodified lines16216316416516616721 unmodified lines18919019119219319419519619719819920020120220320420520620720828 unmodified lines237238239240241242243244161 unmodified lines[ -n "$LLM_API_KEY" ] && export OPENAI_API_KEY="${OPENAI_API_KEY:-$LLM_API_KEY}"fiexport MODEL_FOR_CONFIG PROVIDER_FOR_CONFIGexport CUSTOM_BASE_URL="${CUSTOM_BASE_URL:-}"export CUSTOM_API_KEY="${CUSTOM_API_KEY:-${LLM_API_KEY:-}}"21 unmodified linesexcept FileNotFoundError:config = {}model_name = os.environ.get("MODEL_FOR_CONFIG", "").strip()provider_name = os.environ.get("PROVIDER_FOR_CONFIG", "").strip()if model_name:model = config.setdefault("model", {})model["default"] = model_nameif provider_name:model["provider"] = provider_nameelse:model = config.get("model", {})print("No LLM_MODEL/HERMES_MODEL set; leaving Hermes model config unchanged.")custom_base = os.environ.get("CUSTOM_BASE_URL", "").strip()if custom_base and model_name:model["base_url"] = custom_base.rstrip("/")if os.environ.get("CUSTOM_API_KEY"):model["api_key"] = os.environ["CUSTOM_API_KEY"]28 unmodified linesPYecho ""echo "Hermes model : ${MODEL_FOR_CONFIG:-using Hermes default/restored config}"echo "Provider : ${PROVIDER_FOR_CONFIG:-using Hermes default/restored config}"echo "Public port : ${PUBLIC_PORT}"if [ -n "${TELEGRAM_BOT_TOKEN:-}" ]; thenecho "Telegram : enabled"
README.md+2-2
start.sh+14-12