GHPT - Generates a Grasshopper Script from a prompt with Chat GPT

hi Dani_Abalde
I try tio install or setup this plug, but it does`t work,can you share it?
THX

This is a great project, congrats :clap:

Clearly, in practice it currently has limited value as quality output is not quite there (yet), but is great for 24hrs work. Also, the framework is all there and I think there’s more that can be eeked out.

I’d love to see how far this can be taken. I am curious about LLM usecases in AEC and this is a great little toy example to learn from.

Some initial thoughts:

  • temperature is currently 0.7, I have seen examples where people would use 0.0 for tasks like this where the format and context of the output is quite specific.
  • in your prompt you don’t allow the llm to generate the reasoning part and skip straight to json, this means that you are skipping potential for chain of thought.
  • one common failure case (at least for gpt 3.5) is incorrect json formatting. Some better prompting to explain the format would help, as well as a potential post-processing method to fix broken json. Langchain has some good implementation.
  • another common failure case is that the model will declare that the prompt is “too complex”, but I found that when you remove this option from the prompt it does a half decent job so maybe this could be removed as it tends to give up too easily.

These are just some quick wins but I’d love to discuss some more advanced stuff. Could RAG be used somehow to help with relevant examples or to lookup specific available components for example?

FWIW I am not that bothered by latency, I think quality is more important here.

1 Like

would it be possible to do the reverse, post a s gh file or a printscreen of a script and ask your GHPT to make a phython/C# equivalant to tidy everything up, and make it more modular and maybe faster? Would these new custom GPT’s be able to be trained for this?

1 Like

I think this is likely possible. Creating a kind of CoPilot for GH could be done relatively easily

This is a lot of really helpful advice, thankyou! We were quite new to LLM training and prompting so I really appreciate all the advice :blush:

1 Like

No worries. I have written a small PR for some quick wins, mainly fixing json errors in the prompt which I found were confusing the llm. I also fixed the CoT error I nentioned. Please review :pray:

1 Like

Thankyou very much @samgregson I’ve approved the PR.

Apologies, but none of us are are actively working on GHPT at the moment. I’m swamped writing Crash currently. But I am happy to take a look at every PR you create and help get it merged :blush:

– cs

I have written another PR which again improves the JSON formatting in the prompt (I’m surprised how sensitive some of the smaller LLMs are with the exact formatting of JSON) but also lowers the temperature from 0.7 to 0.0 as “creativity” is not the aim here (there is a current bug where although there is a T input it doesn’t do anything).

I have another branch where I introduce some other models from http://www.together.xyz if anyone is interested? They have Llama, CodeLlama, Mixtral etc.

I am very much using this as an excuse to learn about LLMs, and hope that my ramblings here are useful to someone.

3 Likes

Sounds fascinating! I’ll see if I can take a look and review then :grin:

Hey,

Posting this here since there seems to be a great level of interest in AI-Copilots for Grasshopper. We have developed Loome, a Grasshopper plugin that addresses some of the challenges you’ve been talking about here.

Loome enhances Grasshopper workflows by:

  1. Autocompleting component sets
  2. Automatically placing objects on the canvas with their connections
  3. Significantly reducing the time to arrive at design solutions

Without taking away from the incredible effort gone into GHPT, we think Loome resolves some of its issues:

  • Speed: Loome takes 1s to get a response. No 30s - 1min wait times for a call to OpenAI API.
  • Cost: No tokenised API costs.
  • Reliability: It’s built to understand Grasshopper components and connections accurately.

Given the interest shown in this thread, we’d love your thoughts on Loome. If you’re keen to try it out or learn more, check out our website at loome.ai or give us your initial impressions on this thread.
We’d like to work with the Grasshopper community to push AI-assisted parametric design forward.