mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
Custom endpoint users (DashScope/Alibaba, Z.AI, Kimi, DeepSeek, etc.) get wrong context lengths because their provider resolves as "openrouter" or "custom", skipping the models.dev lookup entirely. For example, qwen3.5-plus on DashScope falls to the generic "qwen" hardcoded default (131K) instead of the correct 1M. Add _infer_provider_from_url() that maps known API hostnames to their models.dev provider IDs. When the explicit provider is generic (openrouter/custom/empty), infer from the base URL before the models.dev lookup. This resolves context lengths correctly for DashScope, Z.AI, Kimi, MiniMax, DeepSeek, and Nous endpoints without requiring users to manually set context_length in config. Also refactors _is_known_provider_base_url() to use the same URL mapping, removing the duplicated hostname list. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| anthropic_adapter.py | ||
| auxiliary_client.py | ||
| context_compressor.py | ||
| copilot_acp_client.py | ||
| display.py | ||
| insights.py | ||
| model_metadata.py | ||
| models_dev.py | ||
| prompt_builder.py | ||
| prompt_caching.py | ||
| redact.py | ||
| skill_commands.py | ||
| smart_model_routing.py | ||
| title_generator.py | ||
| trajectory.py | ||
| usage_pricing.py | ||