RunAnyThing (RAT) is an LLM-powered Agent automated build system designed to analyze GitHub repositories and automatically construct executable environments within Docker containers. The system could autonomously handle dependency installation, environment configuration, and build testing.
- Python: 3.12+
- Docker: 20.10+ (see Docker Installation Guide)
- LLM Providers: DeepSeek, OpenAI, GLM, Qwen, or local provider such as Ollama
- GitHub Personal Access Token: Optional, but recommended to avoid GitHub API rate limits and to access private repositories
-
Clone the repository:
git clone https://github.com/gemelom/RunAnyThing.git cd RunAnyThing -
Install dependencies with uv:
uv sync
-
Configure Environment Variables:
Copy the template and fill in your credentials:
cp .env.example .env export UV_ENV_FILE=.envEdit the
.envfile with your API keys:# LLM API Keys (At least one required) DEEPSEEK_API_KEY=your_deepseek_api_key_here OPENAI_API_KEY=your_openai_api_key_here # GitHub Token (optional but recommended) GITHUB_TOKEN=your_github_token_here
-
Run the Streamlit Interface:
uv run streamlit run rat/app.py
Open the displayed address (usually
http://localhost:8501) in your browser.
If you need to run from the CLI interface or the full web application (FastAPI + React), please refer to this section.
uv run rat/cli.py --full_name "owner/repo" --root_path . --llm deepseek-chat--full_name: GitHub repository (Format:owner/repo).--root_path: Working directory path (Default: current directory).--llm: LLM model to use (Default:deepseek-chat).--num_turn: Maximum iterations for the Agent (Default:25).--save_mode: Options:none: Do not save (Default).dockerfile: Save the generated Dockerfile.image: Save as a local Docker image.
--use-dockerfile: Use the repository's own Dockerfile (if exists) to build the image.--custom-plan: Use custom plan mode; LLM will use or create a/repo/plan.mdfile to guide environment configuration.--use-uv: Useuvas the Python package manager instead of pip/poetry.--timeout: Command execution timeout in seconds (Default:300).
# Basic run
uv run rat/cli.py --full_name "streamlit/streamlit-example" --root_path . --llm deepseek-chat
# Save as Dockerfile/Docker Image
uv run rat/cli.py --full_name "owner/repo" --root_path . --save_mode dockerfile
uv run rat/cli.py --full_name "owner/repo" --root_path . --save_mode image
# Use the repo's own Dockerfile
uv run rat/cli.py --full_name "owner/repo" --root_path . --use-dockerfileThe project provides two web interfaces for ease of use:
A lightweight Streamlit-based web interface offering:
- Intuitive Form Interface: Easily input all CLI parameters.
- Real-time Streaming Output: Monitor the build process as it happens.
- One-Click Execution: Run tasks and view results instantly.
uv run streamlit run rat/app.pyA production-ready web application with a FastAPI backend and React + TypeScript frontend, providing a richer experience:
- Real-time Progress Tracking: SSE-based live updates across a 5-stage pipeline (Cloning β Analyzing β Building β Configuring β Testing).
- Interactive Container Terminal: Execute commands directly in running Docker containers.
- Repository Analysis: Static code analysis with metrics, dependency detection, and critical function identification.
- ZIP Upload Support: Configure environments for local repositories.
- Multi-language UI: Built-in i18n support (English & Chinese).
- Feedback System: User feedback collection with ratings and dashboard.
# Install app dependencies
uv sync --group app
# Start the backend
uv run uvicorn app.backend.main:app --reload
# Start the frontend
cd app/frontend && npm install && npm run devSee ratbench/README.md for benchmark evaluation scripts, dataset building tools, and directory structure.
- Automatically analyzes repository structures.
- Recommends optimal base images for Python, Java, Node.js, Rust, and Go.
- Identifies dependency managers (pip, poetry, conda, maven, npm, cargo, go modules, etc.).
- Installs dependencies automatically within Docker.
- Resolves dependency conflicts autonomously.
- Configures the runtime environment.
- Automatically discovers and executes tests.
- Validates that the environment is correctly configured.
- none: Ephemeral environment for quick testing.
- dockerfile: Generates a reusable
Dockerfile. - image: Commits the state to a local Docker image.
RunAnyThing/
βββ rat/ # Core agent package
β βββ cli.py # Main CLI entry point
β βββ app.py # Streamlit web interface
β βββ setupagent.py # Analysis Agent (recommends base image)
β βββ codeagent.py # Configuration Agent (installs deps & configures)
β βββ docker_executor.py # Docker command execution (subprocess-based)
β βββ config.py # Centralized config from .env
β βββ llm.py # Unified LLM interface (DeepSeek, GLM, OpenAI, Tongyi, Ollama)
β βββ memory.py # Three-tier memory system
β βββ tool_schemas.py # OpenAI-compatible tool definitions
β βββ host_tools.py # Host-side tool implementations (search, retrieve)
β βββ language_config.py # Abstract LanguageConfig base class
β βββ language_configs/ # Language-specific configs (Python, Java, Node.js, Rust, Go)
β βββ analysis/ # Analysis modules (static analysis, vulnerability scanning)
β βββ utils/ # Utility functions (language detection, Docker utils)
β βββ tools/ # Host-side tool scripts (retrieve_image, retrieve_issue, etc.)
β βββ dockerfile_templates/ # Dockerfile template system (with version management)
β βββ tests/ # Unit tests
β βββ ...
βββ app/ # Full-stack web application
β βββ backend/ # FastAPI backend (SSE, Docker management, analysis API)
β βββ frontend/ # React + TypeScript frontend (Vite, Tailwind, i18n)
βββ ratbench/ # Benchmark, evaluation, and dataset package (see [ratbench/README.md](ratbench/README.md))
βββ pyproject.toml # Python project metadata and dependencies
- Clone: Downloads the repo from GitHub.
- Analyze:
SetupAgentscans the code and recommends a base image. - Create: A Docker container is initialized based on recommendations.
- Configure:
CodeAgentperforms terminal operations to set up the environment. - Export: Results are saved according to the selected
save_mode.
Depending on the selected mode, run artifacts may be stored under output/<owner>/<repo>/, such as generated Dockerfiles, execution summaries, and other local debugging files.
| Language | Language Config | Template | Test Runner |
|---|---|---|---|
| Python | python_config.py |
python.template |
pytest |
| Java | java_config.py |
java.template |
Maven/Gradle |
| Node.js | nodejs_config.py |
javascript.template |
npm test |
| Rust | rust_config.py |
rust.template |
cargo test |
| Go | go_config.py |
go.template |
go test |
Q: Does it clean up Docker containers?
A: Yes, containers are automatically stopped and removed after the process finishes unless you use --save_mode.
Q: Which languages are supported?
A: Currently Python, Java, Node.js, Rust, and Go are supported. New languages can be easily extended by adding a LanguageConfig implementation and a Dockerfile template.
- Token consumption tracking per tool call.
- Support for multiple languages (Python, Java, Node.js, Rust, Go).
- Optimization of Agent logic to reduce error rates.
- Success rate statistics and analysis.
- RAG system for issue retrieval (
retrieve_issue). - Dynamic image switching during configuration (
change_image).
- Web UI (Streamlit).
- Full-stack Web Application (FastAPI + React).
- Real-time configuration progress display.
- Parallel processing for multiple repositories.
- Caching for common dependencies and images.
Apache License 2.0
@misc{huang2026ratrunanythingfullyautomated,
title={RAT: RunAnyThing via Fully Automated Environment Configuration},
author={Renhong Huang and Dongdong Hua and Yifei Sun and Sitao Ding and Hanyang Yuan and Daixin Wang and Yang Yang},
year={2026},
eprint={2604.23190},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2604.23190},
}

