A lightweight AI agent system powered by SmolAgents and Ollama that executes tasks in a sandboxed Docker environment.
- Shell command execution in isolated Docker containers
- File writing and management
- Web search capabilities via DuckDuckGo
- Uses Qwen 2.5 Coder (1.5B) model for fast, efficient operation
- Interactive task-based interface
- Python 3.9+
- Docker
- Ollama with qwen2.5-coder:1.5b-instruct model
- Install dependencies:
pip install smolagents docker litellm- Pull the required model in Ollama:
ollama pull qwen2.5-coder:1.5b-instruct- Ensure Docker is running on your system
Run the agent:
python devin.pyEnter tasks when prompted. The agent will:
- Execute shell commands in the sandbox
- Write files to the workspace directory
- Search the web for information
- Verify results before providing answers
Type exit or quit to stop the agent.
The agent automatically creates a Docker container named smol_devin_sandbox. The workspace directory is mounted to /app inside the container for file access.
To build a custom image (optional):
docker build -t smol-devin-image .Edit these variables in devin.py to customize:
MODEL_ID: Change the LLM modelAPI_BASE: Ollama server URLCONTAINER_NAME: Docker container nameWORKSPACE_DIR: Local workspace path