fix: allow local models without API keys#733
Open
zerone0x wants to merge 1 commit into
Open
Conversation
Support Ollama and local OpenAI-compatible endpoints in CLI settings and headless env overrides without requiring LLM_API_KEY. Fixes OpenHands#673
enyst
reviewed
May 17, 2026
| "ollama", | ||
| "sagemaker", | ||
| "vertex_ai", | ||
| "vertex_ai_beta", |
Member
There was a problem hiding this comment.
We have tried to avoid more special LLM/provider code, even though we have been a bit inconsistent. I think maybe rules for some providers, if they are really necessary, could be in the agent-sdk.
On the other hand, I thought bedrock works for no-password case. Have you tried it?
enyst
requested changes
May 17, 2026
Member
enyst
left a comment
There was a problem hiding this comment.
I think maybe this belongs in the agent-sdk if we need to do more to support this. I kinda thought it was already supported, but maybe we missed something?
Could you post logs or screenshots to show what failed and what works?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--override-with-envsto create agents for local/Ollama models withoutLLM_API_KEYTesting
uv run ruff check openhands_cli/stores/agent_store.py openhands_cli/tui/modals/settings/utils.py openhands_cli/tui/modals/settings/settings_screen.py tests/stores/test_env_llm_overrides.py tests/tui/modals/settings/test_settings_utils.py tests/tui/modals/settings/test_settings_screen.pyuv run pytest -q tests/stores/test_env_llm_overrides.py tests/tui/modals/settings/test_settings_utils.py tests/tui/modals/settings/test_settings_screen.pyFixes #673