π OpenHands: AI-Driven Development
Add doc for local runtime (#7234)
Ryan H. Tran165c0cc42ef2
diff --git a/docs/modules/usage/runtimes.md b/docs/modules/usage/runtimes.mdindex 6ac91333d0..2e458e19b8 100644--- a/docs/modules/usage/runtimes.md+++ b/docs/modules/usage/runtimes.md@@ -10,6 +10,9 @@ We also support "remote" runtimes, which are typically managed by third-parties.They can make setup a bit simpler and more scalable, especiallyif you're running many OpenHands conversations in parallel (e.g. to do evaluation).+Additionally, we provide a "local" runtime that runs directly on your machine without Docker,+which can be useful in controlled environments like CI pipelines.+## Docker RuntimeThis is the default Runtime that's used when you start OpenHands. You might noticesome flags being passed to `docker run` that make this possible:@@ -118,3 +121,66 @@ bash -i <(curl -sL https://get.daytona.io/openhands)Once executed, OpenHands should be running locally and ready for use.For more details and manual initialization, view the entire [README.md](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/impl/daytona/README.md)++## Local Runtime++The Local Runtime allows the OpenHands agent to execute actions directly on your local machine without using Docker. This runtime is primarily intended for controlled environments like CI pipelines or testing scenarios where Docker is not available.++:::caution+**Security Warning**: The Local Runtime runs without any sandbox isolation. The agent can directly access and modify files on your machine. Only use this runtime in controlled environments or when you fully understand the security implications.+:::++### Prerequisites++Before using the Local Runtime, ensure you have the following dependencies installed:++1. You have followed the [Development setup instructions](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md).+2. tmux is available on your system.++### Configuration++To use the Local Runtime, besides required configurations like the model, API key, you'll need to set the following options via environment variables or the [config.toml file](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml) when starting OpenHands:++- Via environment variables:++```bash+# Required+export RUNTIME=local++# Optional but recommended+export WORKSPACE_BASE=/path/to/your/workspace+```++- Via `config.toml`:++```toml+[core]+runtime = "local"+workspace_base = "/path/to/your/workspace"+```++If `WORKSPACE_BASE` is not set, the runtime will create a temporary directory for the agent to work in.++### Example Usage++Here's an example of how to start OpenHands with the Local Runtime in Headless Mode:++```bash+# Set the runtime type to local+export RUNTIME=local++# Optionally set a workspace directory+export WORKSPACE_BASE=/path/to/your/project++# Start OpenHands+poetry run python -m openhands.core.main -t "write a bash script that prints hi"+```++### Use Cases++The Local Runtime is particularly useful for:++- CI/CD pipelines where Docker is not available.+- Testing and development of OpenHands itself.+- Environments where container usage is restricted.+- Scenarios where direct file system access is required.