--- title: Overview description: OpenHands can connect to any LLM supported by LiteLLM. However, it requires a powerful model to work. --- 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. ## Choose a Model Configuration Path Choose the path that matches the access you have: | I have | Start here | |---|---| | An API key from a model provider or OpenHands | [Configure a Model in Agent Canvas](/openhands/usage/agent-canvas/model-configuration) | | A local model server such as Ollama, LM Studio, vLLM, or SGLang | [Run Local LLMs with OpenHands](/openhands/usage/llms/local-llms) | | A LiteLLM proxy | [LiteLLM Proxy](/openhands/usage/llms/litellm-proxy) | | An OpenRouter API key | [Use OpenRouter with OpenHands](/openhands/usage/llms/openrouter) | | A DigitalOcean model access key | [Use DigitalOcean Inference with OpenHands](/openhands/usage/llms/digitalocean) | | Claude Code, Codex, or Gemini CLI credentials | [ACP Agents](/openhands/usage/agent-canvas/acp-agents) | For model-ID, endpoint, API-key, and recovery checks, use [Configure a Model](/openhands/usage/agent-canvas/model-configuration) before changing advanced settings. ## 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 | 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. 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). 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](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 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: - [AWS Bedrock](/openhands/usage/llms/aws-bedrock) - [Azure](/openhands/usage/llms/azure-llms) - [DigitalOcean](/openhands/usage/llms/digitalocean) - [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. ### 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 [llm] num_retries = 4 retry_min_wait = 5 retry_max_wait = 30 retry_multiplier = 2 ```