@sateeshreddy/n8n-nodes-nvidia-nim 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +7 -0
- package/.eslintignore +3 -0
- package/Claude.md +87 -0
- package/README.md +21 -0
- package/credentials/NvidiaNimApi.credentials.ts +18 -0
- package/dist/credentials/NvidiaNimApi.credentials.d.ts +7 -0
- package/dist/credentials/NvidiaNimApi.credentials.d.ts.map +1 -0
- package/dist/credentials/NvidiaNimApi.credentials.js +23 -0
- package/dist/credentials/NvidiaNimApi.credentials.js.map +1 -0
- package/dist/nodes/NvidiaNim/NvidiaNim.node.d.ts +6 -0
- package/dist/nodes/NvidiaNim/NvidiaNim.node.d.ts.map +1 -0
- package/dist/nodes/NvidiaNim/NvidiaNim.node.js +34 -0
- package/dist/nodes/NvidiaNim/NvidiaNim.node.js.map +1 -0
- package/dist/nodes/NvidiaNim/NvidiaNim.node.json +79 -0
- package/dist/nodes/NvidiaNim/nvidia-nim.png +0 -0
- package/dist/test/manual.d.ts +2 -0
- package/dist/test/manual.d.ts.map +1 -0
- package/dist/test/manual.js +18 -0
- package/dist/test/manual.js.map +1 -0
- package/eslint.config.mjs +36 -0
- package/gulpfile.js +9 -0
- package/nodes/NvidiaNim/NvidiaNim.node.json +79 -0
- package/nodes/NvidiaNim/NvidiaNim.node.ts +34 -0
- package/nodes/NvidiaNim/nvidia-nim.png +0 -0
- package/nvidia-nim.png +0 -0
- package/package.json +46 -0
- package/test/manual.ts +16 -0
- package/tsconfig.build.json +22 -0
- package/tsconfig.json +31 -0
package/.eslintignore
ADDED
package/Claude.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
This repository contains the `n8n-nodes-nvidia-nim` package - an n8n community node that allows users to call any free model from NVIDIA NIM (build.nvidia.com) directly in their workflows. The node wraps NVIDIA's OpenAI-compatible REST API (`https://integrate.api.nvidia.com/v1`) with a friendly n8n UI.
|
|
7
|
+
|
|
8
|
+
## Repository Structure
|
|
9
|
+
```
|
|
10
|
+
n8n-nodes-nvidia-nim/
|
|
11
|
+
├── package.json
|
|
12
|
+
├── tsconfig.json
|
|
13
|
+
├── tsconfig.build.json
|
|
14
|
+
├── gulpfile.js
|
|
15
|
+
├── eslint.config.mjs
|
|
16
|
+
├── .gitignore
|
|
17
|
+
├── README.md
|
|
18
|
+
├── nodes/
|
|
19
|
+
│ └── NvidiaNim/
|
|
20
|
+
│ ├── NvidiaNim.node.ts # Main node logic (TypeScript)
|
|
21
|
+
│ ├── NvidiaNim.node.json # Node metadata/codex
|
|
22
|
+
│ └── nvidia-nim.svg # Node icon
|
|
23
|
+
└── credentials/
|
|
24
|
+
└── NvidiaNimApi.credentials.ts # API key credential definition
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Key Commands
|
|
28
|
+
All commands are executed by Claude Code within the project directory:
|
|
29
|
+
|
|
30
|
+
- **Install dependencies**: `npm install`
|
|
31
|
+
- **Lint code**: `npm run lint` (checks for TypeScript errors and enforces coding standards)
|
|
32
|
+
- **Fix lint issues**: `npm run lintfix` (auto-fixes lintable issues)
|
|
33
|
+
- **Format code**: `npm run format` (uses Prettier to format TypeScript and JSON files)
|
|
34
|
+
- **Build package**: `npm run build` (compiles TypeScript to dist/ and copies SVG icons)
|
|
35
|
+
- **Watch for changes**: `npm run dev` (TypeScript watch mode during development)
|
|
36
|
+
- **Prepublish checks**: `npm run prepublishOnly` (runs build and lint before publishing)
|
|
37
|
+
|
|
38
|
+
## Development Workflow
|
|
39
|
+
1. **Setup**: Run `npm install` to install dependencies
|
|
40
|
+
2. **Develop**: Use `npm run dev` for continuous TypeScript compilation
|
|
41
|
+
3. **Code Quality**:
|
|
42
|
+
- Run `npm run lint` to check for issues
|
|
43
|
+
- Run `npm run lintfix` to automatically fix lint issues
|
|
44
|
+
- Run `npm run format` to format code with Prettier
|
|
45
|
+
4. **Build**: Run `npm run build` to generate distributable files in `dist/`
|
|
46
|
+
5. **Test**: Manual testing can be done by linking to n8n (see notes below)
|
|
47
|
+
|
|
48
|
+
## Architecture Highlights
|
|
49
|
+
- **Node Implementation**: The main logic resides in `nodes/NvidiaNim/NvidiaNim.node.ts` which implements the `INodeType` interface from `n8n-workflow`
|
|
50
|
+
- **Credentials**: API key handling is defined in `credentials/NvidiaNimApi.credentials.ts` using n8n's credential system
|
|
51
|
+
- **Build Process**:
|
|
52
|
+
- TypeScript compilation via `tsc` (using `tsconfig.build.json` for production builds)
|
|
53
|
+
- SVG icon copying via Gulp (`gulpfile.js`)
|
|
54
|
+
- Output directed to `dist/` directory as specified in package.json
|
|
55
|
+
- **n8n Integration**:
|
|
56
|
+
- Package.json includes `n8n` section specifying nodes and credentials paths
|
|
57
|
+
- Uses `n8nNodesApiVersion: 1` for compatibility
|
|
58
|
+
- Leverages n8n's built-in `httpRequest` helper for API calls (no external dependencies)
|
|
59
|
+
|
|
60
|
+
## Testing Approach
|
|
61
|
+
While the project doesn't include automated test files, validation includes:
|
|
62
|
+
- **Build verification**: Confirming `npm run build` succeeds and produces expected output in `dist/`
|
|
63
|
+
- **TypeScript checking**: Ensuring no `any` type errors (warnings allowed) via ESLint
|
|
64
|
+
- **Lint compliance**: Zero warnings from `npm run lint`
|
|
65
|
+
- **Structural checks**: Verifying required files exist in correct locations post-build
|
|
66
|
+
- **Manual verification**: Smoke test script (`test/manual.ts`) to validate node description loads correctly
|
|
67
|
+
|
|
68
|
+
## Important Notes for Claude Code
|
|
69
|
+
1. **Do not ask users to run commands** - execute all commands yourself
|
|
70
|
+
2. **Always verify build output** - after `npm run build`, check that `dist/` contains:
|
|
71
|
+
- `dist/nodes/NvidiaNim/NvidiaNim.node.js`
|
|
72
|
+
- `dist/nodes/NvidiaNim/nvidia-nim.svg`
|
|
73
|
+
- `dist/credentials/NvidiaNimApi.credentials.js`
|
|
74
|
+
3. **Use n8n helpers** - rely on `this.helpers.httpRequest` for API calls, not external libraries
|
|
75
|
+
4. **Handle streaming properly** - when `stream: true`, collect SSE chunks before outputting
|
|
76
|
+
5. **Respect continueOnFail()** - wrap per-item processing in try/catch blocks
|
|
77
|
+
6. **No runtime dependencies** - avoid adding axios, node-fetch, etc.; use n8n's built-in helpers
|
|
78
|
+
7. **Expression support** - n8n automatically resolves expressions in `userMessage` and `systemPrompt` fields
|
|
79
|
+
|
|
80
|
+
## Common Issues to Watch For
|
|
81
|
+
- **Module not found**: Ensure `npm install` has been run for `n8n-workflow` dependency
|
|
82
|
+
- **Gulp not found**: Use `npx gulp build:icons` if gulp command missing
|
|
83
|
+
- **SVG not copied**: Verify gulpfile.js correctly copies SVG to dist/nodes/
|
|
84
|
+
- **Node not appearing**: Check package.json → n8n.nodes path matches actual dist file
|
|
85
|
+
- **Authentication errors**: API key must start with `nvapi-` and be obtained from build.nvidia.com
|
|
86
|
+
- **Model not found**: Use exact vendor/model-name format from build.nvidia.com
|
|
87
|
+
- **Rate limiting**: Free tier allows ~40 RPM; consider Wait nodes in tight loops
|
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# n8n-nodes-nvidia-nim
|
|
2
|
+
|
|
3
|
+
n8n community node for NVIDIA NIM (build.nvidia.com). Allows calling any free model from NVIDIA NIM directly in n8n workflows.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
1. Copy the `dist` folder to your n8n custom nodes directory (usually `~/.n8n/custom/`).
|
|
8
|
+
2. Restart n8n.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
Add the NVIDIA NIM node to your workflow and configure it with your API key (obtainable from [build.nvidia.com](https://build.nvidia.com)).
|
|
13
|
+
|
|
14
|
+
## Development
|
|
15
|
+
|
|
16
|
+
- `npm install` - install dependencies
|
|
17
|
+
- `npm run dev` - TypeScript watch mode
|
|
18
|
+
- `npm run lint` - lint code
|
|
19
|
+
- `npm run lintfix` - auto-fix lint issues
|
|
20
|
+
- `npm run format` - format code with Prettier
|
|
21
|
+
- `npm run build` - build distributable files
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
export class NvidiaNimApi implements ICredentialType {
|
|
4
|
+
name = 'nvidiaNimApi';
|
|
5
|
+
displayName = 'NVIDIA NIM API';
|
|
6
|
+
properties: INodeProperties[] = [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'API Key',
|
|
9
|
+
name: 'apiKey',
|
|
10
|
+
type: 'string',
|
|
11
|
+
typeOptions: {
|
|
12
|
+
password: true,
|
|
13
|
+
},
|
|
14
|
+
default: '',
|
|
15
|
+
description: 'Your NVIDIA NIM API key from build.nvidia.com',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NvidiaNimApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/NvidiaNimApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE,qBAAa,YAAa,YAAW,eAAe;IACnD,IAAI,SAAkB;IACtB,WAAW,SAAoB;IAC/B,UAAU,EAAE,eAAe,EAAE,CAW3B;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NvidiaNimApi = void 0;
|
|
4
|
+
class NvidiaNimApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'nvidiaNimApi';
|
|
7
|
+
this.displayName = 'NVIDIA NIM API';
|
|
8
|
+
this.properties = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'API Key',
|
|
11
|
+
name: 'apiKey',
|
|
12
|
+
type: 'string',
|
|
13
|
+
typeOptions: {
|
|
14
|
+
password: true,
|
|
15
|
+
},
|
|
16
|
+
default: '',
|
|
17
|
+
description: 'Your NVIDIA NIM API key from build.nvidia.com',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.NvidiaNimApi = NvidiaNimApi;
|
|
23
|
+
//# sourceMappingURL=NvidiaNimApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NvidiaNimApi.credentials.js","sourceRoot":"","sources":["../../credentials/NvidiaNimApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,YAAY;IAAzB;QACC,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,+CAA+C;aAC5D;SACD,CAAC;IACH,CAAC;CAAA;AAfD,oCAeC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { INodeType, INodeTypeDescription, ISupplyDataFunctions, SupplyData } from 'n8n-workflow';
|
|
2
|
+
export declare class NvidiaNim implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
supplyData(this: ISupplyDataFunctions): Promise<SupplyData>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=NvidiaNim.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NvidiaNim.node.d.ts","sourceRoot":"","sources":["../../../nodes/NvidiaNim/NvidiaNim.node.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACb,MAAM,cAAc,CAAC;AAItB,qBAAa,SAAU,YAAW,SAAS;IACvC,WAAW,EAAE,oBAAoB,CAA2C;IAEtE,UAAU,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CAqBpE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NvidiaNim = void 0;
|
|
7
|
+
const openai_1 = require("@langchain/openai");
|
|
8
|
+
const NvidiaNim_node_json_1 = __importDefault(require("./NvidiaNim.node.json"));
|
|
9
|
+
class NvidiaNim {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = NvidiaNim_node_json_1.default;
|
|
12
|
+
}
|
|
13
|
+
async supplyData() {
|
|
14
|
+
const credentials = await this.getCredentials('nvidiaNimApi');
|
|
15
|
+
const model = this.getNodeParameter('model', 0);
|
|
16
|
+
const temperature = this.getNodeParameter('temperature', 0);
|
|
17
|
+
const maxTokens = this.getNodeParameter('maxTokens', 0);
|
|
18
|
+
const apiKey = credentials.apiKey;
|
|
19
|
+
const chatModel = new openai_1.ChatOpenAI({
|
|
20
|
+
apiKey,
|
|
21
|
+
modelName: model,
|
|
22
|
+
temperature,
|
|
23
|
+
maxTokens,
|
|
24
|
+
configuration: {
|
|
25
|
+
baseURL: 'https://integrate.api.nvidia.com/v1',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
response: chatModel,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.NvidiaNim = NvidiaNim;
|
|
34
|
+
//# sourceMappingURL=NvidiaNim.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NvidiaNim.node.js","sourceRoot":"","sources":["../../../nodes/NvidiaNim/NvidiaNim.node.ts"],"names":[],"mappings":";;;;;;AAMA,8CAA+C;AAC/C,gFAAoD;AAEpD,MAAa,SAAS;IAAtB;QACI,gBAAW,GAAyB,6BAAuC,CAAC;IAuBhF,CAAC;IArBG,KAAK,CAAC,UAAU;QACZ,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;QAC9D,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAW,CAAC;QAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAW,CAAC;QACtE,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;QAClE,MAAM,MAAM,GAAG,WAAW,CAAC,MAAgB,CAAC;QAE5C,MAAM,SAAS,GAAG,IAAI,mBAAU,CAAC;YAC7B,MAAM;YACN,SAAS,EAAE,KAAK;YAChB,WAAW;YACX,SAAS;YACT,aAAa,EAAE;gBACX,OAAO,EAAE,qCAAqC;aACjD;SACJ,CAAC,CAAC;QAEH,OAAO;YACH,QAAQ,EAAE,SAAS;SACtB,CAAC;IACN,CAAC;CACJ;AAxBD,8BAwBC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "NvidiaNim",
|
|
3
|
+
"displayName": "NVIDIA NIM",
|
|
4
|
+
"icon": "file:nvidia-nim.png",
|
|
5
|
+
"group": ["transform"],
|
|
6
|
+
"version": 1,
|
|
7
|
+
"description": "Call any free model from NVIDIA NIM",
|
|
8
|
+
"defaults": {
|
|
9
|
+
"name": "NVIDIA NIM"
|
|
10
|
+
},
|
|
11
|
+
"inputs": [],
|
|
12
|
+
"outputs": ["ai_languageModel"],
|
|
13
|
+
"outputNames": ["Model"],
|
|
14
|
+
"codex": {
|
|
15
|
+
"categories": ["AI"],
|
|
16
|
+
"subcategories": {
|
|
17
|
+
"AI": ["Language Models"],
|
|
18
|
+
"Language Models": ["Chat Models (Recommended)"]
|
|
19
|
+
},
|
|
20
|
+
"resources": {}
|
|
21
|
+
},
|
|
22
|
+
"credentials": [
|
|
23
|
+
{
|
|
24
|
+
"name": "nvidiaNimApi",
|
|
25
|
+
"required": true
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"properties": [
|
|
29
|
+
{
|
|
30
|
+
"displayName": "Model",
|
|
31
|
+
"name": "model",
|
|
32
|
+
"type": "options",
|
|
33
|
+
"options": [
|
|
34
|
+
{ "name": "GLM-4.7 (Tool Calling)", "value": "thudm/glm-4.7" },
|
|
35
|
+
{ "name": "MiniMax M2.7", "value": "minimax/minimax-m2.7" },
|
|
36
|
+
{ "name": "Step 3.5 Flash (Agentic)", "value": "stepfun-ai/step-3.5-flash" },
|
|
37
|
+
{ "name": "Mistral Large 3 675B Instruct", "value": "mistralai/mistral-large-3-675b-instruct-2512" },
|
|
38
|
+
{ "name": "Seed OSS 36B Instruct (Agentic)", "value": "bytedance/seed-oss-36b-instruct" },
|
|
39
|
+
{ "name": "Qwen3 Coder 480B A35B Instruct (Agentic)", "value": "qwen/qwen3-coder-480b-a35b-instruct" },
|
|
40
|
+
{ "name": "Magistral Small 2506", "value": "mistralai/magistral-small-2506" },
|
|
41
|
+
{ "name": "Gemma 3N E4B IT", "value": "google/gemma-3n-e4b-it" },
|
|
42
|
+
{ "name": "Gemma 3N E2B IT", "value": "google/gemma-3n-e2b-it" },
|
|
43
|
+
{ "name": "Mistral Nemotron (Function Calling)", "value": "mistralai/mistral-nemotron" },
|
|
44
|
+
{ "name": "Mistral Medium 3 Instruct", "value": "mistralai/mistral-medium-3-instruct" },
|
|
45
|
+
{ "name": "Llama 4 Maverick 17B 128E Instruct", "value": "meta/llama-4-maverick-17b-128e-instruct" },
|
|
46
|
+
{ "name": "Phi-4 Multimodal Instruct", "value": "microsoft/phi-4-multimodal-instruct" },
|
|
47
|
+
{ "name": "Dracarys Llama 3.1 70B Instruct", "value": "abacusai/dracarys-llama-3.1-70b-instruct" },
|
|
48
|
+
{ "name": "Nemotron Mini 4B Instruct", "value": "nvidia/nemotron-mini-4b-instruct" },
|
|
49
|
+
{ "name": "Gemma 2 2B IT", "value": "google/gemma-2-2b-it" },
|
|
50
|
+
{ "name": "Solar 10.7B Instruct", "value": "upstage/solar-10.7b-instruct" }
|
|
51
|
+
],
|
|
52
|
+
"default": "meta/llama-4-maverick-17b-128e-instruct",
|
|
53
|
+
"description": "The model to use for inference"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"displayName": "Temperature",
|
|
57
|
+
"name": "temperature",
|
|
58
|
+
"type": "number",
|
|
59
|
+
"default": 0.7,
|
|
60
|
+
"description": "Controls randomness in the output",
|
|
61
|
+
"typeOptions": {
|
|
62
|
+
"minValue": 0,
|
|
63
|
+
"maxValue": 2,
|
|
64
|
+
"step": 0.1
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"displayName": "Max Tokens",
|
|
69
|
+
"name": "maxTokens",
|
|
70
|
+
"type": "number",
|
|
71
|
+
"default": 1000,
|
|
72
|
+
"description": "Maximum number of tokens to generate",
|
|
73
|
+
"typeOptions": {
|
|
74
|
+
"minValue": 1,
|
|
75
|
+
"maxValue": 4096
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual.d.ts","sourceRoot":"","sources":["../../test/manual.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const NvidiaNim_node_1 = require("../nodes/NvidiaNim/NvidiaNim.node");
|
|
4
|
+
// Smoke test to validate node description loads correctly
|
|
5
|
+
console.log('Testing NVIDIA NIM node description...');
|
|
6
|
+
const node = new NvidiaNim_node_1.NvidiaNim();
|
|
7
|
+
console.log('Node description:', node.description);
|
|
8
|
+
console.log('Node name:', node.description.name);
|
|
9
|
+
console.log('Node displayName:', node.description.displayName);
|
|
10
|
+
if (node.description.name === 'NvidiaNim' && node.description.displayName === 'NVIDIA NIM') {
|
|
11
|
+
console.log('✅ Smoke test passed: Node description loads correctly');
|
|
12
|
+
process.exit(0);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
console.error('❌ Smoke test failed: Node description mismatch');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=manual.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual.js","sourceRoot":"","sources":["../../test/manual.ts"],"names":[],"mappings":";;AAAA,sEAA8D;AAE9D,0DAA0D;AAC1D,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;AACtD,MAAM,IAAI,GAAG,IAAI,0BAAS,EAAE,CAAC;AAC7B,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AACnD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACjD,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAE/D,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,WAAW,KAAK,YAAY,EAAE,CAAC;IAC5F,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;IACrE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC;KAAM,CAAC;IACP,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import tseslint from '@typescript-eslint/eslint-plugin';
|
|
2
|
+
import tsparser from '@typescript-eslint/parser';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
ignores: ['dist/**', 'node_modules/**', 'test/**'],
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
files: ['**/*.ts'],
|
|
10
|
+
languageOptions: {
|
|
11
|
+
parser: tsparser,
|
|
12
|
+
parserOptions: {
|
|
13
|
+
ecmaVersion: 2020,
|
|
14
|
+
sourceType: 'module',
|
|
15
|
+
project: './tsconfig.json', // ← add this
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
plugins: {
|
|
19
|
+
'@typescript-eslint': tseslint,
|
|
20
|
+
},
|
|
21
|
+
rules: {
|
|
22
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
23
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
24
|
+
'@typescript-eslint/no-var-requires': 'warn',
|
|
25
|
+
'@typescript-eslint/prefer-ts-expect-error': 'error',
|
|
26
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
27
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
28
|
+
'@typescript-eslint/no-require-imports': 'off',
|
|
29
|
+
'@typescript-eslint/no-floating-promises': 'error',
|
|
30
|
+
'@typescript-eslint/no-misused-promises': [
|
|
31
|
+
'error',
|
|
32
|
+
{ checksVoidReturn: { attributes: false } },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
];
|
package/gulpfile.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "NvidiaNim",
|
|
3
|
+
"displayName": "NVIDIA NIM",
|
|
4
|
+
"icon": "file:nvidia-nim.png",
|
|
5
|
+
"group": ["transform"],
|
|
6
|
+
"version": 1,
|
|
7
|
+
"description": "Call any free model from NVIDIA NIM",
|
|
8
|
+
"defaults": {
|
|
9
|
+
"name": "NVIDIA NIM"
|
|
10
|
+
},
|
|
11
|
+
"inputs": [],
|
|
12
|
+
"outputs": ["ai_languageModel"],
|
|
13
|
+
"outputNames": ["Model"],
|
|
14
|
+
"codex": {
|
|
15
|
+
"categories": ["AI"],
|
|
16
|
+
"subcategories": {
|
|
17
|
+
"AI": ["Language Models"],
|
|
18
|
+
"Language Models": ["Chat Models (Recommended)"]
|
|
19
|
+
},
|
|
20
|
+
"resources": {}
|
|
21
|
+
},
|
|
22
|
+
"credentials": [
|
|
23
|
+
{
|
|
24
|
+
"name": "nvidiaNimApi",
|
|
25
|
+
"required": true
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"properties": [
|
|
29
|
+
{
|
|
30
|
+
"displayName": "Model",
|
|
31
|
+
"name": "model",
|
|
32
|
+
"type": "options",
|
|
33
|
+
"options": [
|
|
34
|
+
{ "name": "GLM-4.7 (Tool Calling)", "value": "thudm/glm-4.7" },
|
|
35
|
+
{ "name": "MiniMax M2.7", "value": "minimax/minimax-m2.7" },
|
|
36
|
+
{ "name": "Step 3.5 Flash (Agentic)", "value": "stepfun-ai/step-3.5-flash" },
|
|
37
|
+
{ "name": "Mistral Large 3 675B Instruct", "value": "mistralai/mistral-large-3-675b-instruct-2512" },
|
|
38
|
+
{ "name": "Seed OSS 36B Instruct (Agentic)", "value": "bytedance/seed-oss-36b-instruct" },
|
|
39
|
+
{ "name": "Qwen3 Coder 480B A35B Instruct (Agentic)", "value": "qwen/qwen3-coder-480b-a35b-instruct" },
|
|
40
|
+
{ "name": "Magistral Small 2506", "value": "mistralai/magistral-small-2506" },
|
|
41
|
+
{ "name": "Gemma 3N E4B IT", "value": "google/gemma-3n-e4b-it" },
|
|
42
|
+
{ "name": "Gemma 3N E2B IT", "value": "google/gemma-3n-e2b-it" },
|
|
43
|
+
{ "name": "Mistral Nemotron (Function Calling)", "value": "mistralai/mistral-nemotron" },
|
|
44
|
+
{ "name": "Mistral Medium 3 Instruct", "value": "mistralai/mistral-medium-3-instruct" },
|
|
45
|
+
{ "name": "Llama 4 Maverick 17B 128E Instruct", "value": "meta/llama-4-maverick-17b-128e-instruct" },
|
|
46
|
+
{ "name": "Phi-4 Multimodal Instruct", "value": "microsoft/phi-4-multimodal-instruct" },
|
|
47
|
+
{ "name": "Dracarys Llama 3.1 70B Instruct", "value": "abacusai/dracarys-llama-3.1-70b-instruct" },
|
|
48
|
+
{ "name": "Nemotron Mini 4B Instruct", "value": "nvidia/nemotron-mini-4b-instruct" },
|
|
49
|
+
{ "name": "Gemma 2 2B IT", "value": "google/gemma-2-2b-it" },
|
|
50
|
+
{ "name": "Solar 10.7B Instruct", "value": "upstage/solar-10.7b-instruct" }
|
|
51
|
+
],
|
|
52
|
+
"default": "meta/llama-4-maverick-17b-128e-instruct",
|
|
53
|
+
"description": "The model to use for inference"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"displayName": "Temperature",
|
|
57
|
+
"name": "temperature",
|
|
58
|
+
"type": "number",
|
|
59
|
+
"default": 0.7,
|
|
60
|
+
"description": "Controls randomness in the output",
|
|
61
|
+
"typeOptions": {
|
|
62
|
+
"minValue": 0,
|
|
63
|
+
"maxValue": 2,
|
|
64
|
+
"step": 0.1
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"displayName": "Max Tokens",
|
|
69
|
+
"name": "maxTokens",
|
|
70
|
+
"type": "number",
|
|
71
|
+
"default": 1000,
|
|
72
|
+
"description": "Maximum number of tokens to generate",
|
|
73
|
+
"typeOptions": {
|
|
74
|
+
"minValue": 1,
|
|
75
|
+
"maxValue": 4096
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
INodeType,
|
|
3
|
+
INodeTypeDescription,
|
|
4
|
+
ISupplyDataFunctions,
|
|
5
|
+
SupplyData,
|
|
6
|
+
} from 'n8n-workflow';
|
|
7
|
+
import { ChatOpenAI } from '@langchain/openai';
|
|
8
|
+
import nodeDescription from './NvidiaNim.node.json';
|
|
9
|
+
|
|
10
|
+
export class NvidiaNim implements INodeType {
|
|
11
|
+
description: INodeTypeDescription = nodeDescription as INodeTypeDescription;
|
|
12
|
+
|
|
13
|
+
async supplyData(this: ISupplyDataFunctions): Promise<SupplyData> {
|
|
14
|
+
const credentials = await this.getCredentials('nvidiaNimApi');
|
|
15
|
+
const model = this.getNodeParameter('model', 0) as string;
|
|
16
|
+
const temperature = this.getNodeParameter('temperature', 0) as number;
|
|
17
|
+
const maxTokens = this.getNodeParameter('maxTokens', 0) as number;
|
|
18
|
+
const apiKey = credentials.apiKey as string;
|
|
19
|
+
|
|
20
|
+
const chatModel = new ChatOpenAI({
|
|
21
|
+
apiKey,
|
|
22
|
+
modelName: model,
|
|
23
|
+
temperature,
|
|
24
|
+
maxTokens,
|
|
25
|
+
configuration: {
|
|
26
|
+
baseURL: 'https://integrate.api.nvidia.com/v1',
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
response: chatModel,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
Binary file
|
package/nvidia-nim.png
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sateeshreddy/n8n-nodes-nvidia-nim",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node for NVIDIA NIM",
|
|
5
|
+
"main": "dist/nodes/NvidiaNim/NvidiaNim.node.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc && gulp build:icons",
|
|
8
|
+
"dev": "tsc -w",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"lintfix": "eslint . --fix",
|
|
11
|
+
"format": "prettier --write **/*.ts",
|
|
12
|
+
"prepublishOnly": "npm run build && npm run lint"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"n8n",
|
|
16
|
+
"n8n-community-node",
|
|
17
|
+
"nvidia",
|
|
18
|
+
"nim"
|
|
19
|
+
],
|
|
20
|
+
"author": "Sateeshreddy",
|
|
21
|
+
"email": "sateeshreddymaddi@gmail.com",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@langchain/openai": "^1.4.5",
|
|
25
|
+
"n8n-workflow": "^1.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^16.0.0",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
30
|
+
"@typescript-eslint/parser": "^5.0.0",
|
|
31
|
+
"eslint": "^8.0.0",
|
|
32
|
+
"gulp": "^4.0.0",
|
|
33
|
+
"prettier": "^2.0.0",
|
|
34
|
+
"ts-node": "^10.0.0",
|
|
35
|
+
"typescript": "^6.0.3"
|
|
36
|
+
},
|
|
37
|
+
"n8n": {
|
|
38
|
+
"n8nNodesApiVersion": 1,
|
|
39
|
+
"nodes": [
|
|
40
|
+
"dist/nodes/NvidiaNim/NvidiaNim.node.js"
|
|
41
|
+
],
|
|
42
|
+
"credentials": [
|
|
43
|
+
"dist/credentials/NvidiaNimApi.credentials.js"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
package/test/manual.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NvidiaNim } from '../nodes/NvidiaNim/NvidiaNim.node';
|
|
2
|
+
|
|
3
|
+
// Smoke test to validate node description loads correctly
|
|
4
|
+
console.log('Testing NVIDIA NIM node description...');
|
|
5
|
+
const node = new NvidiaNim();
|
|
6
|
+
console.log('Node description:', node.description);
|
|
7
|
+
console.log('Node name:', node.description.name);
|
|
8
|
+
console.log('Node displayName:', node.description.displayName);
|
|
9
|
+
|
|
10
|
+
if (node.description.name === 'NvidiaNim' && node.description.displayName === 'NVIDIA NIM') {
|
|
11
|
+
console.log('✅ Smoke test passed: Node description loads correctly');
|
|
12
|
+
process.exit(0);
|
|
13
|
+
} else {
|
|
14
|
+
console.error('❌ Smoke test failed: Node description mismatch');
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "./dist",
|
|
5
|
+
"rootDir": "./",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"sourceMap": true,
|
|
9
|
+
"removeComments": true,
|
|
10
|
+
"noImplicitAny": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"strictFunctionTypes": true,
|
|
13
|
+
"noImplicitThis": true,
|
|
14
|
+
"noImplicitReturns": true,
|
|
15
|
+
"noFallthroughCasesInSwitch": true
|
|
16
|
+
},
|
|
17
|
+
"exclude": [
|
|
18
|
+
"node_modules",
|
|
19
|
+
"dist",
|
|
20
|
+
"test"
|
|
21
|
+
]
|
|
22
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["es2020", "dom"],
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"declarationMap": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"removeComments": false,
|
|
16
|
+
"noImplicitAny": true,
|
|
17
|
+
"strictNullChecks": true,
|
|
18
|
+
"strictFunctionTypes": true,
|
|
19
|
+
"noImplicitThis": true,
|
|
20
|
+
"noImplicitReturns": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"moduleResolution": "node",
|
|
23
|
+
"ignoreDeprecations": "6.0",
|
|
24
|
+
"allowSyntheticDefaultImports": true,
|
|
25
|
+
"resolveJsonModule": true
|
|
26
|
+
},
|
|
27
|
+
"exclude": [
|
|
28
|
+
"node_modules",
|
|
29
|
+
"dist"
|
|
30
|
+
]
|
|
31
|
+
}
|