Skip to content

The agent that grows with you

feat(providers): adapt bundled meta-ai plugin — docstring, tests, docs

Tekniumeaa3c72c3e13
diff --git a/plugins/model-providers/meta-ai/__init__.py b/plugins/model-providers/meta-ai/__init__.py
index 00515f7fefb..0458eede9be 100644
--- a/plugins/model-providers/meta-ai/__init__.py
+++ b/plugins/model-providers/meta-ai/__init__.py
@@ -1,11 +1,9 @@
"""Meta Model API (Muse Spark) provider plugin for Hermes Agent.
-Self-contained, out-of-tree provider profile for Meta Superintelligence Labs'
-Muse Spark family, served via the OpenAI-compatible Meta Model API at
-``https://api.meta.ai/v1``.
+Provider profile for Meta Superintelligence Labs' Muse Spark family, served
+via the OpenAI-compatible Meta Model API at ``https://api.meta.ai/v1``.
-Install by copying this directory to
-``$HERMES_HOME/plugins/model-providers/meta-ai/`` (see ``install.sh``). Hermes'
+Bundled from https://github.com/albertodepaola/hermes-meta-provider. Hermes'
provider discovery (``providers/__init__.py``) imports it on first
``get_provider_profile()`` / ``list_providers()`` call, and the module-level
``register_provider()`` below wires it into the registry.
diff --git a/tests/providers/test_meta_ai_profile.py b/tests/providers/test_meta_ai_profile.py
new file mode 100644
index 00000000000..f9c350db505
--- /dev/null
+++ b/tests/providers/test_meta_ai_profile.py
@@ -0,0 +1,59 @@
+"""Tests for the bundled Meta Model API (Muse Spark) provider plugin.
+
+Adapted from the plugin's original suite at
+https://github.com/albertodepaola/hermes-meta-provider — the plugin is now
+bundled, so profiles resolve through normal registry discovery.
+"""
+
+import pytest
+
+from providers import get_provider_profile
+
+
+def _profile():
+ p = get_provider_profile("meta-ai")
+ assert p is not None
+ return p
+
+
+class TestMetaAIProfile:
+ def test_profile_registered(self):
+ p = _profile()
+ assert p.name == "meta-ai"
+ assert p.base_url == "https://api.meta.ai/v1"
+ assert p.auth_type == "api_key"
+ assert p.api_mode == "chat_completions"
+ assert "MODEL_API_KEY" in p.env_vars
+ assert p.supports_vision is True
+ assert p.default_aux_model == "muse-spark-1.2-contributor"
+ assert p.default_max_tokens == 16384
+ assert "muse-spark-1.2-contributor" in p.fallback_models
+ assert "muse-spark-1.2" in p.fallback_models
+
+ @pytest.mark.parametrize("alias", ["meta", "muse", "muse-spark", "model-api", "msl"])
+ def test_aliases_resolve(self, alias):
+ assert get_provider_profile(alias) is _profile()
+
+
+def _effort(cfg):
+ _eb, top = _profile().build_api_kwargs_extras(reasoning_config=cfg)
+ return top.get("reasoning_effort")
+
+
+class TestReasoningEffort:
+ def test_mapping(self):
+ assert _effort(None) == "medium" # unset -> medium
+ assert _effort({"enabled": True, "effort": "high"}) == "high"
+ assert _effort({"enabled": True, "effort": "low"}) == "low"
+ assert _effort({"enabled": True, "effort": "max"}) == "xhigh"
+ assert _effort({"enabled": False}) == "minimal" # disabled -> minimal
+ # Meta 400s on "none" — must map to "minimal"
+ assert _effort({"effort": "none"}) == "minimal"
+
+ def test_never_uses_extra_body(self):
+ """The dial must be top-level, not extra_body.reasoning (core-gated path)."""
+ eb, top = _profile().build_api_kwargs_extras(
+ reasoning_config={"enabled": True, "effort": "high"}
+ )
+ assert eb == {}
+ assert "reasoning_effort" in top
diff --git a/website/docs/integrations/providers.md b/website/docs/integrations/providers.md
index 1b298c14647..0dd4911353a 100644
--- a/website/docs/integrations/providers.md
+++ b/website/docs/integrations/providers.md
@@ -288,6 +288,10 @@ hermes chat --provider tencent-tokenhub --model hy3-preview
hermes chat --provider arcee --model trinity-large-thinking
# Requires: ARCEEAI_API_KEY in ~/.hermes/.env
+# Meta Model API (Muse Spark family)
+hermes chat --provider meta-ai --model muse-spark-1.2
+# Requires: MODEL_API_KEY in ~/.hermes/.env
+
# GMI Cloud
# Use the exact model ID returned by GMI's /v1/models endpoint.
hermes chat --provider gmi --model zai-org/GLM-5.1-FP8
@@ -303,7 +307,11 @@ model:
default: "zai-org/GLM-5.1-FP8"
```
-Base URLs can be overridden with `NOVITA_BASE_URL`, `GLM_BASE_URL`, `KIMI_BASE_URL`, `MINIMAX_BASE_URL`, `MINIMAX_CN_BASE_URL`, `DASHSCOPE_BASE_URL`, `XIAOMI_BASE_URL`, `GMI_BASE_URL`, or `TOKENHUB_BASE_URL` environment variables.
+Base URLs can be overridden with `NOVITA_BASE_URL`, `GLM_BASE_URL`, `KIMI_BASE_URL`, `MINIMAX_BASE_URL`, `MINIMAX_CN_BASE_URL`, `DASHSCOPE_BASE_URL`, `XIAOMI_BASE_URL`, `GMI_BASE_URL`, `META_BASE_URL`, or `TOKENHUB_BASE_URL` environment variables.
+
+:::note Meta contributor tier
+`muse-spark-1.2-contributor` is Meta's discounted tier — Meta may train on your prompts and completions, so [interactive model selection asks for confirmation](../user-guide/configuring-models.md) before using it. Use `muse-spark-1.2` (standard pricing, no training) for confidential work.
+:::
:::note Z.AI Endpoint Auto-Detection
When using the Z.AI / GLM provider, Hermes automatically probes multiple endpoints (global, China, coding variants) to find one that accepts your API key. You don't need to set `GLM_BASE_URL` manually — the working endpoint is detected and cached automatically.