Skip to content

feat: derive hermes provider from model slug prefix (both paths) - #9

Merged
HongmingWang-Rabbit merged 1 commit into
mainfrom
feat/derive-provider-from-model-prefix
Apr 22, 2026
Merged

HongmingWang-Rabbit merged 1 commit into
mainfrom
feat/derive-provider-from-model-prefix

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Closes the last gap in the 'customer creates workspace with MiniMax Token Plan, just works' MVP flow. Shared sub-script so install.sh (SaaS bare-host) + start.sh (Docker) stay consistent. Pairs with molecule-core PR for tenant env propagation.

When HERMES_INFERENCE_PROVIDER isn't set, hermes-agent's "auto"
detection is unreliable — particularly for MiniMax Token Plan + most
non-OpenRouter direct-SDK providers. Without the right provider,
hermes gateway rejects chats with "No LLM provider configured" or
routes to the wrong backend.

This is the last piece of the MVP pipeline that makes "customer
creates workspace with model = minimax/MiniMax-M2.7-highspeed + key
= sk-cp-..., just works" a one-click flow.

Changes:

- scripts/derive-provider.sh (NEW): sourced sub-script that reads
  HERMES_DEFAULT_MODEL and sets $PROVIDER to the right value for
  every provider hermes-agent supports. Explicit HERMES_INFERENCE_PROVIDER
  in the env wins; otherwise the case statement handles: minimax/*,
  minimax-cn/*, anthropic/*, gemini/*, deepseek/*, zai/*, kimi-coding/*
  (+ cn variant), alibaba/ dashscope/ qwen/*, xiaomi/ mimo/*, arcee/*,
  nvidia/ nim/*, ollama-cloud/*, huggingface/ hf/*, ai-gateway/*,
  kilocode/*, opencode-zen/*, opencode-go/*, openai/* (routes through
  openrouter — hermes has no direct openai provider), nousresearch/*
  (nous if HERMES_API_KEY or NOUS_API_KEY is set, else openrouter),
  openrouter/*, custom/*. Unknown prefix → "auto".

- install.sh (bare-host path) + start.sh (Docker path): both now
  source scripts/derive-provider.sh to populate $PROVIDER before
  writing ~/.hermes/config.yaml.

- Dockerfile: COPY scripts/ /app/scripts/ so start.sh can find the
  sub-script at the same path it lives on EC2 (/opt/adapter/scripts/
  via git clone).

This is the cross-path pattern the workspace-backends design doc
calls for: each template's backend-specific entrypoints share
common sub-recipes, so evolving the logic lives in one place.

Tested locally:
  minimax/MiniMax-M2.7-highspeed        → minimax
  anthropic/claude-sonnet-4-5           → anthropic
  openai/gpt-5-mini                     → openrouter
  nousresearch/hermes-4-70b (w/ key)    → nous
  nousresearch/hermes-4-70b (no key)    → openrouter
  zai/glm-4.6                           → zai
  gemini/gemini-2.5-pro                 → gemini
  bogus/model-v1                        → auto
  HERMES_INFERENCE_PROVIDER=custom (+anything) → custom

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit e5a911a into main Apr 22, 2026
1 check passed
@molecule-ai
molecule-ai Bot deleted the feat/derive-provider-from-model-prefix branch May 20, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant