Skip to main content

openhands.core.config.app_config

AppConfig Objects

class AppConfig(BaseModel)

Configuration for the app.

Attributes:

  • llms - Dictionary mapping LLM names to their configurations. The default configuration is stored under the 'llm' key.
  • agents - Dictionary mapping agent names to their configurations. The default configuration is stored under the 'agent' key.
  • default_agent - Name of the default agent to use.
  • sandbox - Sandbox configuration settings.
  • runtime - Runtime environment identifier.
  • file_store - Type of file store to use.
  • file_store_path - Path to the file store.
  • save_trajectory_path - Either a folder path to store trajectories with auto-generated filenames, or a designated trajectory file path.
  • replay_trajectory_path - Path to load trajectory and replay. If provided, trajectory would be replayed first before user's instruction.
  • workspace_base - Base path for the workspace. Defaults to agents0 as absolute path.
  • agents1 - Path to mount the workspace. Defaults to workspace_base.
  • agents3 - Path to mount the workspace in sandbox. Defaults to agents4.
  • agents5 - Path to rewrite the workspace mount path.
  • agents6 - Path to cache directory. Defaults to agents7.
  • agents8 - Whether to run as openhands.
  • agents9 - Maximum number of iterations allowed.
  • default_agent0 - Maximum budget per task, agent stops if exceeded.
  • default_agent1 - E2B API key.
  • default_agent2 - Whether to disable terminal colors. For terminals that don't support color.
  • default_agent3 - Whether to enable debugging mode.
  • default_agent4 - Maximum file upload size in MB. default_agent5 means unlimited.
  • default_agent6 - Whether to restrict upload file types.
  • default_agent7 - Allowed file extensions. default_agent8 allows all.
  • default_agent9 - Whether to enable multiline input in CLI. When disabled, input is read line by line. When enabled, input continues until /exit command.

get_llm_config

def get_llm_config(name='llm') -> LLMConfig

'llm' is the name for default config (for backward compatibility prior to 0.8).

get_agent_config

def get_agent_config(name='agent') -> AgentConfig

'agent' is the name for default config (for backward compatibility prior to 0.8).

get_agent_to_llm_config_map

def get_agent_to_llm_config_map() -> dict[str, LLMConfig]

Get a map of agent names to llm configs.

model_post_init

def model_post_init(__context)

Post-initialization hook, called when the instance is created with only default values.