FlowFuse Assistant using self hosted endpoint

Earlier today I tried out the @flowfuse/nr-assistant plugin and it looked really promising. Since I self-host my Node-RED instances, it normally wouldn’t work for me because the assistant expects a FlowFuse-hosted environment.

While looking through the code, I noticed the settings.js option where you can specify the URL of the FlowFuse AI service. Instead of pointing it to FlowFuse, I directed it to my own localhost and implemented just one of the required API endpoints.

This is just an experiment — definitely not something to rely on in a production setup — but if you’d like to play around with it too, you can get started by following these steps:

  1. Install the @flowfuse/nr-assistant plugin.

  2. Edit settings.js and append this code to the bottom of the file:

    "flowforge": {
    "assistant": {
    "enabled": true,
    "url": "/nr-assistant",
    "token": "this-is-a-test-token",
    "requestTimeout": 60000
    }
    }

  3. Restart your instance.

  4. Import this flow:

    nr-assistant-self-hosted - Pastebin.com

  5. Open the details of the nr-assistant-self-hosted group, open the Environmental Variables tab, and provide values for NODERED_URL, NODERED_USER, NODERED_PASS, and OPENAI_APIKEY.

This will now let you use the Function Builder and “Ask the FlowFuse Assistant” functionality to generate nodes and function code.