Parametric modeling in Grasshopper requires programming knowledge, which
poses a challenge for many architects and designers. In this thesis, we developed
a system that uses large language models to generate GHPython code
from natural language descriptions.
We implemented the system as a web application using the FastAPI
framework and Streamlit library. To improve results, we used the RAG technique
with a knowledge base containing RhinoCommon library documentation.
The system searches for relevant code examples based on keywords in
the user’s description and includes them in the prompt sent to the language
model. We evaluated the system on three language models: Gemini 2.5 Flash,
GPT-5.2, and Claude Sonnet 4.5. All models successfully generated code
for basic geometric elements such as points, lines, and circles. For more
complex tasks, the knowledge base significantly reduced syntax errors and
the use of non-existent functions. Claude Sonnet 4 achieved the best results,
particularly for complex shapes. The results show that large language models are a promising tool for
simplifying parametric modeling. The RAG approach proved effective in
improving code generation for domain-specific libraries.
|