| Adrià Vilanova MartÃnez | f8196c1 | 2025-05-15 16:07:01 +0200 | [diff] [blame] | 1 | # LLM usage |
| 2 | |
| 3 | To build the initial version of this project, I experimented with an LLM model: |
| 4 | Gemini Pro 2.5 (experimental). This page contains a description of how the |
| 5 | experiment went, and what things I learnt. |
| 6 | |
| 7 | ## How it went |
| 8 | |
| 9 | - At first, I wasn't sure of what my needs were or what I needed to build. So I |
| 10 | started by explaining Gemini what my initial needs were (building a Cadiretis |
| 11 | clone for nostalgic reasons, and the fact that I needed to track my working |
| 12 | locations), and asked it to help me create the project plan you can read at |
| 13 | [//docs/project_plan](./project_plan/README.md). |
| 14 | - Iteratively, we created the project plan section by section, sometimes |
| 15 | reviewing previous sections as well. We finally reordered some of the |
| 16 | information and sections in order to make it clearer for a first-time reader, |
| 17 | since some concepts appeared before they were explained. |
| 18 | - Once that was done, I asked Gemini to generate the code directly. This |
| 19 | resulted in a code soup, which I had to heavily refactor afterwards. Although |
| 20 | the initial commit incorporates this refactor, some bad code was still left |
| 21 | not refactored due to lack of time. |
| 22 | |
| 23 | ## Things I've learnt |
| 24 | |
| 25 | - Instead of asking the model to directly output code, I will try to instruct |
| 26 | the model to follow a development cycle. For instance, I might want to |
| 27 | incorporate TDD into the process. |
| 28 | - Next time I will make sure to ask for unit tests in the technical |
| 29 | requirements. |
| 30 | - I asked the LLM to use Bazel as the build system, but I wasn't too much |
| 31 | familiarized with it, so the road was bumpy. I learned it's better to learn |
| 32 | about a tool before asking a LLM to use it (note for the future: maybe LLMs |
| 33 | can still help in the learning process?), since the decisions that the LLM |
| 34 | takes are not sometimes the best ones, and some issues I had would have |
| 35 | easily been fixed if I had read the documentation beforehand. |
| 36 | - I quickly took over after the initial version, due to some issues with the |
| 37 | code and the fact that it was painful to instruct the AI to fix the issues. I |
| 38 | might want to try having a more educational approach with the model in the |
| 39 | future. |
| 40 | - Related to the previous point: using [Gemini's web UI][gemini] for building a |
| 41 | codebase was painful. I tried to use the canvas feature, but it was hard to |
| 42 | sync local changes to the generated Canvas (so sometimes I kept the changes |
| 43 | locally), and it took a lot of time for the model to regenerate it. Towards |
| 44 | the end, Gemini started to create a lot of canvases so I ended up with |
| 45 | duplicate files and a whole mess. Maybe AI agents (see |
| 46 | [avante.nvim][avante-nvim]) can help alleviate this pain point? It's |
| 47 | something to research for the future. |
| 48 | |
| 49 | [gemini]: https://gemini.google.com/ |
| 50 | [avante-nvim]: https://github.com/yetone/avante.nvim |