The previous fix (#142) prefixed non-default provider models with 'provider/model' which then hit the cross-provider guard and routed to OpenRouter — worse than before for users without an OpenRouter key. New approach: non-default provider models use '@provider:model' format (e.g. @minimax:MiniMax-M2.7). resolve_model_provider() parses this hint and returns (bare_model, provider, None). streaming.py and routes.py then pass the resolved provider to resolve_runtime_provider(requested=provider) which gets the correct per-provider API key and base_url from hermes-agent. This uses the agent's own credential resolution instead of reinventing routing logic in the webui. Fixes #138 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1061,7 +1061,7 @@ def _handle_chat_sync(handler, body):
|
||||
_api_key = None
|
||||
try:
|
||||
from hermes_cli.runtime_provider import resolve_runtime_provider
|
||||
_rt = resolve_runtime_provider()
|
||||
_rt = resolve_runtime_provider(requested=_provider)
|
||||
_api_key = _rt.get("api_key")
|
||||
# Also use runtime provider/base_url if the webui config didn't resolve them
|
||||
if not _provider:
|
||||
|
||||
Reference in New Issue
Block a user