npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@welsonviana/n8n-nodes-generic-rest-chat-model-ai

v0.1.0

Published

Generic REST Chat Model sub-node for n8n AI Agent. Supports IBM watsonx Orchestrator and any OpenAI-compatible REST LLM.

Readme

n8n-nodes-generic-rest-chat-model-ai

A community sub-node that plugs any REST-based LLM into the n8n AI Agent as a Chat Model — without writing code or creating a custom node for each API.

Supports IBM watsonx Orchestrator, Ollama, Groq, and any OpenAI-compatible REST endpoint.


How it works

The node acts as a Chat Model sub-node (the same slot used by the built-in OpenAI or Anthropic nodes). It sends the conversation history to a REST endpoint using a configurable JSON body template and extracts the reply using a JSONPath expression.

AI Agent ──► Generic REST Chat Model ──► Your REST API
               ↑
        Simple Memory (optional)

Installation

In your n8n instance, go to Settings → Community Nodes → Install and enter:

@welsonviana/n8n-nodes-generic-rest-chat-model-ai

Or in a self-hosted Docker instance:

docker exec -it n8n npm install @welsonviana/n8n-nodes-generic-rest-chat-model-ai

Credentials

Create a Generic REST Chat Model API credential and choose one of the auth types:

| Auth Type | When to use | |---|---| | IBM IAM | IBM watsonx Orchestrator — exchanges your IBM API Key for a Bearer token automatically (cached with TTL) | | Bearer Token | Groq, OpenRouter, or any API that uses Authorization: Bearer <token> | | API Key Header | APIs that use a custom header (e.g. X-Api-Key) | | None | Ollama or any unauthenticated local endpoint |


Node parameters

| Parameter | Description | |---|---| | Endpoint URL | Full POST URL of the LLM endpoint | | Model / Agent ID | Injected as {{model}} in the body template | | Stateful Mode | Send only the last message + session ID (server manages history). When enabled, set Simple Memory's Context Window Length to 1 | | Session ID | Injected as {{sessionId}} — visible only when Stateful Mode is on | | Inject History Into Message | Concatenates the full conversation history into the last user message as plain text. Use when the API ignores the messages array (e.g. watsonx Orchestrator) | | Request Body Template | JSON template with placeholders (see below) | | Response Path | JSONPath to the text field in the API response (e.g. $.choices[0].message.content) | | Debug Mode | Attaches the raw request and response to the execution output (AI panel). Sensitive headers are masked. Disable in production | | Max Retries | Automatic retries on transient network errors with exponential backoff (1 s, 2 s, 4 s). HTTP errors are never retried. Default: 2 | | Additional Headers | Extra HTTP headers as a JSON object |

Body template placeholders

| Placeholder | Replaced with | |---|---| | {{messages}} | Full messages array [{ role, content }, ...] | | {{lastMessage}} | Last user message as a string | | {{sessionId}} | Session ID (stateful mode) | | {{model}} | Model / Agent ID |

A placeholder that is the sole value of a JSON string (e.g. "messages": "{{messages}}") is replaced with the raw value, injecting the array directly into the body.


Examples

Ollama (local, no auth)

Credential: None

Endpoint URL:

http://host.docker.internal:11434/api/chat

Body Template:

{
  "model": "{{model}}",
  "stream": false,
  "messages": "{{messages}}"
}

Model / Agent ID: llama3

Response Path: $.message.content


Groq (Bearer Token)

Credential: Bearer Token → your Groq API key

Endpoint URL:

https://api.groq.com/openai/v1/chat/completions

Body Template:

{
  "model": "{{model}}",
  "stream": false,
  "messages": "{{messages}}"
}

Model / Agent ID: llama-3.3-70b-versatile

Response Path: $.choices[0].message.content


IBM watsonx Orchestrator (IBM IAM + Inject History)

Credential: IBM IAM → your IBM API Key

Endpoint URL:

https://api.br-sao.watson-orchestrate.cloud.ibm.com/instances/{instanceId}/v1/orchestrate/{agentId}/chat/completions

Body Template:

{
  "model": "{{model}}",
  "stream": false,
  "messages": "{{messages}}",
  "additional_properties": {}
}

Model / Agent ID: your Agent ID (same as the one in the URL)

Inject History Into Message: enabled

Response Path: $.choices[0].message.content

watsonx Orchestrator ignores the messages array for context. Enabling Inject History Into Message concatenates the full conversation history into the last user message so the agent receives it.


License

MIT