Skip to content

fix: allow local models without API keys#733

Open
zerone0x wants to merge 1 commit into
OpenHands:mainfrom
zerone0x:fix/673-local-model-api-key
Open

fix: allow local models without API keys#733
zerone0x wants to merge 1 commit into
OpenHands:mainfrom
zerone0x:fix/673-local-model-api-key

Conversation

@zerone0x
Copy link
Copy Markdown
Contributor

@zerone0x zerone0x commented May 9, 2026

Summary

  • skip API key validation for local or IAM-backed models in CLI settings
  • unlock memory condensation and advanced settings for Ollama or localhost-backed models
  • allow --override-with-envs to create agents for local/Ollama models without LLM_API_KEY

Testing

  • 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.py
  • uv 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.py

Fixes #673

Support Ollama and local OpenAI-compatible endpoints in CLI settings and headless env overrides without requiring LLM_API_KEY.

Fixes OpenHands#673
"ollama",
"sagemaker",
"vertex_ai",
"vertex_ai_beta",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

@enyst enyst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX] API key still required in CLI when not needed for local LLMs

2 participants