hermes - ✅(Solved) Fix [Feature]: openai client cannot get the right model info from local Ollama service [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#14189Fetched 2026-04-23 07:46:18
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×1

Error Message

2026-04-22 23:06:21,347 INFO run_agent: Streaming failed before delivery: Error code: 400 - {'error': {'message': 'model is required', 'type': 'invalid_request_error', 'param': None, 'code': None}} 2026-04-22 23:06:21,356 ERROR [20260422_230620_0e1b3c] root: Non-retryable client error: Error code: 400 - {'error': {'message': 'model is required', 'type': 'invalid_request_error', 'param': None, 'code': None}}

PR fix notes

PR #14386: fix(gateway): preserve custom runtime model

Description (problem / solution / changelog)

Summary

  • Fixes #14189.
  • Preserves model.default/model.model on plain provider: custom runtime resolution, including credential-pool custom endpoints.
  • Carries the runtime model through the gateway bridge and uses it when the session/config model is empty, while removing it from runtime kwargs before constructing AIAgent so callers do not double-pass model.

Root cause

Remote/custom Ollama-compatible endpoints could resolve provider credentials as provider=custom but drop the configured model name before gateway-created agents were constructed. The gateway then fell back to the provider catalog default for custom, which is empty, causing OpenAI-compatible local servers to reject requests with model is required.

Tests

  • /Users/stephenyu/Documents/hermes-agent/.venv/bin/python -m pytest tests/hermes_cli/test_runtime_provider_resolution.py::test_plain_custom_runtime_propagates_config_model tests/hermes_cli/test_runtime_provider_resolution.py::test_plain_custom_runtime_propagates_config_model_pool_path tests/gateway/test_session_model_override_routing.py::test_runtime_agent_kwargs_preserves_runtime_model tests/gateway/test_session_model_override_routing.py::test_session_runtime_inherits_custom_model_from_runtime -q -> 4 passed
  • /Users/stephenyu/Documents/hermes-agent/.venv/bin/python -m pytest tests/hermes_cli/test_runtime_provider_resolution.py tests/gateway/test_session_model_override_routing.py -q -> 77 passed
  • /Users/stephenyu/Documents/hermes-agent/.venv/bin/python -m pytest tests/gateway/test_compress_command.py tests/gateway/test_compress_focus.py tests/gateway/test_session_model_override_routing.py -q -> 8 passed
  • git diff --check

Notes

  • I also tried /Users/stephenyu/Documents/hermes-agent/.venv/bin/python -m pytest tests/gateway/test_agent_cache.py tests/gateway/test_model_switch_persistence.py -q; the only failure was the existing macOS-local terminal cleanup assertion in tests/gateway/test_agent_cache.py::TestAgentCacheIdleResume::test_close_vs_release_full_teardown_difference, unrelated to this model routing change.

Changed files

  • gateway/run.py (modified, +7/-0)
  • hermes_cli/runtime_provider.py (modified, +9/-1)
  • tests/gateway/test_session_model_override_routing.py (modified, +46/-0)
  • tests/hermes_cli/test_runtime_provider_resolution.py (modified, +50/-0)
RAW_BUFFERClick to expand / collapse

Problem or Use Case

2026-04-22 23:06:20,636 INFO agent.auxiliary_client: Vision auto-detect: using main provider custom (qwen3-coder:latest) 2026-04-22 23:06:20,804 INFO agent.auxiliary_client: Vision auto-detect: using main provider custom (qwen3-coder:latest) 2026-04-22 23:06:20,864 INFO agent.model_metadata: Could not detect context length for model '' at http://192.168.1.13:11434/v1/ — defaulting to 128,000 tokens (probe-down). Set model.context_length in config.yaml to override. 2026-04-22 23:06:20,865 INFO agent.context_compressor: Context compressor initialized: model= context_length=128000 threshold=64000 (50%) target_ratio=20% tail_budget=12800 provider=none base_url=http://192.168.1.13:11434/v1/ 2026-04-22 23:06:20,907 INFO agent.auxiliary_client: Auxiliary auto-detect: using main provider custom (qwen3-coder:latest) 2026-04-22 23:06:20,909 INFO [20260422_230620_0e1b3c] run_agent: conversation turn: session=20260422_230620_0e1b3c model= provider=unknown platform=unknown history=0 msg='Tell me about the latest developments in Python 3.13 and what new features devel...' 2026-04-22 23:06:20,974 INFO run_agent: OpenAI client created (chat_completion_stream_request, shared=False) thread=Thread-1 (_call):124676862650048 provider= base_url=http://192.168.1.13:11434/v1/ model= 2026-04-22 23:06:21,347 INFO run_agent: Streaming failed before delivery: Error code: 400 - {'error': {'message': 'model is required', 'type': 'invalid_request_error', 'param': None, 'code': None}} 2026-04-22 23:06:21,348 INFO run_agent: OpenAI client closed (stream_request_complete, shared=False, tcp_force_closed=0) thread=Thread-1 (_call):124676862650048 provider= base_url=http://192.168.1.13:11434/v1/ model= 2026-04-22 23:06:21,349 WARNING [20260422_230620_0e1b3c] run_agent: API call failed (attempt 1/3) error_type=BadRequestError thread=MainThread:124677040678720 provider= base_url=http://192.168.1.13:11434/v1/ model= summary=HTTP 400: model is required 2026-04-22 23:06:21,356 ERROR [20260422_230620_0e1b3c] root: Non-retryable client error: Error code: 400 - {'error': {'message': 'model is required', 'type': 'invalid_request_error', 'param': None, 'code': None}} 2026-04-22 23:06:34,429 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai 2026-04-22 23:06:34,430 INFO hermes_cli.plugins: Plugin discovery complete: 2 found, 1 enabled 2026-04-22 23:06:34,511 INFO agent.auxiliary_client: Auxiliary auto-detect: using main provider custom (qwen3-coder:latest) 2026-04-22 23:06:34,519 INFO run_agent: OpenAI client created (agent_init, shared=True) thread=MainThread:128154899744576 provider= base_url=http://192.168.1.13:11434/v1/ model=

as the logs , OpenAI client cannot get the model info from the Ollama(local service) , I thinke this is a feature request . Are there any repair solutions?

Proposed Solution

have no idear now

Alternatives Considered

No response

Feature Type

New tool

Scope

None

Contribution

  • I'd like to implement this myself and submit a PR

Debug Report (optional)

extent analysis

TL;DR

The OpenAI client is unable to retrieve model information from the local Ollama service, resulting in a "model is required" error, and a potential solution involves specifying the model in the configuration.

Guidance

  • Verify that the model parameter is correctly set in the configuration file config.yaml or in the API request to the Ollama service.
  • Check the Ollama service logs to ensure it is properly configured and running.
  • Confirm that the model field is being passed correctly in the API request from the OpenAI client to the Ollama service.
  • Consider setting a default model in the config.yaml file if the model cannot be auto-detected.

Example

No code example is provided as the issue seems to be related to configuration or API request rather than code.

Notes

The issue seems to be related to the OpenAI client's inability to auto-detect the model from the Ollama service, and the error message suggests that the model is required. Without more information about the Ollama service and its configuration, it's difficult to provide a more specific solution.

Recommendation

Apply workaround: specify the model in the configuration file config.yaml or in the API request to the Ollama service, as this seems to be the most straightforward way to resolve the "model is required" error.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Feature]: openai client cannot get the right model info from local Ollama service [1 pull requests, 1 participants]