2. Tech Stack
openhands-2
| Language |
Usage |
Percentage (approx) |
| Python 3.12-3.13 |
Backend: agent framework, LLM integration, runtime, server |
~70% |
| TypeScript/React |
Frontend: web UI, editor, terminal |
~25% |
| Jinja2 |
System prompt templates |
~3% |
| Shell/Docker |
Build, deployment, containerization |
~2% |
| Package |
Version |
Purpose |
Why This Choice |
fastapi |
Latest |
REST API server |
Async-first, automatic OpenAPI docs, dependency injection |
uvicorn |
Latest |
ASGI server |
High-performance async HTTP server |
pydantic |
v2 |
Data validation, config |
Type-safe configuration with env var support |
sqlalchemy[asyncio] |
^2.0.40 |
ORM for persistence |
Async support, mature ecosystem |
python-socketio |
Latest |
WebSocket communication |
Real-time bidirectional event streaming |
| Package |
Version |
Purpose |
Why This Choice |
litellm |
>=1.74.3 |
Multi-provider LLM router |
Single interface for 100+ LLM providers (OpenAI, Anthropic, Google, etc.) |
anthropic[vertex] |
Latest |
Claude API client |
Direct Anthropic access + Google Vertex AI |
openai |
2.8 |
OpenAI API client |
GPT models access |
google-genai |
Latest |
Google Gemini client |
Gemini model access |
tiktoken |
Latest |
Token counting |
Accurate tokenization for OpenAI models |
Why LiteLLM? It's the key architectural decision. Rather than implementing provider-specific code for each LLM, LiteLLM provides a unified completion() interface. OpenHands wraps this in openhands/llm/llm.py with additional retry logic, metrics, caching, and function-call conversion.
| Package |
Version |
Purpose |
openhands-sdk |
1.17.0 |
V1 agent core (actions, observations, event loop) |
openhands-agent-server |
1.17.0 |
V1 application server |
openhands-tools |
1.17.0 |
Agent tool implementations |
| Package |
Version |
Purpose |
docker |
Latest |
Docker container management |
kubernetes |
>=33.1 |
K8s pod management for enterprise |
e2b-code-interpreter |
Optional |
E2B cloud sandbox |
daytona |
Optional |
Daytona cloud workspace |
modal |
Optional |
Modal serverless runtime |
runloop-api-client |
Optional |
RunLoop runtime |
| Package |
Version |
Purpose |
playwright |
^1.55.0 |
Browser control (Chromium) |
browsergym-core |
0.13.3 |
Browser environment abstraction for RL-style interaction |
| Package |
Version |
Purpose |
boto3 |
Latest |
AWS S3 storage backend |
google-cloud-aiplatform |
Latest |
Google Cloud integration |
| Package |
Version |
Purpose |
tenacity |
Latest |
Retry logic with exponential backoff |
jinja2 |
Latest |
Prompt template rendering |
toml |
Latest |
Configuration file parsing |
python-multipart |
Latest |
File upload handling |
pyperclip |
Latest |
Clipboard integration (CLI) |
| Package |
Version |
Purpose |
react |
^19.2.3 |
UI framework |
react-router |
^7.12.0 |
Routing (with React Server Components support) |
vite |
^7.3.1 |
Build tool and dev server |
typescript |
^5.8.3 |
Type safety |
| Package |
Version |
Purpose |
@heroui/react |
^2.8.7 |
Component library |
tailwindcss |
^4.1.8 |
Utility-first CSS |
framer-motion |
^12.28.1 |
Animations |
@monaco-editor/react |
^4.7.0-rc.0 |
Code editor (VS Code engine) |
@xterm/xterm |
^6.0.0 |
Terminal emulator |
| Package |
Version |
Purpose |
zustand |
^5.0.10 |
Lightweight state management |
@tanstack/react-query |
^5.90.19 |
Server state management, caching |
axios |
^1.13.5 |
HTTP client |
socket.io-client |
^4.8.3 |
WebSocket client |
| Package |
Version |
Purpose |
i18next |
^25.8.0 |
Internationalization framework |
react-i18next |
^15.5.2 |
React bindings for i18n |
| Tool |
Purpose |
poetry (^2.3.3) |
Python dependency management (primary) |
uv |
Alternative Python package manager (lock file present) |
make |
Build automation (372-line Makefile) |
docker / docker-compose |
Containerized deployment |
ruff |
Python linting and formatting |
mypy |
Python type checking |
eslint / prettier |
JavaScript/TypeScript linting |
vitest |
Frontend unit testing |
pytest |
Backend testing |
playwright |
E2E browser testing |
pre-commit |
Git hook management |
- ML/AI ecosystem is Python-first (LLM libraries, data processing)
- FastAPI provides excellent async support for concurrent agent sessions
- Rich library ecosystem for Docker, Kubernetes, cloud providers
- Monaco Editor (VS Code engine) provides best-in-class code editing
- xterm.js provides realistic terminal emulation
- Socket.IO enables real-time event streaming from agent
- Vite 7 with React Router 7 enables modern RSC patterns
- Avoids vendor lock-in -- users can switch models without code changes
- Handles provider-specific quirks (parameter mapping, auth, rate limits)
- OpenHands adds a custom layer on top (
fn_call_converter.py) for models without native function calling
- Complete audit trail of every agent action and observation
- Enables replay, debugging, and session recovery
- Supports concurrent subscriptions (controller, runtime, server, memory)
- Natural fit for streaming to frontend via WebSocket