n8n-nodes-ollama-reranker 1.2.0 → 1.3.1
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.
|
@@ -56,48 +56,42 @@ class OllamaReranker {
|
|
|
56
56
|
displayName: 'Model',
|
|
57
57
|
name: 'model',
|
|
58
58
|
type: 'options',
|
|
59
|
-
options: [
|
|
60
|
-
{
|
|
61
|
-
name: 'BGE Reranker v2-M3 (Recommended)',
|
|
62
|
-
value: 'bge-reranker-v2-m3',
|
|
63
|
-
description: 'Best general-purpose reranker, excellent balance of speed and accuracy',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: 'Qwen3-Reranker-0.6B (Fast)',
|
|
67
|
-
value: 'dengcao/Qwen3-Reranker-0.6B:Q5_K_M',
|
|
68
|
-
description: 'Fastest option, best for resource-limited environments',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: 'Qwen3-Reranker-4B (Balanced)',
|
|
72
|
-
value: 'dengcao/Qwen3-Reranker-4B:Q5_K_M',
|
|
73
|
-
description: 'Recommended for Qwen family - best balance of speed and accuracy',
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: 'Qwen3-Reranker-8B (Most Accurate)',
|
|
77
|
-
value: 'dengcao/Qwen3-Reranker-8B:Q5_K_M',
|
|
78
|
-
description: 'Highest accuracy, requires more resources',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: 'Custom Model',
|
|
82
|
-
value: 'custom',
|
|
83
|
-
description: 'Specify your own Ollama reranker model',
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
default: 'bge-reranker-v2-m3',
|
|
87
|
-
description: 'The Ollama reranker model to use',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
displayName: 'Custom Model Name',
|
|
91
|
-
name: 'customModel',
|
|
92
|
-
type: 'string',
|
|
93
59
|
default: '',
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
60
|
+
description: 'The reranker model to use - models are loaded from your configured Ollama/Custom API',
|
|
61
|
+
typeOptions: {
|
|
62
|
+
loadOptions: {
|
|
63
|
+
routing: {
|
|
64
|
+
request: {
|
|
65
|
+
method: 'GET',
|
|
66
|
+
url: '/api/tags',
|
|
67
|
+
},
|
|
68
|
+
output: {
|
|
69
|
+
postReceive: [
|
|
70
|
+
{
|
|
71
|
+
type: 'rootProperty',
|
|
72
|
+
properties: {
|
|
73
|
+
property: 'models',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: 'setKeyValue',
|
|
78
|
+
properties: {
|
|
79
|
+
name: '={{$responseItem.name}}',
|
|
80
|
+
value: '={{$responseItem.name}}',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: 'sort',
|
|
85
|
+
properties: {
|
|
86
|
+
key: 'name',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
99
92
|
},
|
|
100
93
|
},
|
|
94
|
+
required: true,
|
|
101
95
|
},
|
|
102
96
|
{
|
|
103
97
|
displayName: 'API Type',
|
|
@@ -200,12 +194,9 @@ class OllamaReranker {
|
|
|
200
194
|
this.logger.debug('Initializing Ollama Reranker Provider');
|
|
201
195
|
const self = this;
|
|
202
196
|
// Get node parameters once (provider nodes use index 0)
|
|
203
|
-
|
|
204
|
-
if (model ===
|
|
205
|
-
|
|
206
|
-
if (!(model === null || model === void 0 ? void 0 : model.trim())) {
|
|
207
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Custom model name is required when "Custom Model" is selected');
|
|
208
|
-
}
|
|
197
|
+
const model = this.getNodeParameter('model', 0);
|
|
198
|
+
if (!(model === null || model === void 0 ? void 0 : model.trim())) {
|
|
199
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Model selection is required. Please select a model from the dropdown.');
|
|
209
200
|
}
|
|
210
201
|
const apiType = this.getNodeParameter('apiType', 0, 'ollama');
|
|
211
202
|
const instruction = this.getNodeParameter('instruction', 0);
|
|
@@ -53,53 +53,47 @@ class OllamaRerankerWorkflow {
|
|
|
53
53
|
},
|
|
54
54
|
],
|
|
55
55
|
properties: [
|
|
56
|
-
// Model selection (
|
|
56
|
+
// Model selection with dynamic loading (using routing like Ollama Chat Model)
|
|
57
57
|
{
|
|
58
58
|
displayName: 'Model',
|
|
59
59
|
name: 'model',
|
|
60
60
|
type: 'options',
|
|
61
|
-
options: [
|
|
62
|
-
{
|
|
63
|
-
name: 'BGE Reranker v2-M3 (Recommended)',
|
|
64
|
-
value: 'bge-reranker-v2-m3',
|
|
65
|
-
description: 'Best general-purpose reranker',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'Qwen3-Reranker-0.6B (Fast)',
|
|
69
|
-
value: 'dengcao/Qwen3-Reranker-0.6B:Q5_K_M',
|
|
70
|
-
description: 'Fastest option',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: 'Qwen3-Reranker-4B (Balanced)',
|
|
74
|
-
value: 'dengcao/Qwen3-Reranker-4B:Q5_K_M',
|
|
75
|
-
description: 'Best balance',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: 'Qwen3-Reranker-8B (Most Accurate)',
|
|
79
|
-
value: 'dengcao/Qwen3-Reranker-8B:Q5_K_M',
|
|
80
|
-
description: 'Highest accuracy',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'Custom Model',
|
|
84
|
-
value: 'custom',
|
|
85
|
-
description: 'Specify your own model',
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
default: 'bge-reranker-v2-m3',
|
|
89
|
-
description: 'Ollama reranker model to use',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
displayName: 'Custom Model Name',
|
|
93
|
-
name: 'customModel',
|
|
94
|
-
type: 'string',
|
|
95
61
|
default: '',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
62
|
+
description: 'The reranker model to use - models are loaded from your configured Ollama/Custom API',
|
|
63
|
+
typeOptions: {
|
|
64
|
+
loadOptions: {
|
|
65
|
+
routing: {
|
|
66
|
+
request: {
|
|
67
|
+
method: 'GET',
|
|
68
|
+
url: '/api/tags',
|
|
69
|
+
},
|
|
70
|
+
output: {
|
|
71
|
+
postReceive: [
|
|
72
|
+
{
|
|
73
|
+
type: 'rootProperty',
|
|
74
|
+
properties: {
|
|
75
|
+
property: 'models',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'setKeyValue',
|
|
80
|
+
properties: {
|
|
81
|
+
name: '={{$responseItem.name}}',
|
|
82
|
+
value: '={{$responseItem.name}}',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
type: 'sort',
|
|
87
|
+
properties: {
|
|
88
|
+
key: 'name',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
101
94
|
},
|
|
102
95
|
},
|
|
96
|
+
required: true,
|
|
103
97
|
},
|
|
104
98
|
// API Type selection
|
|
105
99
|
{
|
|
@@ -307,12 +301,9 @@ class OllamaRerankerWorkflow {
|
|
|
307
301
|
}
|
|
308
302
|
const ollamaHost = credentials.host.replace(/\/$/, '');
|
|
309
303
|
// Get model
|
|
310
|
-
|
|
311
|
-
if (model ===
|
|
312
|
-
|
|
313
|
-
if (!(model === null || model === void 0 ? void 0 : model.trim())) {
|
|
314
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Custom model name is required');
|
|
315
|
-
}
|
|
304
|
+
const model = this.getNodeParameter('model', 0);
|
|
305
|
+
if (!(model === null || model === void 0 ? void 0 : model.trim())) {
|
|
306
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Model selection is required. Please select a model from the dropdown.');
|
|
316
307
|
}
|
|
317
308
|
// Get API type
|
|
318
309
|
const apiType = this.getNodeParameter('apiType', 0, 'ollama');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-ollama-reranker",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Ollama Reranker for n8n -
|
|
3
|
+
"version": "1.3.1",
|
|
4
|
+
"description": "Ollama Reranker for n8n - Dynamic model loading + Ollama/Custom API support (Vector Store provider + workflow node)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Gabriel BRUMENT",
|
|
7
7
|
"license": "MIT",
|