n8n-nodes-gpt-oss
v0.1.0
Published
n8n community node for interacting with GPT-OSS compatible large language models
Maintainers
Readme
n8n-nodes-gpt-oss
Custom n8n community node that connects to GPT-OSS or any API compatible with the OpenAI Chat Completions schema. The node lets you swap OpenAI models with self-hosted or resource-efficient large language models while keeping the n8n workflow experience familiar.
Features
- Chat completion operation with either a quick prompt or full message array control.
- Credential support for custom base URLs, bearer tokens, organisations and default models.
- Advanced tuning options (temperature, top-p, penalties, stop sequences, seeds).
- Flexible response handling: retrieve the assistant message or the raw JSON payload.
Installation
From your n8n root folder:
npm install n8n-nodes-gpt-ossThen restart n8n. The node will appear under AI (or the custom category you prefer) with the name GPT-OSS.
Credentials
Create a new credential of type GPT-OSS API and provide:
- Base URL – for example
http://localhost:8080/v1when running a local REST gateway. - API Key – optional bearer token if your deployment requires authentication.
- Default Model – optional fallback model name when the node does not provide one.
- Organization ID – optional header for multi-tenant deployments.
When configured, the credential automatically normalises URLs, injects the bearer token and applies the default model.
Usage
- Add the GPT-OSS node to a workflow.
- Choose Simple Prompt to supply a user/system message, or switch to Messages Array for full OpenAI-style payloads.
- Set the
Modelif you want to override the credential default. - (Optional) Expand Advanced Options to set temperature, max tokens, stop sequences, deterministic seeds, or to request the full JSON response.
- Execute the workflow. The node returns either the assistant message content or the full API response JSON, depending on the option you chose.
Example messages payload
[
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Rédige un résumé de 2 phrases au sujet de n8n."}
]Paste the snippet above in the Messages field when the prompt mode is set to "Messages Array".
Development
Clone the repository, install dependencies and run the TypeScript compiler in watch mode:
npm install
npm run devBefore publishing, generate the production build:
npm run buildThis runs the TypeScript compiler and copies the SVG icon into dist/.
Testing Against GPT-OSS
Point your credentials to the base URL exposed by the GPT-OSS gateway (for instance http://localhost:8000/v1). The node expects the /chat/completions endpoint to follow the OpenAI schema, returning a choices array containing message.content.
If your gateway uses a different path or requires additional headers, adjust the custom credential or extend GenericFunctions.ts as needed.
License
MIT © Le-Sourcier
