FreeCAD macro integrating Ollama AI LLM https://spacecruft.org/deepcrayon/FreeCADLLM
Find a file
2025-03-31 12:42:57 -06:00
img Add screenshot 2025-03-31 12:41:36 -06:00
.gitignore Ignore files 2025-03-30 18:08:38 -06:00
__init__.py Show fewer dialogs... 2025-03-31 12:28:42 -06:00
FreeCADLLM.FCMacro Rename macro script 2025-03-31 10:44:08 -06:00
LICENSE Add me to MIT license 2025-03-31 10:29:03 -06:00
llm.py s/gpt/llm 2025-03-31 10:35:14 -06:00
llm_integration.py Default to local Ollama install 2025-03-31 11:42:26 -06:00
llmicon.png Rename icon 2025-03-31 10:35:30 -06:00
logo.svg Add files via upload 2023-05-02 20:24:47 -07:00
package.xml Add branch to repo URL 2025-03-31 11:11:18 -06:00
README.md Clarify fork/original version 2025-03-31 12:42:57 -06:00

FreeCADLLM

FreeCAD macro to use a local LLM with Ollama.

Screenshot

FreeCADLLM 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 the FreeCADLLM directory, 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 Escape to 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