About oTree AI Builder (OTAI)
OTAI follows your instructions and writes oTree apps for you.
See blog post: Introducing OTAI
How to use it:
- Open OTAI.
- Create a project
- Click the button to select a folder on your PC's hard drive where you will store your oTree project.
You must use Chrome or Edge or another browser that supports
showDirectoryPicker. - Chat with the AI, tell it what you want to build. It will automatically save what it generates to the folder you chose.
- Install oTree 6 on your PC. Open your command line / terminal to the folder you chose, and run "otree devserver"...
- Make some more changes in the oTree AI Builder. Your server will automatically load the changed files, and you can reload to see your changes
More info
Static files (images/audio/video)
You can add images / video / audio etc files to your project without uploading them to OTAI.
Just put them in the _static/ subfolder.
If you want OTAI to know about them, check the checkbox in the chat UI to include a list of your static files
along with your message. For example, if you add a file _static/animals/cat.jpg,
then when you send the next chat message to OTAI
check the checkbox with your next message. OTAI will then know the locations of all your files,
so if you tell it to add an image with your cat picture, it will insert {{ static 'animals/cat.jpg' }}.
Viewing your code
Just open a text editor like VS Code to your folder, and you can see the current code.
Setting a Topic
You can indicate what app you are talking about by selecting the appropriate radio button.
Managing conversations
In each conversation, you can only send a fixed number of messages. Each conversation starts fresh, with no memory of previous conversations. Give as many details you can upfront in the first message. Subsequent messages should be follow-ups. Conversations are meant to be short and just focus on one topic.
FAQ
How is OTAI better than using ChatGPT / Gemini / etc to build my experiments?
OTAI's LLM is specially trained to write oTree code. Furthermore, the OTAI system does not let the LLM directly write code. Instead, the LLM provides instructions and then the OTAI system writes the actual code. As a result, it prevents hallucinations and filters out various types of invalid code.
We have seen first-hand how much of a researcher's time an LLM can waste by building something that looks promising at first, but fails to ever converge on a correct solution, or falls apart as the complexity increases. especially considering the high standards of correctness demanded by research.
The code you get with OTAI will be much more consistent than anything you can get with a general-purpose LLM.
Can I modify files directly on my PC and sync them back to OTAI?
No. OTAI does not sync changes you made locally, and will overwrite your files
(but you can freely add top-level files like README.md or folders that start with a dot like .git/).
How do I test the changes locally?
In your command line, go to the folder selected above, and enter otree devserver.
Then go to your browser and open http://localhost:8000/.
When you make changes in OTAI, the server will automatically reload and you can see your changes.
Do I download an .otreezip file?
No, instead of a single .otreezip, OTAI downloads all your individual files (.py, .html, etc) to the selected folder on your PC as described above.
If you want to deploy to Heroku, go to that folder on your PC, open your command line, and enter otree zip.
That will generate the .otreezip file that you can deploy to Heroku.
After OTAI makes a style change (CSS), my page still looks the same
Do a full browser reload (hold "Ctrl" and press the reload button, or Ctrl+F5). This is necessary because sometimes the browser is still using an old cached version of your CSS.
Does OTAI remember previous conversations?
No. Each time you start a conversation, it starts fresh.
Where can I get help with using OTAI?
Ask on our Discord server or Forum.
Can I "vibe-code" (build apps without reading the code at all?)
If you're doing relatively simple things, this can work. However, if you have a more complex experiment, or if you start to see that the AI is consistently implementing your design incorrectly, we recommend reading the code it writes and gaining an understanding of what it's doing.
The more you supervise what it's doing, and the more you understand oTree's concepts, the better your results will be. You should open the project folder in a text editor like VS Code, and consult the oTree documentation to understand the meanings of the different functions and classes.
The AI keeps messing up; it's not fixing my problem and is introducing new problems
It's possible that the AI has gotten stuck or confused about a problem. You can help guide it out of the hole. Try reading the section of code it's been working on (open the project folder in a text editor like VS Code), and understand for yourself what the code is doing (consult the oTree documentation as necessary) and give guidance to the LLM. It's possible that the code has unintentionally gotten too complex over time, or that there are multiple competing priorities that it is having a difficult time trying to satisfy.