Ditto - the simplest self-building coding agent.
Ditto is a user-friendly tool that allows you to generate a multi-file Flask application from simple natural language descriptions using a no-code interface. By leveraging a simple LLM loop with a few tools, Ditto automates the coding process, (occasionally) turning your ideas into functional web applications (or at least trying and getting close).
- Simple Natural Language Input: Just describe the application you want to build in plain English.
- Automated Code Generation: Generates routes, templates, and static files based on your description.
- Self-Building Agent: Automatically plans and constructs the application without the need for manual coding.
- Modular Structure: Organizes code into a clean, modular structure with separate directories for templates, static files, and routes.
- Python 3.7 or higher
pip
package manager
-
Clone the Repository
git clone https://github.com/yoheinakajima/ditto.git cd ditto
-
Create a Virtual Environment (Optional but Recommended)
python3 -m venv venv source venv/bin/activate # On Windows, use venv\Scripts\activate
-
Install Dependencies
pip install litellm
To use Ditto, you'll need to set the OPENAI_API_KEY
in your environment. Here are two options for doing that:
For macOS/Linux:
export OPENAI_API_KEY=your-openai-api-key
For Windows (Command Prompt):
set OPENAI_API_KEY=your-openai-api-key
For Windows (PowerShell):
$env:OPENAI_API_KEY="your-openai-api-key"
Run the application:
python main.py
-
Install the
python-dotenv
package to load environment variables from a.env
file:pip install python-dotenv
-
Create a
.env
file in the root of the project directory and add your API key:OPENAI_API_KEY=your-openai-api-key
-
Run the application as usual:
python main.py
-
Run the Application
python main.py
-
Access the Web Interface
Open your web browser and navigate to
http://localhost:8080
. -
Describe Your Application
On the home page, you'll find a form where you can describe the Flask application you want to create.
-
Monitor Progress
After submitting your description, the application will process your request. You can monitor the progress in real-time.
-
View the Generated Application
Once the process is complete, you can rerun the Flask app to interact with your newly generated Flask application.
python main.py
This is a quick exploration, so I have no plans to work on this further. Contributions are welcome, especially if they are awesome, but ping me on X/Twitter because I don't check PRs often. I'm basically going to try to bake this into the new BabyAGI framework, but give it the ability to store and save functions from the database. If this sounds like a fun challenge and you get it working, definitely let me know :)
This project is licensed under the MIT License - see the LICENSE file for details.