Open AI for Grasshopper (.gha)

Hi there.

Here is an implementation of the OpenAI API for .NET: GitHub - betalgo/openai: OpenAI ChatGPT, Whisper, GPT-3 and DALL-E dotnet SDK, that I made quickly to play with the OpenAI API from Grasshopper.

I’ve been convinced for a long time that Grasshopper is a perfect editor for AI, although it still lacks some fundamental things (like N-dimensional vector operations, matrix operations, better text input, loops, async canvas…), it has a huge potential to enhance the experience of AI computing, since most of the time is spent manipulating data.

Anyway, it’s a lot of fun to have these tools on hand (even though they are paid), and I wanted to share them with you. I have a couple of ideas that, although they require a lot of work, two days ago I thought they would be possible in the distant future and now I see that it is possible right now, so it’s quite exciting. I have tested that GPT allows you to title a secuence of components just by reading the definition (obviously there is preprocessing). I does a decent job on small definitions (less than 10 components or so) and having some groups or nicknames defined by the user. But this is without re-training or fine-tunning or without embedding input data, it is just using prompt engineering during a couple of hours! So it seems like teaching an AI to use Grasshopper is already theoretically possible, but due to its complexity it is very expensive to do and use it (for the moment, at least using prompt engineering). Please get in touch if you are aiming for this or a similar goal.

Enjoy! :star:


Thanks! I hadn’t seen the Open AI Embeddings before.

Hello! Rhino8 is not available yet. Do you have for Rhino7 version?

1 Like

Updated with ChatGPT and Codex models.

1 Like

Thanks for your development and except ChatGPT I’m impressed by extracting embedding and potential fine-tuning within GH interface too.

For the async problem, I have used a ChatGPT node in RH 7 GH written by others, and I used the plugin “Solution Async” that I can use Rhino and GH smoothly while the ChatGPT is processing the answer.

Unfortunately, when I install it in RH8, I couldn’t open GH (it stuck at loading 100%)
Once I uninstall it, I can open GH and use your sample,gh for quick tests again.

Not sure is it useful for your or is it your main focus. But hope it can help you / give you some insights!

1 Like

it happens to me all the time that I have to click again the Grasshopper button (or type the command) once the loading is finished, maybe is that?

And thanks for the suggestion. I even developed my own responsive-canvas async component for another plugin but in this case because it cost money to use the OpenAI models I think is better to prevent the user to make recalculations by mistake.

You are the star, it works after I click again the GH button… Just sadly it seems the Async plugin couldn’t work while the ChatGPT component is running (it seems to work in rh7 but not rh8).

Would you mind sharing your async component? Although it is risky to run recalculations but there are also benefits for testing the feasibility of running real-time practice.

(Just FYI I’m currently working on a research project trying to turn rhino into more a ‘design collaborator’ that talks to the designers based on the real-time modelling behaviour. I made a prelim test in rh7 but for long run I’m planning to switch fully to rh8. Therefore your plugin gives me so much hope and thanks again!)