Native ModelScope model-provider plugin for Hermes Agent.
It registers modelscope as a first-class OpenAI-compatible chat-completions
provider using the ModelScope Inference API directly.
- Provider ID:
modelscope - Alias:
ms - Base URL:
https://api-inference.modelscope.cn/v1 - Chat completions URL:
https://api-inference.modelscope.cn/v1/chat/completions - Auth env var:
MODELSCOPE_API_KEY - Optional base URL override:
MODELSCOPE_BASE_URL - Wire protocol: OpenAI-compatible
/chat/completions
- Hermes Agent with model-provider plugin support installed and available on
your
PATHashermes. - Python 3.10+ for local development/tests in this repository.
- A ModelScope Access Token with access to ModelScope Inference API.
If hermes --help fails, install Hermes Agent first, then return to these
steps. This repository only contains the ModelScope provider plugin; it does
not install Hermes itself.
This is a copy-only Hermes plugin. pip install . is not required for
normal use.
git clone https://github.com/modelscope/hermes-modelscope-api.git
cd hermes-modelscope-apimkdir -p ~/.hermes/plugins/model-providers
rm -rf ~/.hermes/plugins/model-providers/modelscope
cp -R plugins/model-providers/modelscope ~/.hermes/plugins/model-providers/modelscopeGet your Access Token at
modelscope.cn/my/access/token,
then add it to ~/.hermes/.env:
# Append to ~/.hermes/.env (create the file if it doesn't exist)
echo 'MODELSCOPE_API_KEY=your_access_token' >> ~/.hermes/.envTip: You can also run
hermes setupfor an interactive prompt that writes the key into~/.hermes/.envfor you.
Or export it in your shell:
export MODELSCOPE_API_KEY="your_access_token"Optional: point Hermes at a non-production ModelScope-compatible endpoint:
export MODELSCOPE_BASE_URL="https://api-inference.modelscope.cn/v1"If you use the Hermes desktop app, you can also set the API key from the UI:
- Open Hermes Desktop
- Go to Settings → Provider (or run
hermes setup) - Find ModelScope in the provider list
- Paste your Access Token into the
MODELSCOPE_API_KEYfield
The plugin auto-registers on the next Hermes session — no restart needed for subsequent sessions.
First confirm Hermes is installed:
hermes --helpThen confirm the plugin files landed in the directory Hermes scans:
test -f ~/.hermes/plugins/model-providers/modelscope/plugin.yaml
test -f ~/.hermes/plugins/model-providers/modelscope/__init__.pyThe simplest runtime verification is to start hermes chat — ModelScope
will appear in the provider picker:
hermes chatThen type /model in the chat to open the provider/model picker and look
for modelscope (alias: ms).
hermes chat --provider modelscope --model Qwen/Qwen3.5-397B-A17BYou can also use the alias:
hermes chat --provider ms --model deepseek-ai/DeepSeek-V4-FlashOr set the provider permanently in config.yaml:
model:
provider: "modelscope"
default: "Qwen/Qwen3.5-397B-A17B"The plugin ships a static fallback catalog for offline picker behavior. When
Hermes can reach ModelScope with MODELSCOPE_API_KEY, it should prefer the
live /v1/models endpoint.
Key fallback models include:
Qwen/Qwen3-235B-A22BQwen/Qwen3.5-27BQwen/Qwen3.5-397B-A17Bdeepseek-ai/DeepSeek-V3.2deepseek-ai/DeepSeek-V4-Flashdeepseek-ai/DeepSeek-V4-Prodeepseek-ai/DeepSeek-R1-0528ZhipuAI/GLM-5.1MiniMax/MiniMax-M2.7moonshotai/Kimi-K2.5
Hermes Agent is not installed or is not on your PATH. Install Hermes first,
then re-run hermes --help.
Re-copy the plugin from the repository root and make sure the final path is exactly:
~/.hermes/plugins/model-providers/modelscope/plugin.yaml
~/.hermes/plugins/model-providers/modelscope/__init__.py
Avoid copying the parent plugins/ directory into ~/.hermes; Hermes expects
provider plugins under ~/.hermes/plugins/model-providers/<provider-id>.
Set a ModelScope Access Token before making a live chat-completions request:
export MODELSCOPE_API_KEY="your_access_token"Create or rotate tokens at modelscope.cn/my/access/token.
This repository requires Python 3.10+ for local test environments. If your
system python3 is older, use a newer interpreter for development:
python3.10 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip pytest pyyaml
python -m pytest -qpython3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip pytest pyyaml
python -m pytest -qThe tests include:
- Static manifest/provider shape checks.
- A runtime import smoke test using stubbed Hermes provider APIs, so provider registration is validated even when Hermes is not installed in the test environment.
Apache License 2.0 — see LICENSE.