We are experimenting with using CURSOR (https://www.cursor.com/) as an AI dev environment for Anvil apps where a project in Cursor is linked to the clone of an Anvil Github project. For the client and server coding part this works pretty well. Now we want to try to let AI code Anvil forms in Yaml. But so far not very successfull.
Does anybody has some experience with this or tips on how to make AI understand Anvil forms/components?
I’ve been experimenting with using aider with locally running models but the results are, unsurprisingly, not as good as the paid ones.
For those, I’ve been using openrouter.ai (also via aider) so that I don’t have to spray cash around with each model provider and can chop and change at will.
Thanks for your reply and usefull tips. I will give it a try. But have you been able to instruct Aider to, for example, add Anvil components into the yaml code of an existing form? And if so, how did you do this?
I’ve tried several models. I had it try to infer structure from several yaml form examples and o1, R1, Sonnet 3.7, and every other model I tried didn’t get really anything to show up correctly in the Anvil editor.
There are several issues that I think would make this never work well (at least not soon).
As far as I know Anvil doesn’t share the spec for their yaml forms. What is valid, what isn’t, structure, div names, etc. It’s perfectly legal (at least in the US) to try to reverse engineer this but it’s a lot of work.
Since this isn’t public, it’s not in the models training data.
Even if you made your own reverse engineered spec, models hallucinate heavily with things they haven’t seen before. You will see tons of issues even with a detailed spec.
So I basically stopped trying. @owen.campbell 's solution of adding components via code works pretty well. I did something similar with PyQt (PySide6 actually). LLMs could take my direction pretty well and make arbitrarily complicated UI’s using code as long as I told it the issues and what I wanted. This was in 2023 though and models have gotten better.
Using that method I “vibe coded” a full Mac desktop application and launched it in the Mac app store. Since I knew Python I was able to at least understand the code, even if it was a totally new framework.