n8n-nodes-featherless-chat 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/README.md +38 -0
- package/dist/credentials/FeatherlessApi.credentials.d.ts +9 -0
- package/dist/credentials/FeatherlessApi.credentials.js +44 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/nodes/LmChatFeatherless/LmChatFeatherless.node.d.ts +5 -0
- package/dist/nodes/LmChatFeatherless/LmChatFeatherless.node.js +136 -0
- package/dist/nodes/LmChatFeatherless/featherless.svg +5 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# n8n-nodes-featherless-chat
|
|
2
|
+
|
|
3
|
+
Community node for n8n that adds **Featherless AI** as a **Chat Model** usable directly in the **AI Agent** node.
|
|
4
|
+
|
|
5
|
+
## What this solves
|
|
6
|
+
|
|
7
|
+
If you currently use Featherless as an HTTP tool node, this package lets you use Featherless as a real chat model connection (`Model`) in n8n AI workflows.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
1. Build package:
|
|
12
|
+
```bash
|
|
13
|
+
npm install
|
|
14
|
+
npm run build
|
|
15
|
+
npm pack
|
|
16
|
+
```
|
|
17
|
+
2. Install tarball in your n8n container/server:
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g /path/to/n8n-nodes-featherless-chat-0.1.0.tgz
|
|
20
|
+
```
|
|
21
|
+
3. Restart n8n.
|
|
22
|
+
|
|
23
|
+
## Credentials
|
|
24
|
+
|
|
25
|
+
Create credential **Featherless API**:
|
|
26
|
+
- `Base URL`: `https://api.featherless.ai/v1`
|
|
27
|
+
- `API Key`: your Featherless key
|
|
28
|
+
|
|
29
|
+
## Usage in AI Agent
|
|
30
|
+
|
|
31
|
+
1. Add node **Featherless Chat Model**
|
|
32
|
+
2. Configure model (for example `Qwen/Qwen2.5-7B-Instruct`)
|
|
33
|
+
3. Connect its **Model** output into your **AI Agent** node model input.
|
|
34
|
+
|
|
35
|
+
## Notes
|
|
36
|
+
|
|
37
|
+
- This node uses OpenAI-compatible API format through LangChain `ChatOpenAI`.
|
|
38
|
+
- You can tune temperature, max tokens, top-p and penalties in node parameters.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ICredentialType, INodeProperties, IAuthenticateGeneric, ICredentialTestRequest } from 'n8n-workflow';
|
|
2
|
+
export declare class FeatherlessApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeatherlessApi = void 0;
|
|
4
|
+
class FeatherlessApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'featherlessApi';
|
|
7
|
+
this.displayName = 'Featherless API';
|
|
8
|
+
this.documentationUrl = 'https://featherless.ai/docs/api-overview-and-common-options';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Base URL',
|
|
12
|
+
name: 'baseUrl',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: 'https://api.featherless.ai/v1',
|
|
15
|
+
description: 'OpenAI-compatible base URL',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: 'API Key',
|
|
19
|
+
name: 'apiKey',
|
|
20
|
+
type: 'string',
|
|
21
|
+
typeOptions: {
|
|
22
|
+
password: true,
|
|
23
|
+
},
|
|
24
|
+
default: '',
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
this.authenticate = {
|
|
28
|
+
type: 'generic',
|
|
29
|
+
properties: {
|
|
30
|
+
headers: {
|
|
31
|
+
Authorization: '=Bearer {{$credentials.apiKey}}',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
this.test = {
|
|
36
|
+
request: {
|
|
37
|
+
baseURL: '={{$credentials.baseUrl}}',
|
|
38
|
+
url: '/models',
|
|
39
|
+
method: 'GET',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.FeatherlessApi = FeatherlessApi;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { INodeType, INodeTypeDescription, ISupplyDataFunctions, SupplyData } from 'n8n-workflow';
|
|
2
|
+
export declare class LmChatFeatherless implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LmChatFeatherless = void 0;
|
|
4
|
+
const openai_1 = require("@langchain/openai");
|
|
5
|
+
class LmChatFeatherless {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Featherless Chat Model',
|
|
9
|
+
name: 'lmChatFeatherless',
|
|
10
|
+
icon: 'file:featherless.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
description: 'Use Featherless as a chat model for AI Agent',
|
|
14
|
+
defaults: {
|
|
15
|
+
name: 'Featherless Chat Model',
|
|
16
|
+
},
|
|
17
|
+
codex: {
|
|
18
|
+
categories: ['AI'],
|
|
19
|
+
subcategories: {
|
|
20
|
+
AI: ['Language Models'],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
inputs: [],
|
|
24
|
+
outputs: ['ai_languageModel'],
|
|
25
|
+
outputNames: ['Model'],
|
|
26
|
+
credentials: [
|
|
27
|
+
{
|
|
28
|
+
name: 'featherlessApi',
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
properties: [
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Model',
|
|
35
|
+
name: 'model',
|
|
36
|
+
type: 'string',
|
|
37
|
+
default: 'Qwen/Qwen2.5-7B-Instruct',
|
|
38
|
+
description: 'Model name available in your Featherless account',
|
|
39
|
+
placeholder: 'Qwen/Qwen2.5-7B-Instruct',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
displayName: 'Temperature',
|
|
43
|
+
name: 'temperature',
|
|
44
|
+
type: 'number',
|
|
45
|
+
typeOptions: {
|
|
46
|
+
minValue: 0,
|
|
47
|
+
maxValue: 2,
|
|
48
|
+
numberPrecision: 2,
|
|
49
|
+
},
|
|
50
|
+
default: 0.7,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
displayName: 'Max Tokens',
|
|
54
|
+
name: 'maxTokens',
|
|
55
|
+
type: 'number',
|
|
56
|
+
typeOptions: {
|
|
57
|
+
minValue: 1,
|
|
58
|
+
},
|
|
59
|
+
default: 512,
|
|
60
|
+
description: 'Maximum number of output tokens',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Top P',
|
|
64
|
+
name: 'topP',
|
|
65
|
+
type: 'number',
|
|
66
|
+
typeOptions: {
|
|
67
|
+
minValue: 0,
|
|
68
|
+
maxValue: 1,
|
|
69
|
+
numberPrecision: 2,
|
|
70
|
+
},
|
|
71
|
+
default: 1,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Frequency Penalty',
|
|
75
|
+
name: 'frequencyPenalty',
|
|
76
|
+
type: 'number',
|
|
77
|
+
typeOptions: {
|
|
78
|
+
minValue: -2,
|
|
79
|
+
maxValue: 2,
|
|
80
|
+
numberPrecision: 2,
|
|
81
|
+
},
|
|
82
|
+
default: 0,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
displayName: 'Presence Penalty',
|
|
86
|
+
name: 'presencePenalty',
|
|
87
|
+
type: 'number',
|
|
88
|
+
typeOptions: {
|
|
89
|
+
minValue: -2,
|
|
90
|
+
maxValue: 2,
|
|
91
|
+
numberPrecision: 2,
|
|
92
|
+
},
|
|
93
|
+
default: 0,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
displayName: 'Timeout (ms)',
|
|
97
|
+
name: 'timeout',
|
|
98
|
+
type: 'number',
|
|
99
|
+
typeOptions: {
|
|
100
|
+
minValue: 1000,
|
|
101
|
+
},
|
|
102
|
+
default: 120000,
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
async supplyData(itemIndex) {
|
|
108
|
+
const credentials = await this.getCredentials('featherlessApi');
|
|
109
|
+
const model = this.getNodeParameter('model', itemIndex);
|
|
110
|
+
const temperature = this.getNodeParameter('temperature', itemIndex);
|
|
111
|
+
const maxTokens = this.getNodeParameter('maxTokens', itemIndex);
|
|
112
|
+
const topP = this.getNodeParameter('topP', itemIndex);
|
|
113
|
+
const frequencyPenalty = this.getNodeParameter('frequencyPenalty', itemIndex);
|
|
114
|
+
const presencePenalty = this.getNodeParameter('presencePenalty', itemIndex);
|
|
115
|
+
const timeout = this.getNodeParameter('timeout', itemIndex);
|
|
116
|
+
const client = new openai_1.ChatOpenAI({
|
|
117
|
+
model,
|
|
118
|
+
apiKey: credentials.apiKey,
|
|
119
|
+
configuration: {
|
|
120
|
+
baseURL: credentials.baseUrl || 'https://api.featherless.ai/v1',
|
|
121
|
+
},
|
|
122
|
+
temperature,
|
|
123
|
+
maxTokens,
|
|
124
|
+
timeout,
|
|
125
|
+
modelKwargs: {
|
|
126
|
+
top_p: topP,
|
|
127
|
+
frequency_penalty: frequencyPenalty,
|
|
128
|
+
presence_penalty: presencePenalty,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
response: client,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.LmChatFeatherless = LmChatFeatherless;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
+
<rect width="64" height="64" rx="14" fill="#111827"/>
|
|
3
|
+
<path d="M14 40c0-10 8-18 18-18h18v8H32c-5.5 0-10 4.5-10 10v10h-8V40z" fill="#22d3ee"/>
|
|
4
|
+
<path d="M50 40c0 10-8 18-18 18H14v-8h18c5.5 0 10-4.5 10-10V30h8v10z" fill="#38bdf8"/>
|
|
5
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-featherless-chat",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node that adds Featherless AI as a Chat Model for AI Agent",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"n8n-community-node-package",
|
|
8
|
+
"n8n",
|
|
9
|
+
"featherless",
|
|
10
|
+
"ai",
|
|
11
|
+
"chat-model"
|
|
12
|
+
],
|
|
13
|
+
"author": "Patrik + Codex",
|
|
14
|
+
"main": "dist/index.js",
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "rimraf dist && tsc -p tsconfig.json && cpy \"nodes/**/*.svg\" dist/nodes",
|
|
21
|
+
"dev": "tsc -w -p tsconfig.json"
|
|
22
|
+
},
|
|
23
|
+
"n8n": {
|
|
24
|
+
"credentials": [
|
|
25
|
+
"dist/credentials/FeatherlessApi.credentials.js"
|
|
26
|
+
],
|
|
27
|
+
"nodes": [
|
|
28
|
+
"dist/nodes/LmChatFeatherless/LmChatFeatherless.node.js"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@langchain/openai": "^0.4.5"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^22.15.3",
|
|
36
|
+
"cpy-cli": "^5.0.0",
|
|
37
|
+
"n8n-workflow": "^1.86.0",
|
|
38
|
+
"rimraf": "^6.0.1",
|
|
39
|
+
"typescript": "^5.8.3"
|
|
40
|
+
}
|
|
41
|
+
}
|