How to attach custom llm model to toolsAgent node

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.68.0
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: ubuntu

I am developing custom llm model node as cluster node.
It is developed as chatmodel and working fine using chain or agent node except “toolsAgent”, “conversationalAgent”.
As I checked n8n code, there is hard coded filter in “toolsAgent” and “conversationalAgent” at Agent.node.ts

My question is if I remove that filter after I install n8n pakcage, do you think that I could find my custom llm model at selection side page for toolsAgent node?
I tried this, but I don’t think it works.

Or could you suggest any other idea to achieve it?

Hi @Jimmy_Lee,

you’re right that we’re filtering connectable nodes in the UI for the tool’s agent. This happens here: n8n/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts at master · n8n-io/n8n · GitHub

If you’d remove that filter, or add your node here, it should show up. But it’s also important that the custom chat node you’re developing has bindTools method as its required to be able to pass tools schema to LLM. We’re checking for that method here: n8n/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts at master · n8n-io/n8n · GitHub