> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openhands.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> OpenHands can connect to any LLM supported by LiteLLM. However, it requires a powerful model to work.

<Note>
  This section is for users who want to connect OpenHands to different LLMs.
</Note>

<Info>
  OpenHands now delegates all LLM orchestration to the <a href="/sdk/arch/llm">Agent SDK</a>. 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.
</Info>

## Model Recommendations

Model quality for coding agents changes quickly. These recommendations are based on current
[OpenHands Index](https://index.openhands.dev/home) results where available. The linked
[openhands-index-results repository](https://github.com/OpenHands/openhands-index-results) 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

| Family | Recommended Model                                                                                           | Model String     | OpenHands Index Average |
| ------ | ----------------------------------------------------------------------------------------------------------- | ---------------- | ----------------------- |
| Claude | [claude-opus-4-8](https://github.com/OpenHands/openhands-index-results/tree/main/results/claude-opus-4-8)   | Not yet listed   | 71.9                    |
| GPT    | [GPT-5.5](https://github.com/OpenHands/openhands-index-results/tree/main/results/GPT-5.5)                   | `openai/gpt-5.5` | 65.9                    |
| Gemini | [Gemini-3.5-Flash](https://github.com/OpenHands/openhands-index-results/tree/main/results/Gemini-3.5-Flash) | Not yet listed   | 62.6                    |

### Strong Open / Open-Weight Models

These open or open-weight models have good OpenHands Index scores or are recommended for local OpenHands setups:

| Model                                                                                           | Suggested Model String            | OpenHands Index Average |
| ----------------------------------------------------------------------------------------------- | --------------------------------- | ----------------------- |
| [GLM-5.1](https://github.com/OpenHands/openhands-index-results/tree/main/results/GLM-5.1)       | `openrouter/z-ai/glm-5.1`         | 58.2                    |
| [MiniMax-M3](https://github.com/OpenHands/openhands-index-results/tree/main/results/MiniMax-M3) | `openrouter/minimax/minimax-m3`   | 57.2                    |
| [Kimi-K2.6](https://github.com/OpenHands/openhands-index-results/tree/main/results/Kimi-K2.6)   | `openrouter/moonshotai/kimi-k2.6` | 57.1                    |
| [GLM-5](https://github.com/OpenHands/openhands-index-results/tree/main/results/GLM-5)           | `openrouter/z-ai/glm-5`           | 49.4                    |
| [Kimi-K2.5](https://github.com/OpenHands/openhands-index-results/tree/main/results/Kimi-K2.5)   | `openrouter/moonshotai/kimi-k2.5` | 49.2                    |

<Note>
  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](https://docs.litellm.ai/docs/providers), then use the provider-specific model ID shown there.
</Note>

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](https://docs.litellm.ai/docs/providers).

<Warning>
  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.
</Warning>

### Local / Self-Hosted Models

For local and self-hosted usage, start with
[Qwen3.6-35B-A3B](https://huggingface.co/Qwen/Qwen3.6-35B-A3B). See the
[local LLM guide](/openhands/usage/llms/local-llms) for LM Studio, Ollama, SGLang, and vLLM setup examples.

### Known Issues

<Note>
  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.
</Note>

## 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:

* [AWS Bedrock](/openhands/usage/llms/aws-bedrock)
* [Azure](/openhands/usage/llms/azure-llms)
* [Google](/openhands/usage/llms/google-llms)
* [Groq](/openhands/usage/llms/groq)
* [Local LLMs with SGLang or vLLM](/openhands/usage/llms/local-llms)
* [LiteLLM Proxy](/openhands/usage/llms/litellm-proxy)
* [Moonshot AI](/openhands/usage/llms/moonshot)
* [OpenAI](/openhands/usage/llms/openai-llms)
* [OpenHands](/openhands/usage/llms/openhands-llms)
* [OpenRouter](/openhands/usage/llms/openrouter)

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](/openhands/usage/advanced/configuration-options#llm-configuration).

### 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:

```toml theme={null}
[llm]
num_retries = 4
retry_min_wait = 5
retry_max_wait = 30
retry_multiplier = 2
```
