DEV Community

Cover image for OpenHands: The 91k-Star Open-Source Devin Alternative That Runs Fully Local
Syed Anzar
Syed Anzar

Posted on

OpenHands: The 91k-Star Open-Source Devin Alternative That Runs Fully Local

OpenHands: The 91k-Star Open-Source Devin Alternative That Runs Fully Local

Devin costs $500/month per seat. Most teams never even get off the waitlist. Meanwhile, the open-source alternative that scores at the top of SWE-bench Verified has been sitting on GitHub with 91,000+ stars — free, MIT-licensed, and ready to run on your laptop right now.

If you're a developer who's watched the AI coding agent space, you've heard the name. But most people still think "open-source Devin alternative" means "worse version of Devin." That's not what OpenHands is.


What OpenHands Actually Is

OpenHands (formerly OpenDevin) is a platform for software engineering agents — not a single agent, but a runtime, SDK, and control center that lets you run coding agents the same way you'd run containers: locally, in Docker, on a VM, or in your own cloud infrastructure.

It started as an academic project (CMU, UIUC, Alibaba, All Hands AI) and evolved into the most complete open-source implementation of a "generalist software developer agent" — an agent that can:

  • Read and write files in a real repository
  • Execute bash commands and run tests
  • Browse the web for documentation
  • Create GitHub pull requests with reviewable diffs
  • Delegate to specialized sub-agents

All inside a Docker sandbox so it can't trash your system.


The Architecture That Makes It Work

Most "AI coding tools" are thin wrappers around an LLM API. OpenHands is different — it's a three-layer system:

1. Event Stream Architecture (The Nervous System)

Agents, environments, and UIs communicate through a structured event stream — not ad-hoc function calls. Every action (bash command, file edit, browser navigation, agent message) is an event. Every observation (stdout, file diff, page content, test result) is an event.

This means:

  • Full replayability: you can replay an entire agent session from the event log
  • Multi-agent coordination: agents delegate by emitting events other agents consume
  • Observability: the UI shows you every step the agent took, in order, with timestamps

2. Sandboxed Runtime (The Hands)

The agent doesn't run on your host. It runs inside a Docker container with:

  • A bash shell (full Linux environment)
  • A headless Chromium browser (for web search, reading docs, testing UIs)
  • An IPython/Jupyter kernel (for data analysis, plotting, notebook-style work)
  • Git, pip, npm, cargo, go — the whole toolchain

The sandbox is ephemeral by default — each conversation can get a fresh container. But you can also mount your local workspace (/projects) so the agent edits your actual code.

3. Agent-Computer Interface / Agent-Client Protocol (The Skills)

OpenHands defines a tool set the agent can invoke:

Tool Category Capabilities
File System Read, write, edit, list, glob, grep
Shell Execute commands with streaming output, background processes
Browser Navigate, click, fill, scroll, extract text, screenshot
Git Diff, commit, push, create PR, review
MCP Call any Model Context Protocol server
Custom You define your own tools in Python

The key insight: the agent doesn't "know" how to code. It knows how to use tools that let it interact with a codebase like a human developer would.


The Agent Itself: CodeAct

The flagship agent uses the CodeAct architecture — instead of emitting JSON function calls, the agent writes executable Python code blocks that call the tool APIs directly.

# Agent thinks, then writes:
Enter fullscreen mode Exit fullscreen mode


python

Read the failing test to understand the bug

test_content = file_read("tests/test_auth.py")
print(test_content)


# Environment executes, returns output
Enter fullscreen mode Exit fullscreen mode


markdown

Why this matters:

  • Composability: The agent can write loops, conditionals, variables — not just single tool calls
  • Debuggability: You see the exact code the agent ran
  • Expressiveness: Complex workflows (search → analyze → edit → test → commit) become a single coherent script

What You Can Actually Do With It Today

Run It Locally (Zero Cost, Your API Keys)

# Option 1: Quick start (no sandbox — full filesystem access)
npm install -g @openhands/agent-canvas
agent-canvas

# Option 2: Docker sandbox (recommended)
export PROJECTS_PATH="$HOME/projects"
mkdir -p "$PROJECTS_PATH" "$HOME/.openhands"

docker run -it --rm \
  -p 127.0.0.1:8000:8000 \
  -v "$HOME/.openhands:/home/openhands/.openhands" \
  -v "${PROJECTS_PATH}:/projects" \
  ghcr.io/openhands/agent-canvas:1.32.0
Enter fullscreen mode Exit fullscreen mode

Open http://localhost:8000, add your Anthropic/OpenAI/OpenRouter/local LLM key, and you're live.

Use the CLI for Terminal-Native Workflows

# Install the SDK
pip install openhands-sdk

# Run a one-off task
openhands --task "Add unit tests for the auth module" --workspace ./my-project
Enter fullscreen mode Exit fullscreen mode

Automate With the Automation Server

The Automation Server (separate repo: OpenHands/automation) lets you run agents on schedules or webhooks:

  • "Every Monday, check for dependency updates and open PRs"
  • "On GitHub issue labeled bug, spawn an agent to reproduce and fix"
  • "Nightly: run the test suite, if failures appear, create a fixing agent"

This is where OpenHands becomes a team member — not a chat tool.


OpenHands vs. Devin: The Real Differences

Dimension Devin OpenHands
License Proprietary MIT (core)
Local execution No (cloud only) Yes (CLI, GUI, Docker)
Self-hosting Enterprise plan only Local Docker, VM, VPC
Model choice Vendor-locked Any LLM (Claude, GPT, Ollama, Bedrock, OpenRouter)
Sandbox Managed Your Docker, your rules
Cost $500/seat/mo Your compute + API keys
Source visibility Closed Full source, auditable
ACP support No Yes — run Claude Code, Codex, Gemini, Pi, OpenCode

The trade-off: Devin is a polished managed service. OpenHands is a platform you operate. If you want zero ops, pay Devin. If you want control, auditability, and no per-seat licensing, OpenHands.


The SDK: Build Your Own Agents

The Software Agent SDK (OpenHands/software-agent-sdk) is a clean Python/TypeScript/REST API for building custom agents.

from openhands.sdk import Agent, Tool, Conversation

# Define a custom tool
@Tool
def run_linter(file_path: str) -> str:
    result = subprocess.run(["ruff", "check", file_path], capture_output=True, text=True)
    return result.stdout

# Build an agent with your tools
agent = Agent(
    llm="anthropic/claude-3-5-sonnet-20241022",
    tools=[run_linter, "bash", "file_edit", "git"],
    system_prompt="You are a code quality specialist..."
)

# Run it
conversation = Conversation(agent)
conversation.run("Fix all lint errors in src/")
Enter fullscreen mode Exit fullscreen mode

This is how teams build specialized agents — security auditors, dependency updaters, test generators, migration bots — without fighting a generic chat interface.


Benchmarks: It's Not a Toy

OpenHands agents consistently rank at the top of SWE-bench Verified (the gold standard for "can an agent fix real GitHub issues in real repos").

As of v1.32.0 (released 9 hours ago as of this writing):

  • SWE-bench Verified: Top-tier pass rate
  • SWT-bench (test generation): Leading
  • Multi-SWE-bench (multi-repo): Strong

The research team publishes their agent implementations openly — you can inspect exactly how the top-performing agent works.


What's Still Rough

Honest assessment:

  • Setup friction: Docker + LLM API keys + (optionally) sandbox config — not "one click"
  • Task scoping: Vague prompts ("make the app better") fail. Works best with ticket-style input: repo + issue description + acceptance criteria + verification command
  • Enterprise features: RBAC, audit logs, SSO, policy enforcement live in the enterprise/ directory under a different license (PolyForm Free Trial). Core is MIT; enterprise is not.
  • Resource needs: Local GUI needs Docker. Local LLMs need serious GPU VRAM (24GB+ for 70B models). Cloud LLMs need API budget.

Why This Matters for Developers

The AI coding agent category is splitting into two tiers:

  1. Managed SaaS (Devin, Cursor Background Agent, GitHub Copilot Workspace) — convenient, expensive, opaque, vendor-locked
  2. Self-hosted platforms (OpenHands, SWE-agent, Aider) — transparent, model-agnostic, extensible, you operate it

OpenHands is the most complete implementation of tier 2. It's not a prototype — it's a production-grade platform with 600+ contributors, 8,700+ commits, 154 releases, and active daily development.

If you're building internal developer tooling, evaluating AI agents for your team, or just want to understand what "autonomous coding agent" actually looks like under the hood — clone it, run it, read the source. That's the point of open source.


Links


Published as part of the DEV-2 Open-Source GitHub Repository series — deep dives into high-quality open-source tools that replace expensive SaaS.

Top comments (0)