Implementation:OpenHands OpenHands Config Template
| Knowledge Sources | |
|---|---|
| Domains | Configuration, Deployment |
| Last Updated | 2026-02-11 21:00 GMT |
Overview
Reference configuration template documenting all available OpenHands settings with defaults and descriptions.
Description
The config.template.toml file serves as the authoritative reference for every configurable parameter in the OpenHands platform. It is organized into major sections: [core] (workspace, caching, iteration limits), [llm] (model selection, API keys, retry policies, safety settings), [agent] (tool toggles, browsing, Jupyter), [sandbox] (Docker settings, GPU, timeouts), [security] (confirmation mode, analyzers), [condenser] (history compression strategies), [kubernetes] (namespace, resources, PVCs), and [mcp] (server configurations).
Usage
Use this template when deploying or configuring an OpenHands instance. Copy to config.toml and customize values for your environment. This is the starting point for all deployment configurations.
Code Reference
Source Location
- Repository: OpenHands
- File: config.template.toml
- Lines: 1-536
Configuration Sections
[core]
workspace_base = "./workspace"
cache_dir = "/tmp/cache"
max_iterations = 100
[llm]
model = "anthropic/claude-sonnet-4-20250514"
api_key = ""
temperature = 0.0
[agent]
enable_browsing = false
enable_jupyter = false
[sandbox]
base_container_image = "nikolaik/python-nodejs:python3.12-nodejs22"
timeout = 120
[security]
confirmation_mode = false
[condenser]
type = "noop"
[kubernetes]
namespace = "openhands"
[mcp]
# Server configurations for SSE, SHTTP, stdio
Import
from openhands.core.config import OpenHandsConfig
# The template is loaded and parsed by OpenHandsConfig
I/O Contract
Inputs
| Section | Key Parameters | Type | Description |
|---|---|---|---|
| [core] | workspace_base, max_iterations, max_budget_per_task | string, int, float | Core runtime limits and paths |
| [llm] | model, api_key, temperature, top_p | string, string, float, float | LLM provider configuration |
| [agent] | enable_browsing, enable_jupyter | bool, bool | Agent capability toggles |
| [sandbox] | base_container_image, timeout | string, int | Sandbox environment settings |
| [condenser] | type | string | History compression strategy (noop, observation_masking, recent, llm, amortized) |
Outputs
| Name | Type | Description |
|---|---|---|
| OpenHandsConfig | object | Fully parsed configuration object used throughout the application |
Usage Examples
Minimal Configuration
[core]
workspace_base = "./workspace"
[llm]
model = "anthropic/claude-sonnet-4-20250514"
api_key = "sk-ant-..."
Production Configuration
[core]
workspace_base = "/data/workspace"
max_iterations = 200
max_budget_per_task = 5.0
[llm]
model = "anthropic/claude-sonnet-4-20250514"
api_key = "sk-ant-..."
num_retries = 5
retry_multiplier = 2.0
[sandbox]
base_container_image = "custom-image:latest"
timeout = 300
[security]
confirmation_mode = true