Skip to main content
This section is for users who want to connect OpenHands to different LLMs.
OpenHands now delegates all LLM orchestration to the Agent SDK. The guidance on this page focuses on how the OpenHands interfaces surface those capabilities. When in doubt, refer to the SDK documentation for the canonical list of supported parameters.

Model Recommendations

Model quality for coding agents changes quickly. These recommendations are based on current OpenHands Index results where available. The linked openhands-index-results repository contains the full scores and trajectories for each run. Use the strongest model you can afford for long-running or high-stakes tasks. Use lower-cost profiles for routine edits, then switch back to a stronger model for planning, debugging, and review.

Best Cloud Models by Family

FamilyRecommended ModelModel StringOpenHands Index Average
Claudeclaude-opus-4-8Not yet listed71.9
GPTGPT-5.5openai/gpt-5.565.9
GeminiGemini-3.5-FlashNot yet listed62.6

Strong Open / Open-Weight Models

These open or open-weight models have good OpenHands Index scores or are recommended for local OpenHands setups:
ModelSuggested Model StringOpenHands Index Average
GLM-5.1openrouter/z-ai/glm-5.158.2
MiniMax-M3openrouter/minimax/minimax-m357.2
Kimi-K2.6openrouter/moonshotai/kimi-k2.657.1
GLM-5openrouter/z-ai/glm-549.4
Kimi-K2.5openrouter/moonshotai/kimi-k2.549.2
Hosted model strings can vary by provider and region. If a model string is not accepted, check the provider console and the LiteLLM provider list, then use the provider-specific model ID shown there.
If you have successfully run OpenHands with specific providers, we encourage you to open a PR to share your setup process to help others using the same provider! For a full list of the providers and models available, please consult the litellm documentation.
OpenHands will issue many prompts to the LLM you configure. Most of these LLMs cost money, so be sure to set spending limits and monitor usage.

Local / Self-Hosted Models

For local and self-hosted usage, start with Qwen3.6-35B-A3B. See the local LLM guide for LM Studio, Ollama, SGLang, and vLLM setup examples.

Known Issues

Open-weight and local models still vary widely in tool-use reliability. If you see long wait times, poor responses, or errors about malformed JSON, try a stronger model, increase the context window, or switch to a frontier cloud model for that task.

LLM Configuration

The following can be set in the OpenHands UI through the Settings. Each option is serialized into the LLM.load_from_env() schema before being passed to the Agent SDK:
  • LLM Provider
  • LLM Model
  • API Key
  • Base URL (through Advanced settings)
There are some settings that may be necessary for certain providers that cannot be set directly through the UI. Set them as environment variables (or add them to your config.toml) so the SDK picks them up during startup:
  • LLM_API_VERSION
  • LLM_EMBEDDING_MODEL
  • LLM_EMBEDDING_DEPLOYMENT_NAME
  • LLM_DROP_PARAMS
  • LLM_DISABLE_VISION
  • LLM_CACHING_PROMPT

LLM Provider Guides

We have a few guides for running OpenHands with specific model providers: These pages remain the authoritative provider references for both the Agent SDK and the OpenHands interfaces.

Model Customization

LLM providers have specific settings that can be customized to optimize their performance with OpenHands, such as:
  • Custom Tokenizers: For specialized models, you can add a suitable tokenizer.
  • Native Tool Calling: Toggle native function/tool calling capabilities.
For detailed information about model customization, see LLM Configuration Options.

API retries and rate limits

LLM providers typically have rate limits, sometimes very low, and may require retries. OpenHands will automatically retry requests if it receives a Rate Limit Error (429 error code). You can customize these options as you need for the provider you’re using. Check their documentation, and set the following environment variables to control the number of retries and the time between retries:
  • LLM_NUM_RETRIES (Default of 4 times)
  • LLM_RETRY_MIN_WAIT (Default of 5 seconds)
  • LLM_RETRY_MAX_WAIT (Default of 30 seconds)
  • LLM_RETRY_MULTIPLIER (Default of 2)
If you are running OpenHands in development mode, you can also set these options in the config.toml file:
[llm]
num_retries = 4
retry_min_wait = 5
retry_max_wait = 30
retry_multiplier = 2