mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-09 03:11:58 +00:00
Every provider profile is now a self-contained plugin under plugins/model-providers/<name>/, mirroring the plugins/platforms/ pattern established for IRC and Teams. The ProviderProfile ABC stays in providers/; the per-provider profile data moves out. - plugins/model-providers/<name>/__init__.py calls register_provider() - plugins/model-providers/<name>/plugin.yaml declares kind: model-provider - providers/__init__.py._discover_providers() lazily scans bundled plugins then $HERMES_HOME/plugins/model-providers/<name>/ (user override path) - User plugins with the same name override bundled ones (last-writer-wins in register_provider) - Legacy providers/<name>.py layout still supported for back-compat with out-of-tree editable installs - Hermes PluginManager: new kind=model-provider; skipped like memory plugins (providers/ discovery owns them); standalone plugins with register_provider+ProviderProfile in their __init__.py auto-coerce to this kind (same heuristic as memory providers) - skip_names extended to include 'model-providers' so the general PluginManager doesn't double-scan the category - 4 new tests in tests/providers/test_plugin_discovery.py covering bundled discovery, user override, and general-loader isolation - Docs updated: website/docs/developer-guide/adding-providers.md, provider-runtime.md, providers/README.md, plugins/model-providers/README.md No API break: auth.py / config.py / doctor.py / models.py / runtime_provider.py / model_metadata.py / auxiliary_client.py / chat_completions.py / run_agent.py all still consume providers via get_provider_profile() / list_providers() — they just now see plugin-discovered entries instead of pkgutil-iterated ones. Third parties can now drop a single directory into ~/.hermes/plugins/model-providers/<name>/ to add or override an inference provider without touching the repo.
30 lines
928 B
Python
30 lines
928 B
Python
"""OpenCode provider profiles (Zen + Go).
|
|
|
|
Both use per-model api_mode routing:
|
|
- OpenCode Zen: Claude → anthropic_messages, GPT-5/Codex → codex_responses,
|
|
everything else → chat_completions (this profile)
|
|
- OpenCode Go: MiniMax → anthropic_messages, GLM/Kimi → chat_completions
|
|
(this profile)
|
|
"""
|
|
|
|
from providers import register_provider
|
|
from providers.base import ProviderProfile
|
|
|
|
opencode_zen = ProviderProfile(
|
|
name="opencode-zen",
|
|
aliases=("opencode", "opencode_zen", "zen"),
|
|
env_vars=("OPENCODE_ZEN_API_KEY",),
|
|
base_url="https://opencode.ai/zen/v1",
|
|
default_aux_model="gemini-3-flash",
|
|
)
|
|
|
|
opencode_go = ProviderProfile(
|
|
name="opencode-go",
|
|
aliases=("opencode_go", "go", "opencode-go-sub"),
|
|
env_vars=("OPENCODE_GO_API_KEY",),
|
|
base_url="https://opencode.ai/zen/go/v1",
|
|
default_aux_model="glm-5",
|
|
)
|
|
|
|
register_provider(opencode_zen)
|
|
register_provider(opencode_go)
|