mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-01 01:51:44 +00:00
Merge PR #420: fix: respect OPENAI_BASE_URL when resolving API key priority
Authored by manuelschipper. Adds GLM-4.7 and GLM-5 context lengths (202752) to model_metadata.py. The key priority fix (prefer OPENAI_API_KEY for non-OpenRouter endpoints) was already applied in PR #295; merged the Z.ai mention into the comment.
This commit is contained in:
commit
3c6c11b7c9
2 changed files with 5 additions and 2 deletions
|
|
@ -74,8 +74,9 @@ def _resolve_openrouter_runtime(
|
|||
|
||||
# Choose API key based on whether the resolved base_url targets OpenRouter.
|
||||
# When hitting OpenRouter, prefer OPENROUTER_API_KEY (issue #289).
|
||||
# When hitting a custom endpoint, prefer OPENAI_API_KEY so the OpenRouter
|
||||
# key doesn't leak to an unrelated provider (issue #560).
|
||||
# When hitting a custom endpoint (e.g. Z.ai, local LLM), prefer
|
||||
# OPENAI_API_KEY so the OpenRouter key doesn't leak to an unrelated
|
||||
# provider (issues #420, #560).
|
||||
_is_openrouter_url = "openrouter.ai" in base_url
|
||||
if _is_openrouter_url:
|
||||
api_key = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue