@cascadeflow/n8n-nodes-cascadeflow 0.4.12 → 0.4.13
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LmChatCascadeFlow.node.d.ts","sourceRoot":"","sources":["../../../nodes/LmChatCascadeFlow/LmChatCascadeFlow.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACX,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"LmChatCascadeFlow.node.d.ts","sourceRoot":"","sources":["../../../nodes/LmChatCascadeFlow/LmChatCascadeFlow.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACX,MAAM,cAAc,CAAC;AA4GtB,qBAAa,iBAAkB,YAAW,SAAS;IACjD,WAAW,EAAE,oBAAoB,CAyD/B;IAEI,UAAU,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CA6ClE"}
|
|
@@ -3,15 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LmChatCascadeFlow = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
5
|
const chat_models_1 = require("@langchain/core/language_models/chat_models");
|
|
6
|
-
const openai_1 = require("@langchain/openai");
|
|
7
|
-
const anthropic_1 = require("@langchain/anthropic");
|
|
8
6
|
/**
|
|
9
7
|
* Custom CascadeChatModel that wraps two models (drafter and verifier)
|
|
10
|
-
* and implements cascading logic
|
|
8
|
+
* and implements cascading logic with cost tracking
|
|
11
9
|
*/
|
|
12
10
|
class CascadeChatModel extends chat_models_1.BaseChatModel {
|
|
13
11
|
constructor(drafterModel, verifierModel, qualityThreshold = 0.7) {
|
|
14
12
|
super({});
|
|
13
|
+
// Cost tracking
|
|
14
|
+
this.drafterCost = 0;
|
|
15
|
+
this.verifierCost = 0;
|
|
16
|
+
this.drafterCount = 0;
|
|
17
|
+
this.verifierCount = 0;
|
|
15
18
|
this.drafterModel = drafterModel;
|
|
16
19
|
this.verifierModel = verifierModel;
|
|
17
20
|
this.qualityThreshold = qualityThreshold;
|
|
@@ -27,27 +30,45 @@ class CascadeChatModel extends chat_models_1.BaseChatModel {
|
|
|
27
30
|
const drafterResult = await this.drafterModel._generate(messages, options, runManager);
|
|
28
31
|
const drafterLatency = Date.now() - drafterStartTime;
|
|
29
32
|
const drafterMessage = drafterResult.generations[0].message;
|
|
30
|
-
|
|
31
|
-
//
|
|
33
|
+
this.drafterCount++;
|
|
34
|
+
// Step 2: Quality check
|
|
32
35
|
const responseText = drafterMessage.content.toString();
|
|
33
|
-
const qualityScore = Math.min(responseText.length / 100, 1.0);
|
|
36
|
+
const qualityScore = Math.min(responseText.length / 100, 1.0);
|
|
34
37
|
// Step 3: If quality is sufficient, return drafter response
|
|
35
38
|
if (qualityScore >= this.qualityThreshold) {
|
|
36
|
-
|
|
39
|
+
// Estimate cost savings
|
|
40
|
+
const estimatedDrafterCost = 0.0001; // $0.0001 per request (rough estimate)
|
|
41
|
+
const estimatedVerifierCost = 0.0016; // $0.0016 per request (rough estimate)
|
|
42
|
+
const savings = ((estimatedVerifierCost - estimatedDrafterCost) / estimatedVerifierCost * 100).toFixed(1);
|
|
43
|
+
console.log(`✅ CascadeFlow: Drafter accepted!`);
|
|
44
|
+
console.log(` Quality: ${qualityScore.toFixed(2)} (threshold: ${this.qualityThreshold})`);
|
|
45
|
+
console.log(` Latency: ${drafterLatency}ms`);
|
|
46
|
+
console.log(` 💰 Cost savings: ~${savings}% (used cheap model)`);
|
|
47
|
+
console.log(` 📊 Stats: ${this.drafterCount} drafter, ${this.verifierCount} verifier`);
|
|
37
48
|
return drafterResult;
|
|
38
49
|
}
|
|
39
50
|
// Step 4: Otherwise, escalate to verifier
|
|
40
|
-
console.log(`⚠️ CascadeFlow:
|
|
51
|
+
console.log(`⚠️ CascadeFlow: Quality below threshold, escalating to verifier...`);
|
|
52
|
+
console.log(` Quality: ${qualityScore.toFixed(2)} < ${this.qualityThreshold}`);
|
|
53
|
+
console.log(` Drafter latency: ${drafterLatency}ms`);
|
|
41
54
|
const verifierStartTime = Date.now();
|
|
42
55
|
const verifierResult = await this.verifierModel._generate(messages, options, runManager);
|
|
43
56
|
const verifierLatency = Date.now() - verifierStartTime;
|
|
44
|
-
|
|
57
|
+
this.verifierCount++;
|
|
58
|
+
const totalLatency = drafterLatency + verifierLatency;
|
|
59
|
+
const acceptanceRate = (this.drafterCount / (this.drafterCount + this.verifierCount) * 100).toFixed(1);
|
|
60
|
+
console.log(`✅ CascadeFlow: Verifier completed`);
|
|
61
|
+
console.log(` Verifier latency: ${verifierLatency}ms`);
|
|
62
|
+
console.log(` Total latency: ${totalLatency}ms`);
|
|
63
|
+
console.log(` 📊 Stats: ${this.drafterCount} drafter (${acceptanceRate}%), ${this.verifierCount} verifier`);
|
|
45
64
|
return verifierResult;
|
|
46
65
|
}
|
|
47
66
|
catch (error) {
|
|
48
67
|
// Fallback to verifier on error
|
|
49
|
-
console.log(`❌ CascadeFlow: Drafter failed, falling back to verifier
|
|
68
|
+
console.log(`❌ CascadeFlow: Drafter failed, falling back to verifier`);
|
|
69
|
+
console.log(` Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
50
70
|
const verifierResult = await this.verifierModel._generate(messages, options, runManager);
|
|
71
|
+
this.verifierCount++;
|
|
51
72
|
console.log('✅ CascadeFlow: Verifier fallback completed');
|
|
52
73
|
return verifierResult;
|
|
53
74
|
}
|
|
@@ -56,14 +77,14 @@ class CascadeChatModel extends chat_models_1.BaseChatModel {
|
|
|
56
77
|
class LmChatCascadeFlow {
|
|
57
78
|
constructor() {
|
|
58
79
|
this.description = {
|
|
59
|
-
displayName: 'CascadeFlow
|
|
80
|
+
displayName: 'CascadeFlow',
|
|
60
81
|
name: 'lmChatCascadeFlow',
|
|
61
82
|
icon: 'file:cascadeflow.svg',
|
|
62
83
|
group: ['transform'],
|
|
63
84
|
version: 1,
|
|
64
|
-
description: 'Smart AI model cascading with 40-85% cost savings.
|
|
85
|
+
description: 'Smart AI model cascading with 40-85% cost savings. Connect two AI models (drafter and verifier) and intelligently cascade between them.',
|
|
65
86
|
defaults: {
|
|
66
|
-
name: 'CascadeFlow
|
|
87
|
+
name: 'CascadeFlow',
|
|
67
88
|
},
|
|
68
89
|
codex: {
|
|
69
90
|
categories: ['AI'],
|
|
@@ -78,93 +99,27 @@ class LmChatCascadeFlow {
|
|
|
78
99
|
],
|
|
79
100
|
},
|
|
80
101
|
},
|
|
81
|
-
// Sub-node:
|
|
102
|
+
// Sub-node: accepts AI model connections
|
|
82
103
|
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
83
|
-
inputs: [
|
|
84
|
-
// Outputs an AI model that can be connected to Agent
|
|
85
|
-
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
86
|
-
outputs: ['ai_languageModel'],
|
|
87
|
-
outputNames: ['Model'],
|
|
88
|
-
credentials: [
|
|
89
|
-
{
|
|
90
|
-
name: 'cascadeFlowApi',
|
|
91
|
-
required: true,
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
properties: [
|
|
95
|
-
// Drafter Model Configuration
|
|
104
|
+
inputs: [
|
|
96
105
|
{
|
|
97
106
|
displayName: 'Drafter Model',
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
default: 'gpt-4o-mini',
|
|
107
|
+
type: 'ai_languageModel',
|
|
108
|
+
maxConnections: 1,
|
|
101
109
|
required: true,
|
|
102
|
-
description: 'The cheaper model to try first (e.g., gpt-4o-mini, claude-3-5-haiku-20241022)',
|
|
103
|
-
placeholder: 'gpt-4o-mini',
|
|
104
110
|
},
|
|
105
|
-
{
|
|
106
|
-
displayName: 'Drafter Provider',
|
|
107
|
-
name: 'drafterProvider',
|
|
108
|
-
type: 'options',
|
|
109
|
-
default: 'openai',
|
|
110
|
-
required: true,
|
|
111
|
-
options: [
|
|
112
|
-
{
|
|
113
|
-
name: 'OpenAI',
|
|
114
|
-
value: 'openai',
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: 'Anthropic',
|
|
118
|
-
value: 'anthropic',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
name: 'Groq',
|
|
122
|
-
value: 'groq',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: 'Together AI',
|
|
126
|
-
value: 'together',
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
description: 'Provider for the drafter model',
|
|
130
|
-
},
|
|
131
|
-
// Verifier Model Configuration
|
|
132
111
|
{
|
|
133
112
|
displayName: 'Verifier Model',
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
default: 'gpt-4o',
|
|
137
|
-
required: true,
|
|
138
|
-
description: 'The quality model to escalate to if needed (e.g., gpt-4o, claude-3-5-sonnet-20241022)',
|
|
139
|
-
placeholder: 'gpt-4o',
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
displayName: 'Verifier Provider',
|
|
143
|
-
name: 'verifierProvider',
|
|
144
|
-
type: 'options',
|
|
145
|
-
default: 'openai',
|
|
113
|
+
type: 'ai_languageModel',
|
|
114
|
+
maxConnections: 1,
|
|
146
115
|
required: true,
|
|
147
|
-
options: [
|
|
148
|
-
{
|
|
149
|
-
name: 'OpenAI',
|
|
150
|
-
value: 'openai',
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
name: 'Anthropic',
|
|
154
|
-
value: 'anthropic',
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
name: 'Groq',
|
|
158
|
-
value: 'groq',
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
name: 'Together AI',
|
|
162
|
-
value: 'together',
|
|
163
|
-
},
|
|
164
|
-
],
|
|
165
|
-
description: 'Provider for the verifier model',
|
|
166
116
|
},
|
|
167
|
-
|
|
117
|
+
],
|
|
118
|
+
// Outputs an AI model that can be connected to Chain nodes
|
|
119
|
+
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
120
|
+
outputs: ['ai_languageModel'],
|
|
121
|
+
outputNames: ['Model'],
|
|
122
|
+
properties: [
|
|
168
123
|
{
|
|
169
124
|
displayName: 'Quality Threshold',
|
|
170
125
|
name: 'qualityThreshold',
|
|
@@ -181,52 +136,21 @@ class LmChatCascadeFlow {
|
|
|
181
136
|
};
|
|
182
137
|
}
|
|
183
138
|
async supplyData() {
|
|
184
|
-
// Get credentials
|
|
185
|
-
const credentials = await this.getCredentials('cascadeFlowApi');
|
|
186
139
|
// Get parameters
|
|
187
|
-
const drafterModelName = this.getNodeParameter('drafterModel', 0);
|
|
188
|
-
const drafterProvider = this.getNodeParameter('drafterProvider', 0);
|
|
189
|
-
const verifierModelName = this.getNodeParameter('verifierModel', 0);
|
|
190
|
-
const verifierProvider = this.getNodeParameter('verifierProvider', 0);
|
|
191
140
|
const qualityThreshold = this.getNodeParameter('qualityThreshold', 0, 0.7);
|
|
192
|
-
//
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
switch (provider) {
|
|
206
|
-
case 'openai':
|
|
207
|
-
case 'groq':
|
|
208
|
-
case 'together':
|
|
209
|
-
return new openai_1.ChatOpenAI({
|
|
210
|
-
modelName,
|
|
211
|
-
apiKey,
|
|
212
|
-
configuration: provider === 'groq' ? {
|
|
213
|
-
baseURL: 'https://api.groq.com/openai/v1',
|
|
214
|
-
} : provider === 'together' ? {
|
|
215
|
-
baseURL: 'https://api.together.xyz/v1',
|
|
216
|
-
} : undefined,
|
|
217
|
-
});
|
|
218
|
-
case 'anthropic':
|
|
219
|
-
return new anthropic_1.ChatAnthropic({
|
|
220
|
-
modelName,
|
|
221
|
-
apiKey,
|
|
222
|
-
});
|
|
223
|
-
default:
|
|
224
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported provider: ${provider}`);
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
// Create drafter and verifier models
|
|
228
|
-
const drafterModel = createModel(drafterProvider, drafterModelName);
|
|
229
|
-
const verifierModel = createModel(verifierProvider, verifierModelName);
|
|
141
|
+
// Get the connected chat models from inputs
|
|
142
|
+
const drafterModel = (await this.getInputConnectionData('ai_languageModel', 0));
|
|
143
|
+
const verifierModel = (await this.getInputConnectionData('ai_languageModel', 1));
|
|
144
|
+
if (!drafterModel) {
|
|
145
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Drafter model is required. Please connect an AI chat model (OpenAI, Anthropic, Ollama, etc.) to the "Drafter Model" input.');
|
|
146
|
+
}
|
|
147
|
+
if (!verifierModel) {
|
|
148
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Verifier model is required. Please connect an AI chat model (OpenAI, Anthropic, Ollama, etc.) to the "Verifier Model" input.');
|
|
149
|
+
}
|
|
150
|
+
console.log('🚀 CascadeFlow initialized');
|
|
151
|
+
console.log(` Drafter: ${drafterModel._llmType()}`);
|
|
152
|
+
console.log(` Verifier: ${verifierModel._llmType()}`);
|
|
153
|
+
console.log(` Quality threshold: ${qualityThreshold}`);
|
|
230
154
|
// Create and return the cascade model
|
|
231
155
|
const cascadeModel = new CascadeChatModel(drafterModel, verifierModel, qualityThreshold);
|
|
232
156
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LmChatCascadeFlow.node.js","sourceRoot":"","sources":["../../../nodes/LmChatCascadeFlow/LmChatCascadeFlow.node.ts"],"names":[],"mappings":";;;AAOA,+CAAsE;AAEtE,6EAA4E;
|
|
1
|
+
{"version":3,"file":"LmChatCascadeFlow.node.js","sourceRoot":"","sources":["../../../nodes/LmChatCascadeFl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sB,CACrD,kBAAyB,EACzB,CAAC,CACF,CAAkB,CAAC;QAEpB,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,CACtD,kBAAyB,EACzB,CAAC,CACF,CAAkB,CAAC;QAEpB,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,iCAAkB,CAC1B,IAAI,CAAC,OAAO,EAAE,EACd,4HAA4H,CAC7H,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,IAAI,iCAAkB,CAC1B,IAAI,CAAC,OAAO,EAAE,EACd,8HAA8H,CAC/H,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,eAAe,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,gBAAgB,aAAa,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,yBAAyB,gBAAgB,EAAE,CAAC,CAAC;QAEzD,sCAAsC;QACtC,MAAM,YAAY,GAAG,IAAI,gBAAgB,CACvC,YAAY,EACZ,aAAa,EACb,gBAAgB,CACjB,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,YAAY;SACvB,CAAC;IACJ,CAAC;CACF;AAzGD,8CAyGC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cascadeflow/n8n-nodes-cascadeflow",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.13",
|
|
4
4
|
"description": "n8n node for cascadeflow - Smart AI model cascading with 40-85% cost savings",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"dist/credentials/CascadeFlowApi.credentials.js"
|
|
31
31
|
],
|
|
32
32
|
"nodes": [
|
|
33
|
-
"dist/nodes/CascadeFlow/CascadeFlow.node.js",
|
|
34
33
|
"dist/nodes/LmChatCascadeFlow/LmChatCascadeFlow.node.js"
|
|
35
34
|
]
|
|
36
35
|
},
|
|
@@ -48,13 +47,7 @@
|
|
|
48
47
|
"n8n-workflow": "*"
|
|
49
48
|
},
|
|
50
49
|
"dependencies": {
|
|
51
|
-
"@
|
|
52
|
-
"openai": "^4.73.1",
|
|
53
|
-
"@anthropic-ai/sdk": "^0.30.0",
|
|
54
|
-
"groq-sdk": "^0.5.0",
|
|
55
|
-
"@langchain/core": "^0.3.0",
|
|
56
|
-
"@langchain/openai": "^0.3.0",
|
|
57
|
-
"@langchain/anthropic": "^0.3.0"
|
|
50
|
+
"@langchain/core": "^0.3.0"
|
|
58
51
|
},
|
|
59
52
|
"scripts": {
|
|
60
53
|
"build": "tsc && gulp build:icons",
|