- Python 100%
| img | ||
| .gitignore | ||
| __init__.py | ||
| FreeCADLLM.FCMacro | ||
| LICENSE | ||
| llm.py | ||
| llm_integration.py | ||
| llmicon.png | ||
| logo.svg | ||
| package.xml | ||
| README.md | ||
FreeCADLLM
FreeCAD macro to use a local LLM with Ollama.
Screenshot
Install
Install thusly:
mkdir -p ~/.local/share/FreeCAD/AdditionalPythonPackages/py311
pip install ollama --target ~/.local/share/FreeCAD/AdditionalPythonPackages/py311
mkdir -p ~/.local/share/FreeCAD/Mod
cd ~/.local/share/FreeCAD/Mod
git clone https://spacecruft.org/deepcrayon/FreeCADLLM
Ollama
You need to have Ollama installed.
It can be local or remote.
It defaults to a local install.
To use a remote Ollama server, edit this file:
~/.local/share/FreeCAD/Mod/FreeCADLLM/llm_integration.py
and change host="http://127.0.0.1:11434" to your remote server.
LLM Models
The default model is qwen2.5-coder:32b-instruct-q8_0.
This can be changed to any Ollama model.
Edit ~/.local/share/FreeCAD/Mod/FreeCADLLM/llm_integration.py
and change this to the desired model:
model="qwen2.5-coder:32b-instruct-q8_0"
Usage
In FreeCAD, thusly:
- Create a new file.
- Go to
Macro-->Macros. - In
User macros location:select the path to theFreeCADLLMdirectory, such as:/home/debian/.local/share/FreeCAD/Mod/FreeCADLLM. - Select
FreeCADLLM.Macro. - Click
Execute. - Under
Describe your part, enter what you want, for example:30mm x 50mm x 15mm box. - Click Execute.
Bugs
- For some reason, when the macro runs the first time, it may create
multiple windows. Hit
Escapeto close the extra windows. - Sometimes it generates legitimate code, but it doesn't render in FreeCAD. If this happens, just re-run with the same description.
- Sometimes it generates legitimate code, but it doesn't render. Then when another object is described, it renders the last two requests...
- Need to select crufty path, since it isn't in Addons.
- Many others....
Status
Alpha.
Sometimes works, but under early development.
Fork
This is a fork of Robb Sharma's (revhappy) GPT4FreeCAD. GPT4FreeCAD uses OpenAI's proprietary service. This fork uses Ollama and can be run locally.
Original GPT4FreeCAD version: Copyright (c) 2023 Robb Sharma
License
MIT.
Copyright (c) 2025 Jeff Moe
