@nodetool-ai/cli-models 0.0.0-stage → 0.8.9-beta.2
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 +13 -2
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/api-client.d.ts +349 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +22 -0
- package/dist/api-client.js.map +1 -0
- package/dist/commands/models-hf.d.ts +9 -0
- package/dist/commands/models-hf.d.ts.map +1 -0
- package/dist/commands/models-hf.js +235 -0
- package/dist/commands/models-hf.js.map +1 -0
- package/dist/commands/models-recommended.d.ts +10 -0
- package/dist/commands/models-recommended.d.ts.map +1 -0
- package/dist/commands/models-recommended.js +117 -0
- package/dist/commands/models-recommended.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +203 -0
- package/dist/index.js.map +1 -0
- package/dist/nodetool.d.ts +3 -0
- package/dist/nodetool.d.ts.map +1 -0
- package/dist/nodetool.js +4 -0
- package/dist/nodetool.js.map +1 -0
- package/package.json +54 -4
package/README.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Model commands
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Additional model discovery and provider commands using the optional provider
|
|
4
|
+
implementation library.
|
|
5
|
+
|
|
6
|
+
Install this independent command feature through the default CLI:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
nodetool packs add cli-models --yes
|
|
10
|
+
nodetool models recommended --help
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Commands do not install missing features automatically. See the
|
|
14
|
+
[command reference](../../docs/cli.md#install-command-features).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2026-10-31T10:34:54.874Z
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/** Validate remote model records without importing the server application. */
|
|
2
|
+
export declare function createApiClient(apiUrl: string): {
|
|
3
|
+
models: {
|
|
4
|
+
all: {
|
|
5
|
+
query: (input?: unknown) => Promise<{
|
|
6
|
+
id: string;
|
|
7
|
+
type?: string | null | undefined;
|
|
8
|
+
name: string;
|
|
9
|
+
provider?: string | null | undefined;
|
|
10
|
+
repo_id?: string | null | undefined;
|
|
11
|
+
path?: string | null | undefined;
|
|
12
|
+
artifact_family?: string | null | undefined;
|
|
13
|
+
artifact_component?: string | null | undefined;
|
|
14
|
+
artifact_confidence?: number | null | undefined;
|
|
15
|
+
artifact_evidence?: string[] | null | undefined;
|
|
16
|
+
cache_path?: string | null | undefined;
|
|
17
|
+
allow_patterns?: string[] | null | undefined;
|
|
18
|
+
ignore_patterns?: string[] | null | undefined;
|
|
19
|
+
description?: string | null | undefined;
|
|
20
|
+
readme?: string | null | undefined;
|
|
21
|
+
downloaded?: boolean | null | undefined;
|
|
22
|
+
size_on_disk?: number | null | undefined;
|
|
23
|
+
pipeline_tag?: string | null | undefined;
|
|
24
|
+
tags?: string[] | null | undefined;
|
|
25
|
+
has_model_index?: boolean | null | undefined;
|
|
26
|
+
downloads?: number | null | undefined;
|
|
27
|
+
likes?: number | null | undefined;
|
|
28
|
+
supported_tasks?: string[] | null | undefined;
|
|
29
|
+
trending_score?: number | null | undefined;
|
|
30
|
+
image?: string | null | undefined;
|
|
31
|
+
supports_tools?: boolean | null | undefined;
|
|
32
|
+
voices?: string[] | null | undefined;
|
|
33
|
+
capabilities?: string[] | null | undefined;
|
|
34
|
+
languages?: string[] | null | undefined;
|
|
35
|
+
sample_rate?: number | null | undefined;
|
|
36
|
+
requires_reference_text?: boolean | null | undefined;
|
|
37
|
+
adapter?: {
|
|
38
|
+
state: "installed" | "missing_dependency" | "unknown";
|
|
39
|
+
reason_code?: string | null | undefined;
|
|
40
|
+
reason?: string | null | undefined;
|
|
41
|
+
artifact_ref?: {
|
|
42
|
+
source: "huggingface";
|
|
43
|
+
repo_id: string;
|
|
44
|
+
revision?: string | null | undefined;
|
|
45
|
+
path?: string | null | undefined;
|
|
46
|
+
allow_patterns?: string[] | null | undefined;
|
|
47
|
+
model_type?: string | null | undefined;
|
|
48
|
+
} | null | undefined;
|
|
49
|
+
extra_artifact_refs?: {
|
|
50
|
+
source: "huggingface";
|
|
51
|
+
repo_id: string;
|
|
52
|
+
revision?: string | null | undefined;
|
|
53
|
+
path?: string | null | undefined;
|
|
54
|
+
allow_patterns?: string[] | null | undefined;
|
|
55
|
+
model_type?: string | null | undefined;
|
|
56
|
+
}[] | null | undefined;
|
|
57
|
+
files_present?: boolean | null | undefined;
|
|
58
|
+
} | null | undefined;
|
|
59
|
+
execution?: {
|
|
60
|
+
kind: "api" | "local" | "server" | "unavailable";
|
|
61
|
+
state: "download_required" | "ready" | "unavailable";
|
|
62
|
+
label: "API" | "Local" | "Server" | "Unavailable";
|
|
63
|
+
reason?: string | null | undefined;
|
|
64
|
+
execution_site?: "nodetool_host" | "provider" | null | undefined;
|
|
65
|
+
runtime_name?: string | null | undefined;
|
|
66
|
+
} | null | undefined;
|
|
67
|
+
durations?: number[] | null | undefined;
|
|
68
|
+
resolutions?: string[] | null | undefined;
|
|
69
|
+
aspect_ratios?: string[] | null | undefined;
|
|
70
|
+
}[]>;
|
|
71
|
+
};
|
|
72
|
+
ollama: {
|
|
73
|
+
query: (input?: unknown) => Promise<{
|
|
74
|
+
id: string;
|
|
75
|
+
type?: string | null | undefined;
|
|
76
|
+
name: string;
|
|
77
|
+
provider?: string | null | undefined;
|
|
78
|
+
repo_id?: string | null | undefined;
|
|
79
|
+
path?: string | null | undefined;
|
|
80
|
+
artifact_family?: string | null | undefined;
|
|
81
|
+
artifact_component?: string | null | undefined;
|
|
82
|
+
artifact_confidence?: number | null | undefined;
|
|
83
|
+
artifact_evidence?: string[] | null | undefined;
|
|
84
|
+
cache_path?: string | null | undefined;
|
|
85
|
+
allow_patterns?: string[] | null | undefined;
|
|
86
|
+
ignore_patterns?: string[] | null | undefined;
|
|
87
|
+
description?: string | null | undefined;
|
|
88
|
+
readme?: string | null | undefined;
|
|
89
|
+
downloaded?: boolean | null | undefined;
|
|
90
|
+
size_on_disk?: number | null | undefined;
|
|
91
|
+
pipeline_tag?: string | null | undefined;
|
|
92
|
+
tags?: string[] | null | undefined;
|
|
93
|
+
has_model_index?: boolean | null | undefined;
|
|
94
|
+
downloads?: number | null | undefined;
|
|
95
|
+
likes?: number | null | undefined;
|
|
96
|
+
supported_tasks?: string[] | null | undefined;
|
|
97
|
+
trending_score?: number | null | undefined;
|
|
98
|
+
image?: string | null | undefined;
|
|
99
|
+
supports_tools?: boolean | null | undefined;
|
|
100
|
+
voices?: string[] | null | undefined;
|
|
101
|
+
capabilities?: string[] | null | undefined;
|
|
102
|
+
languages?: string[] | null | undefined;
|
|
103
|
+
sample_rate?: number | null | undefined;
|
|
104
|
+
requires_reference_text?: boolean | null | undefined;
|
|
105
|
+
adapter?: {
|
|
106
|
+
state: "installed" | "missing_dependency" | "unknown";
|
|
107
|
+
reason_code?: string | null | undefined;
|
|
108
|
+
reason?: string | null | undefined;
|
|
109
|
+
artifact_ref?: {
|
|
110
|
+
source: "huggingface";
|
|
111
|
+
repo_id: string;
|
|
112
|
+
revision?: string | null | undefined;
|
|
113
|
+
path?: string | null | undefined;
|
|
114
|
+
allow_patterns?: string[] | null | undefined;
|
|
115
|
+
model_type?: string | null | undefined;
|
|
116
|
+
} | null | undefined;
|
|
117
|
+
extra_artifact_refs?: {
|
|
118
|
+
source: "huggingface";
|
|
119
|
+
repo_id: string;
|
|
120
|
+
revision?: string | null | undefined;
|
|
121
|
+
path?: string | null | undefined;
|
|
122
|
+
allow_patterns?: string[] | null | undefined;
|
|
123
|
+
model_type?: string | null | undefined;
|
|
124
|
+
}[] | null | undefined;
|
|
125
|
+
files_present?: boolean | null | undefined;
|
|
126
|
+
} | null | undefined;
|
|
127
|
+
execution?: {
|
|
128
|
+
kind: "api" | "local" | "server" | "unavailable";
|
|
129
|
+
state: "download_required" | "ready" | "unavailable";
|
|
130
|
+
label: "API" | "Local" | "Server" | "Unavailable";
|
|
131
|
+
reason?: string | null | undefined;
|
|
132
|
+
execution_site?: "nodetool_host" | "provider" | null | undefined;
|
|
133
|
+
runtime_name?: string | null | undefined;
|
|
134
|
+
} | null | undefined;
|
|
135
|
+
durations?: number[] | null | undefined;
|
|
136
|
+
resolutions?: string[] | null | undefined;
|
|
137
|
+
aspect_ratios?: string[] | null | undefined;
|
|
138
|
+
}[]>;
|
|
139
|
+
};
|
|
140
|
+
huggingfaceSearch: {
|
|
141
|
+
query: (input?: unknown) => Promise<{
|
|
142
|
+
id: string;
|
|
143
|
+
type?: string | null | undefined;
|
|
144
|
+
name: string;
|
|
145
|
+
provider?: string | null | undefined;
|
|
146
|
+
repo_id?: string | null | undefined;
|
|
147
|
+
path?: string | null | undefined;
|
|
148
|
+
artifact_family?: string | null | undefined;
|
|
149
|
+
artifact_component?: string | null | undefined;
|
|
150
|
+
artifact_confidence?: number | null | undefined;
|
|
151
|
+
artifact_evidence?: string[] | null | undefined;
|
|
152
|
+
cache_path?: string | null | undefined;
|
|
153
|
+
allow_patterns?: string[] | null | undefined;
|
|
154
|
+
ignore_patterns?: string[] | null | undefined;
|
|
155
|
+
description?: string | null | undefined;
|
|
156
|
+
readme?: string | null | undefined;
|
|
157
|
+
downloaded?: boolean | null | undefined;
|
|
158
|
+
size_on_disk?: number | null | undefined;
|
|
159
|
+
pipeline_tag?: string | null | undefined;
|
|
160
|
+
tags?: string[] | null | undefined;
|
|
161
|
+
has_model_index?: boolean | null | undefined;
|
|
162
|
+
downloads?: number | null | undefined;
|
|
163
|
+
likes?: number | null | undefined;
|
|
164
|
+
supported_tasks?: string[] | null | undefined;
|
|
165
|
+
trending_score?: number | null | undefined;
|
|
166
|
+
image?: string | null | undefined;
|
|
167
|
+
supports_tools?: boolean | null | undefined;
|
|
168
|
+
voices?: string[] | null | undefined;
|
|
169
|
+
capabilities?: string[] | null | undefined;
|
|
170
|
+
languages?: string[] | null | undefined;
|
|
171
|
+
sample_rate?: number | null | undefined;
|
|
172
|
+
requires_reference_text?: boolean | null | undefined;
|
|
173
|
+
adapter?: {
|
|
174
|
+
state: "installed" | "missing_dependency" | "unknown";
|
|
175
|
+
reason_code?: string | null | undefined;
|
|
176
|
+
reason?: string | null | undefined;
|
|
177
|
+
artifact_ref?: {
|
|
178
|
+
source: "huggingface";
|
|
179
|
+
repo_id: string;
|
|
180
|
+
revision?: string | null | undefined;
|
|
181
|
+
path?: string | null | undefined;
|
|
182
|
+
allow_patterns?: string[] | null | undefined;
|
|
183
|
+
model_type?: string | null | undefined;
|
|
184
|
+
} | null | undefined;
|
|
185
|
+
extra_artifact_refs?: {
|
|
186
|
+
source: "huggingface";
|
|
187
|
+
repo_id: string;
|
|
188
|
+
revision?: string | null | undefined;
|
|
189
|
+
path?: string | null | undefined;
|
|
190
|
+
allow_patterns?: string[] | null | undefined;
|
|
191
|
+
model_type?: string | null | undefined;
|
|
192
|
+
}[] | null | undefined;
|
|
193
|
+
files_present?: boolean | null | undefined;
|
|
194
|
+
} | null | undefined;
|
|
195
|
+
execution?: {
|
|
196
|
+
kind: "api" | "local" | "server" | "unavailable";
|
|
197
|
+
state: "download_required" | "ready" | "unavailable";
|
|
198
|
+
label: "API" | "Local" | "Server" | "Unavailable";
|
|
199
|
+
reason?: string | null | undefined;
|
|
200
|
+
execution_site?: "nodetool_host" | "provider" | null | undefined;
|
|
201
|
+
runtime_name?: string | null | undefined;
|
|
202
|
+
} | null | undefined;
|
|
203
|
+
durations?: number[] | null | undefined;
|
|
204
|
+
resolutions?: string[] | null | undefined;
|
|
205
|
+
aspect_ratios?: string[] | null | undefined;
|
|
206
|
+
}[]>;
|
|
207
|
+
};
|
|
208
|
+
huggingfaceList: {
|
|
209
|
+
query: (input?: unknown) => Promise<{
|
|
210
|
+
id: string;
|
|
211
|
+
type?: string | null | undefined;
|
|
212
|
+
name: string;
|
|
213
|
+
provider?: string | null | undefined;
|
|
214
|
+
repo_id?: string | null | undefined;
|
|
215
|
+
path?: string | null | undefined;
|
|
216
|
+
artifact_family?: string | null | undefined;
|
|
217
|
+
artifact_component?: string | null | undefined;
|
|
218
|
+
artifact_confidence?: number | null | undefined;
|
|
219
|
+
artifact_evidence?: string[] | null | undefined;
|
|
220
|
+
cache_path?: string | null | undefined;
|
|
221
|
+
allow_patterns?: string[] | null | undefined;
|
|
222
|
+
ignore_patterns?: string[] | null | undefined;
|
|
223
|
+
description?: string | null | undefined;
|
|
224
|
+
readme?: string | null | undefined;
|
|
225
|
+
downloaded?: boolean | null | undefined;
|
|
226
|
+
size_on_disk?: number | null | undefined;
|
|
227
|
+
pipeline_tag?: string | null | undefined;
|
|
228
|
+
tags?: string[] | null | undefined;
|
|
229
|
+
has_model_index?: boolean | null | undefined;
|
|
230
|
+
downloads?: number | null | undefined;
|
|
231
|
+
likes?: number | null | undefined;
|
|
232
|
+
supported_tasks?: string[] | null | undefined;
|
|
233
|
+
trending_score?: number | null | undefined;
|
|
234
|
+
image?: string | null | undefined;
|
|
235
|
+
supports_tools?: boolean | null | undefined;
|
|
236
|
+
voices?: string[] | null | undefined;
|
|
237
|
+
capabilities?: string[] | null | undefined;
|
|
238
|
+
languages?: string[] | null | undefined;
|
|
239
|
+
sample_rate?: number | null | undefined;
|
|
240
|
+
requires_reference_text?: boolean | null | undefined;
|
|
241
|
+
adapter?: {
|
|
242
|
+
state: "installed" | "missing_dependency" | "unknown";
|
|
243
|
+
reason_code?: string | null | undefined;
|
|
244
|
+
reason?: string | null | undefined;
|
|
245
|
+
artifact_ref?: {
|
|
246
|
+
source: "huggingface";
|
|
247
|
+
repo_id: string;
|
|
248
|
+
revision?: string | null | undefined;
|
|
249
|
+
path?: string | null | undefined;
|
|
250
|
+
allow_patterns?: string[] | null | undefined;
|
|
251
|
+
model_type?: string | null | undefined;
|
|
252
|
+
} | null | undefined;
|
|
253
|
+
extra_artifact_refs?: {
|
|
254
|
+
source: "huggingface";
|
|
255
|
+
repo_id: string;
|
|
256
|
+
revision?: string | null | undefined;
|
|
257
|
+
path?: string | null | undefined;
|
|
258
|
+
allow_patterns?: string[] | null | undefined;
|
|
259
|
+
model_type?: string | null | undefined;
|
|
260
|
+
}[] | null | undefined;
|
|
261
|
+
files_present?: boolean | null | undefined;
|
|
262
|
+
} | null | undefined;
|
|
263
|
+
execution?: {
|
|
264
|
+
kind: "api" | "local" | "server" | "unavailable";
|
|
265
|
+
state: "download_required" | "ready" | "unavailable";
|
|
266
|
+
label: "API" | "Local" | "Server" | "Unavailable";
|
|
267
|
+
reason?: string | null | undefined;
|
|
268
|
+
execution_site?: "nodetool_host" | "provider" | null | undefined;
|
|
269
|
+
runtime_name?: string | null | undefined;
|
|
270
|
+
} | null | undefined;
|
|
271
|
+
durations?: number[] | null | undefined;
|
|
272
|
+
resolutions?: string[] | null | undefined;
|
|
273
|
+
aspect_ratios?: string[] | null | undefined;
|
|
274
|
+
}[]>;
|
|
275
|
+
};
|
|
276
|
+
recommended: {
|
|
277
|
+
query: (input?: unknown) => Promise<{
|
|
278
|
+
id: string;
|
|
279
|
+
type?: string | null | undefined;
|
|
280
|
+
name: string;
|
|
281
|
+
provider?: string | null | undefined;
|
|
282
|
+
repo_id?: string | null | undefined;
|
|
283
|
+
path?: string | null | undefined;
|
|
284
|
+
artifact_family?: string | null | undefined;
|
|
285
|
+
artifact_component?: string | null | undefined;
|
|
286
|
+
artifact_confidence?: number | null | undefined;
|
|
287
|
+
artifact_evidence?: string[] | null | undefined;
|
|
288
|
+
cache_path?: string | null | undefined;
|
|
289
|
+
allow_patterns?: string[] | null | undefined;
|
|
290
|
+
ignore_patterns?: string[] | null | undefined;
|
|
291
|
+
description?: string | null | undefined;
|
|
292
|
+
readme?: string | null | undefined;
|
|
293
|
+
downloaded?: boolean | null | undefined;
|
|
294
|
+
size_on_disk?: number | null | undefined;
|
|
295
|
+
pipeline_tag?: string | null | undefined;
|
|
296
|
+
tags?: string[] | null | undefined;
|
|
297
|
+
has_model_index?: boolean | null | undefined;
|
|
298
|
+
downloads?: number | null | undefined;
|
|
299
|
+
likes?: number | null | undefined;
|
|
300
|
+
supported_tasks?: string[] | null | undefined;
|
|
301
|
+
trending_score?: number | null | undefined;
|
|
302
|
+
image?: string | null | undefined;
|
|
303
|
+
supports_tools?: boolean | null | undefined;
|
|
304
|
+
voices?: string[] | null | undefined;
|
|
305
|
+
capabilities?: string[] | null | undefined;
|
|
306
|
+
languages?: string[] | null | undefined;
|
|
307
|
+
sample_rate?: number | null | undefined;
|
|
308
|
+
requires_reference_text?: boolean | null | undefined;
|
|
309
|
+
adapter?: {
|
|
310
|
+
state: "installed" | "missing_dependency" | "unknown";
|
|
311
|
+
reason_code?: string | null | undefined;
|
|
312
|
+
reason?: string | null | undefined;
|
|
313
|
+
artifact_ref?: {
|
|
314
|
+
source: "huggingface";
|
|
315
|
+
repo_id: string;
|
|
316
|
+
revision?: string | null | undefined;
|
|
317
|
+
path?: string | null | undefined;
|
|
318
|
+
allow_patterns?: string[] | null | undefined;
|
|
319
|
+
model_type?: string | null | undefined;
|
|
320
|
+
} | null | undefined;
|
|
321
|
+
extra_artifact_refs?: {
|
|
322
|
+
source: "huggingface";
|
|
323
|
+
repo_id: string;
|
|
324
|
+
revision?: string | null | undefined;
|
|
325
|
+
path?: string | null | undefined;
|
|
326
|
+
allow_patterns?: string[] | null | undefined;
|
|
327
|
+
model_type?: string | null | undefined;
|
|
328
|
+
}[] | null | undefined;
|
|
329
|
+
files_present?: boolean | null | undefined;
|
|
330
|
+
} | null | undefined;
|
|
331
|
+
execution?: {
|
|
332
|
+
kind: "api" | "local" | "server" | "unavailable";
|
|
333
|
+
state: "download_required" | "ready" | "unavailable";
|
|
334
|
+
label: "API" | "Local" | "Server" | "Unavailable";
|
|
335
|
+
reason?: string | null | undefined;
|
|
336
|
+
execution_site?: "nodetool_host" | "provider" | null | undefined;
|
|
337
|
+
runtime_name?: string | null | undefined;
|
|
338
|
+
} | null | undefined;
|
|
339
|
+
durations?: number[] | null | undefined;
|
|
340
|
+
resolutions?: string[] | null | undefined;
|
|
341
|
+
aspect_ratios?: string[] | null | undefined;
|
|
342
|
+
modality: "asr" | "audio_to_audio" | "image" | "language" | "music" | "tts" | "video";
|
|
343
|
+
task?: "embedding" | "image_to_image" | "image_to_video" | "text_generation" | "text_to_image" | "text_to_video" | "video_to_video" | undefined;
|
|
344
|
+
supported_systems?: ("darwin" | "linux" | "windows")[] | undefined;
|
|
345
|
+
}[]>;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
//# sourceMappingURL=api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAWA,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM;IAGnC,MAAM;QACb,GAAG;4BAFoD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAG9D,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QACN,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QACjB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QACf,WAAW;YAAI,KAAK,WAAiB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE/C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { unifiedModel } from "@nodetool-ai/protocol/api-schemas/models.js";
|
|
3
|
+
import { createRpcClient } from "@nodetool-ai/cli-common/rpc-client";
|
|
4
|
+
const modelsOutput = z.array(unifiedModel);
|
|
5
|
+
const recommendedOutput = z.array(unifiedModel.extend({
|
|
6
|
+
modality: z.enum(["language", "image", "tts", "asr", "video", "music", "audio_to_audio"]),
|
|
7
|
+
task: z.enum(["text_generation", "embedding", "text_to_image", "image_to_image", "text_to_video", "image_to_video", "video_to_video"]).optional(),
|
|
8
|
+
supported_systems: z.array(z.enum(["darwin", "linux", "windows"])).optional()
|
|
9
|
+
}));
|
|
10
|
+
/** Validate remote model records without importing the server application. */
|
|
11
|
+
export function createApiClient(apiUrl) {
|
|
12
|
+
const client = createRpcClient(apiUrl);
|
|
13
|
+
const query = (path) => ({ query: async (input) => modelsOutput.parse(await client.query(path, input)) });
|
|
14
|
+
return { models: {
|
|
15
|
+
all: query("models.all"),
|
|
16
|
+
ollama: query("models.ollama"),
|
|
17
|
+
huggingfaceSearch: query("models.huggingfaceSearch"),
|
|
18
|
+
huggingfaceList: query("models.huggingfaceList"),
|
|
19
|
+
recommended: { query: async (input) => recommendedOutput.parse(await client.query("models.recommended", input)) }
|
|
20
|
+
} };
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=api-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAC3C,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC;IACpD,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;IACzF,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,EAAE;IACjJ,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC9E,CAAC,CAAC,CAAC;AAEJ,8EAA8E;AAC9E,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAe,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;IAC5H,OAAO,EAAE,MAAM,EAAE;YACf,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC;YACxB,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC;YAC9B,iBAAiB,EAAE,KAAK,CAAC,0BAA0B,CAAC;YACpD,eAAe,EAAE,KAAK,CAAC,wBAAwB,CAAC;YAChD,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAe,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC,EAAE;SAC5H,EAAE,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `nodetool models hf-*` and `download-hf` commands.
|
|
3
|
+
*
|
|
4
|
+
* These operate locally against the HuggingFace cache / Hub HTTP API — they
|
|
5
|
+
* do not require a running nodetool server.
|
|
6
|
+
*/
|
|
7
|
+
import type { Command } from "commander";
|
|
8
|
+
export declare function registerHfCommands(models: Command): void;
|
|
9
|
+
//# sourceMappingURL=models-hf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models-hf.d.ts","sourceRoot":"","sources":["../../src/commands/models-hf.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgDzC,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAMxD"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `nodetool models hf-*` and `download-hf` commands.
|
|
3
|
+
*
|
|
4
|
+
* These operate locally against the HuggingFace cache / Hub HTTP API — they
|
|
5
|
+
* do not require a running nodetool server.
|
|
6
|
+
*/
|
|
7
|
+
import { DownloadManager, GENERIC_HF_TYPES, SUPPORTED_MODEL_TYPES, listAllHfModels, readCachedHfModels, searchHfHub } from "@nodetool-ai/huggingface";
|
|
8
|
+
import { asJson, printTable } from "@nodetool-ai/cli-common/commands/output";
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// Formatting helpers
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
function formatBytes(n) {
|
|
13
|
+
if (!n || n <= 0)
|
|
14
|
+
return "-";
|
|
15
|
+
const units = ["B", "KB", "MB", "GB", "TB"];
|
|
16
|
+
let value = n;
|
|
17
|
+
let i = 0;
|
|
18
|
+
while (value >= 1024 && i < units.length - 1) {
|
|
19
|
+
value /= 1024;
|
|
20
|
+
i++;
|
|
21
|
+
}
|
|
22
|
+
return `${value.toFixed(1)} ${units[i]}`;
|
|
23
|
+
}
|
|
24
|
+
function parseLimit(raw) {
|
|
25
|
+
if (raw === undefined || raw === "")
|
|
26
|
+
return undefined;
|
|
27
|
+
const parsed = Number.parseInt(raw, 10);
|
|
28
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
29
|
+
console.error(`Invalid --limit value: ${raw}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
return parsed;
|
|
33
|
+
}
|
|
34
|
+
function collectOption(value, previous) {
|
|
35
|
+
return previous ? [...previous, value] : [value];
|
|
36
|
+
}
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// Registration
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
export function registerHfCommands(models) {
|
|
41
|
+
registerHfTypes(models);
|
|
42
|
+
registerListHf(models);
|
|
43
|
+
registerListHfAll(models);
|
|
44
|
+
registerHfCache(models);
|
|
45
|
+
registerDownloadHf(models);
|
|
46
|
+
}
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
// hf-types
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
function registerHfTypes(models) {
|
|
51
|
+
models
|
|
52
|
+
.command("hf-types")
|
|
53
|
+
.description("Print the list of nodetool HF model types")
|
|
54
|
+
.option("--json", "Output as JSON")
|
|
55
|
+
.action((opts) => {
|
|
56
|
+
const types = [...SUPPORTED_MODEL_TYPES];
|
|
57
|
+
const generic = [...GENERIC_HF_TYPES];
|
|
58
|
+
if (opts.json) {
|
|
59
|
+
asJson({ types, generic });
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
for (const t of types) {
|
|
63
|
+
const marker = GENERIC_HF_TYPES.has(t) ? " (requires --task)" : "";
|
|
64
|
+
console.log(`${t}${marker}`);
|
|
65
|
+
}
|
|
66
|
+
if (generic.length > 0) {
|
|
67
|
+
console.log();
|
|
68
|
+
console.log("Generic types (require --task):");
|
|
69
|
+
for (const t of generic)
|
|
70
|
+
console.log(` ${t}`);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
// list-hf
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
function registerListHf(models) {
|
|
78
|
+
models
|
|
79
|
+
.command("list-hf <model_type>")
|
|
80
|
+
.description("Search the HuggingFace Hub for models matching a nodetool model type")
|
|
81
|
+
.option("--task <task>", "HF pipeline tag (required for generic types)")
|
|
82
|
+
.option("--limit <n>", "Cap the number of results")
|
|
83
|
+
.option("--json", "Output as JSON")
|
|
84
|
+
.action(async (modelType, opts) => {
|
|
85
|
+
try {
|
|
86
|
+
const limit = parseLimit(opts.limit);
|
|
87
|
+
const results = await searchHfHub({
|
|
88
|
+
modelType,
|
|
89
|
+
task: opts.task,
|
|
90
|
+
limit
|
|
91
|
+
});
|
|
92
|
+
if (opts.json) {
|
|
93
|
+
asJson(results);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
printTable(results.map((m) => ({
|
|
97
|
+
repo_id: m.id,
|
|
98
|
+
pipeline: m.pipeline_tag ?? "-",
|
|
99
|
+
library: m.library_name ?? "-",
|
|
100
|
+
downloads: m.downloads ?? 0,
|
|
101
|
+
likes: m.likes ?? 0
|
|
102
|
+
})));
|
|
103
|
+
}
|
|
104
|
+
catch (e) {
|
|
105
|
+
console.error(String(e instanceof Error ? e.message : e));
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// ---------------------------------------------------------------------------
|
|
111
|
+
// list-hf-all
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
function registerListHfAll(models) {
|
|
114
|
+
models
|
|
115
|
+
.command("list-hf-all")
|
|
116
|
+
.description("List HuggingFace models across every nodetool HF model type")
|
|
117
|
+
.option("--limit <n>", "Cap the total number of results")
|
|
118
|
+
.option("--repo-only", "Keep only repo-level entries (drop file-level entries)")
|
|
119
|
+
.option("--json", "Output as JSON")
|
|
120
|
+
.action(async (opts) => {
|
|
121
|
+
try {
|
|
122
|
+
const limit = parseLimit(opts.limit);
|
|
123
|
+
const results = await listAllHfModels({
|
|
124
|
+
limit,
|
|
125
|
+
repoOnly: Boolean(opts.repoOnly)
|
|
126
|
+
});
|
|
127
|
+
if (opts.json) {
|
|
128
|
+
asJson(results);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
printTable(results.map((m) => ({
|
|
132
|
+
repo_id: m.id,
|
|
133
|
+
model_type: m.model_type ?? "-",
|
|
134
|
+
pipeline: m.pipeline_tag ?? "-",
|
|
135
|
+
downloads: m.downloads ?? 0
|
|
136
|
+
})));
|
|
137
|
+
}
|
|
138
|
+
catch (e) {
|
|
139
|
+
console.error(String(e instanceof Error ? e.message : e));
|
|
140
|
+
process.exit(1);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// ---------------------------------------------------------------------------
|
|
145
|
+
// hf-cache
|
|
146
|
+
// ---------------------------------------------------------------------------
|
|
147
|
+
function registerHfCache(models) {
|
|
148
|
+
models
|
|
149
|
+
.command("hf-cache")
|
|
150
|
+
.description("List HuggingFace cache entries on the local machine")
|
|
151
|
+
.option("--downloaded-only", "Only show repos fully downloaded to disk")
|
|
152
|
+
.option("--limit <n>", "Cap the number of results")
|
|
153
|
+
.option("--json", "Output as JSON")
|
|
154
|
+
.action(async (opts) => {
|
|
155
|
+
try {
|
|
156
|
+
let rows = await readCachedHfModels();
|
|
157
|
+
if (opts.downloadedOnly)
|
|
158
|
+
rows = rows.filter((r) => r.downloaded);
|
|
159
|
+
const limit = parseLimit(opts.limit);
|
|
160
|
+
if (limit)
|
|
161
|
+
rows = rows.slice(0, limit);
|
|
162
|
+
if (opts.json) {
|
|
163
|
+
asJson(rows);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
printTable(rows.map((r) => ({
|
|
167
|
+
repo_id: r.repo_id ?? r.id,
|
|
168
|
+
path: r.path ?? "-",
|
|
169
|
+
type: r.type ?? "-",
|
|
170
|
+
downloaded: r.downloaded ? "yes" : "no",
|
|
171
|
+
size: formatBytes(r.size_on_disk),
|
|
172
|
+
pipeline: r.pipeline_tag ?? "-"
|
|
173
|
+
})));
|
|
174
|
+
}
|
|
175
|
+
catch (e) {
|
|
176
|
+
console.error(String(e instanceof Error ? e.message : e));
|
|
177
|
+
process.exit(1);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
// ---------------------------------------------------------------------------
|
|
182
|
+
// download-hf
|
|
183
|
+
// ---------------------------------------------------------------------------
|
|
184
|
+
function registerDownloadHf(models) {
|
|
185
|
+
models
|
|
186
|
+
.command("download-hf")
|
|
187
|
+
.description("Download a HuggingFace repository (or a single file) into the local cache")
|
|
188
|
+
.requiredOption("--repo-id <id>", "HuggingFace repo id (owner/name)")
|
|
189
|
+
.option("--cache-dir <dir>", "Override cache directory")
|
|
190
|
+
.option("--file-path <path>", "Download a single file from the repo")
|
|
191
|
+
.option("-a, --allow-patterns <pattern>", "Only download files matching this glob (repeatable)", collectOption)
|
|
192
|
+
.option("-i, --ignore-patterns <pattern>", "Skip files matching this glob (repeatable)", collectOption)
|
|
193
|
+
.action(async (opts) => {
|
|
194
|
+
const mgr = new DownloadManager();
|
|
195
|
+
let lastLine = "";
|
|
196
|
+
let errorMessage = null;
|
|
197
|
+
const render = (u) => {
|
|
198
|
+
if (u.status === "error") {
|
|
199
|
+
errorMessage = u.error ?? "download failed";
|
|
200
|
+
}
|
|
201
|
+
const pct = u.total_bytes > 0
|
|
202
|
+
? Math.floor((u.downloaded_bytes / u.total_bytes) * 100)
|
|
203
|
+
: 0;
|
|
204
|
+
const line = `[${u.status}] ${u.repo_id} ${u.downloaded_files}/${u.total_files} files ${formatBytes(u.downloaded_bytes)}/${formatBytes(u.total_bytes)} ${pct}%`;
|
|
205
|
+
if (line !== lastLine) {
|
|
206
|
+
process.stderr.write(`\r${line.padEnd(100)}`);
|
|
207
|
+
lastLine = line;
|
|
208
|
+
}
|
|
209
|
+
if (u.status === "completed" ||
|
|
210
|
+
u.status === "error" ||
|
|
211
|
+
u.status === "cancelled") {
|
|
212
|
+
process.stderr.write("\n");
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
try {
|
|
216
|
+
await mgr.startDownload(opts.repoId, {
|
|
217
|
+
path: opts.filePath ?? null,
|
|
218
|
+
allowPatterns: opts.allowPatterns ?? null,
|
|
219
|
+
ignorePatterns: opts.ignorePatterns ?? null,
|
|
220
|
+
cacheDir: opts.cacheDir ?? null,
|
|
221
|
+
onProgress: render
|
|
222
|
+
});
|
|
223
|
+
if (errorMessage) {
|
|
224
|
+
console.error(errorMessage);
|
|
225
|
+
process.exit(1);
|
|
226
|
+
}
|
|
227
|
+
console.log(`Downloaded '${opts.repoId}'`);
|
|
228
|
+
}
|
|
229
|
+
catch (e) {
|
|
230
|
+
console.error(String(e instanceof Error ? e.message : e));
|
|
231
|
+
process.exit(1);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=models-hf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models-hf.js","sourceRoot":"","sources":["../../src/commands/models-hf.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,WAAW,EAEZ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAE7E,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,SAAS,WAAW,CAAC,CAA4B;IAC/C,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC;IAC7B,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7C,KAAK,IAAI,IAA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AAC;YACD,IACE,CAAC,CAAC,MAAM,KAAK,WAAW;gBACxB,CAAC,CAAC,MAAM,KAAK,OAAO;gBACpB,CAAC,CAAC,MAAM,KAAK,WAAW,EACxB,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE;gBACnC,IAAI,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI;gBAC3B,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI;gBACzC,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,IAAI;gBAC3C,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI;gBAC/B,UAAU,EAAE,MAAM;aACnB,CAAC,CAAC;YACH,IAAI,YAAY,EAAE,CAAC;gBACjB,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `nodetool models recommended` — enhanced filtering over the curated list.
|
|
3
|
+
*
|
|
4
|
+
* By default reads `RECOMMENDED_MODELS` locally (no server needed). Pass
|
|
5
|
+
* `--check-servers` to defer to the tRPC endpoint, which also probes local
|
|
6
|
+
* server reachability (ollama, llama_cpp).
|
|
7
|
+
*/
|
|
8
|
+
import type { Command } from "commander";
|
|
9
|
+
export declare function registerRecommendedCommand(models: Command): void;
|
|
10
|
+
//# sourceMappingURL=models-recommended.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models-recommended.d.ts","sourceRoot":"","sources":["../../src/commands/models-recommended.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqGzC,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAiFhE"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `nodetool models recommended` — enhanced filtering over the curated list.
|
|
3
|
+
*
|
|
4
|
+
* By default reads `RECOMMENDED_MODELS` locally (no server needed). Pass
|
|
5
|
+
* `--check-servers` to defer to the tRPC endpoint, which also probes local
|
|
6
|
+
* server reachability (ollama, llama_cpp).
|
|
7
|
+
*/
|
|
8
|
+
import { createApiClient } from "../api-client.js";
|
|
9
|
+
import { RECOMMENDED_MODELS } from "@nodetool-ai/runtime";
|
|
10
|
+
import { asJson, printTable } from "@nodetool-ai/cli-common/commands/output";
|
|
11
|
+
const CATEGORY_FILTERS = {
|
|
12
|
+
all: {},
|
|
13
|
+
image: { modality: "image" },
|
|
14
|
+
"image-text-to-image": { modality: "image", task: "text_to_image" },
|
|
15
|
+
"image-image-to-image": { modality: "image", task: "image_to_image" },
|
|
16
|
+
language: { modality: "language" },
|
|
17
|
+
"language-text-generation": {
|
|
18
|
+
modality: "language",
|
|
19
|
+
task: "text_generation"
|
|
20
|
+
},
|
|
21
|
+
"language-embedding": { modality: "language", task: "embedding" },
|
|
22
|
+
asr: { modality: "asr" },
|
|
23
|
+
tts: { modality: "tts" },
|
|
24
|
+
"video-text-to-video": { modality: "video", task: "text_to_video" },
|
|
25
|
+
"video-image-to-video": { modality: "video", task: "image_to_video" }
|
|
26
|
+
};
|
|
27
|
+
const VALID_CATEGORIES = Object.keys(CATEGORY_FILTERS);
|
|
28
|
+
const VALID_SYSTEMS = ["darwin", "linux", "windows"];
|
|
29
|
+
function filterByCategory(rows, category) {
|
|
30
|
+
const filter = CATEGORY_FILTERS[category];
|
|
31
|
+
if (!filter)
|
|
32
|
+
return rows;
|
|
33
|
+
return rows.filter((m) => {
|
|
34
|
+
if (filter.modality && m.modality !== filter.modality)
|
|
35
|
+
return false;
|
|
36
|
+
if (filter.task && m.task !== filter.task)
|
|
37
|
+
return false;
|
|
38
|
+
return true;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function filterBySystem(rows, system) {
|
|
42
|
+
return rows.filter((m) => !m.supported_systems || m.supported_systems.includes(system));
|
|
43
|
+
}
|
|
44
|
+
function modelRow(m) {
|
|
45
|
+
return {
|
|
46
|
+
id: m.id,
|
|
47
|
+
name: m.name,
|
|
48
|
+
provider: m.provider ?? "",
|
|
49
|
+
type: m.type ?? "",
|
|
50
|
+
repo_id: m.repo_id ?? ""
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Registration
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
function parseLimit(raw) {
|
|
57
|
+
if (raw === undefined || raw === "")
|
|
58
|
+
return undefined;
|
|
59
|
+
const parsed = Number.parseInt(raw, 10);
|
|
60
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
61
|
+
console.error(`Invalid --limit value: ${raw}`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
return parsed;
|
|
65
|
+
}
|
|
66
|
+
export function registerRecommendedCommand(models) {
|
|
67
|
+
models
|
|
68
|
+
.command("recommended")
|
|
69
|
+
.description("List recommended models")
|
|
70
|
+
.option("--api-url <url>", "API base URL (only used with --check-servers)", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
71
|
+
.option("--category <category>", `Filter by category: ${VALID_CATEGORIES.join(", ")}`, "all")
|
|
72
|
+
.option("--system <system>", `Filter to a platform: ${VALID_SYSTEMS.join(", ")}`)
|
|
73
|
+
.option("--limit <n>", "Cap the number of results")
|
|
74
|
+
.option("--check-servers", "Check availability on local servers via the API (requires --api-url)")
|
|
75
|
+
.option("--json", "Output as JSON")
|
|
76
|
+
.action(async (opts) => {
|
|
77
|
+
if (!(opts.category in CATEGORY_FILTERS)) {
|
|
78
|
+
console.error(`Invalid --category '${opts.category}'. Valid values: ${VALID_CATEGORIES.join(", ")}`);
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
if (opts.system !== undefined &&
|
|
82
|
+
!VALID_SYSTEMS.includes(opts.system)) {
|
|
83
|
+
console.error(`Invalid --system '${opts.system}'. Valid values: ${VALID_SYSTEMS.join(", ")}`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
const limit = parseLimit(opts.limit);
|
|
87
|
+
try {
|
|
88
|
+
let rows;
|
|
89
|
+
if (opts.checkServers) {
|
|
90
|
+
const client = createApiClient(opts.apiUrl);
|
|
91
|
+
const remote = await client.models.recommended.query({
|
|
92
|
+
check_servers: true
|
|
93
|
+
});
|
|
94
|
+
rows = remote;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
rows = [...RECOMMENDED_MODELS];
|
|
98
|
+
}
|
|
99
|
+
rows = filterByCategory(rows, opts.category);
|
|
100
|
+
if (opts.system) {
|
|
101
|
+
rows = filterBySystem(rows, opts.system);
|
|
102
|
+
}
|
|
103
|
+
if (limit)
|
|
104
|
+
rows = rows.slice(0, limit);
|
|
105
|
+
if (opts.json) {
|
|
106
|
+
asJson(rows);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
printTable(rows.map(modelRow));
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
console.error(String(e instanceof Error ? e.message : e));
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=models-recommended.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models-recommended.js","sourceRoot":"","sources":["../../src/commands/models-recommended.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,kBAAkB,EAEnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAe7E,MAAM,gBAAgB,GAAmC;IACvD,GAAG,EAAE,EAAE;IACP,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE;IAC5B,qBAAqB,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE;IACnE,sBAAsB,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACrE,QAAQ,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE;IAClC,0BAA0B,EAAE;QAC1B,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,iBAAiB;KACxB;IACD,oBAAoB,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE;IACjE,GAAG,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;IACxB,GAAG,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;IACxB,qBAAqB,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE;IACnE,sBAAsB,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE;CACtE,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AACvD,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAU,CA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AAC,CAAC;YAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
export declare function createProgram(): Command;
|
|
3
|
+
export declare function run(argv: readonly string[]): Promise<void>;
|
|
4
|
+
export declare const feature: {
|
|
5
|
+
descriptor: {
|
|
6
|
+
id: string;
|
|
7
|
+
apiVersion: number;
|
|
8
|
+
requires: never[];
|
|
9
|
+
capabilities: string[];
|
|
10
|
+
};
|
|
11
|
+
run: typeof run;
|
|
12
|
+
};
|
|
13
|
+
export default feature;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAwB,MAAM,WAAW,CAAC;AAS1D,wBAAgB,aAAa,IAAI,OAAO,CAoNvC;AACD,wBAAsB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhE;AACD,eAAO,MAAM,OAAO;;QAAmB,EAAE;QAAgB,UAAU;QAAK,QAAQ;QAAM,YAAY;;;CAAyB,CAAC;eAC7G,OAAO"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { initializeCliRuntime } from "@nodetool-ai/cli-common/runtime-env";
|
|
2
|
+
import { configureCliPackHost } from "@nodetool-ai/pack-manager/packs/host";
|
|
3
|
+
import { Command, InvalidArgumentError } from "commander";
|
|
4
|
+
import { listAllModels, listConfiguredProviderInfo, listOllamaModels, listProviderModels, closePythonProviders } from "@nodetool-ai/cli-providers";
|
|
5
|
+
import { setupLocalDb } from "@nodetool-ai/cli-local/local-db";
|
|
6
|
+
import { readCachedHfModels, searchCachedHfModels } from "@nodetool-ai/huggingface";
|
|
7
|
+
import { asJson, printTable } from "@nodetool-ai/cli-common/commands/output";
|
|
8
|
+
import { printCommandError } from "@nodetool-ai/pack-manager/command-errors";
|
|
9
|
+
import { registerRecommendedCommand } from "./commands/models-recommended.js";
|
|
10
|
+
import { registerHfCommands } from "./commands/models-hf.js";
|
|
11
|
+
import { createApiClient } from "./api-client.js";
|
|
12
|
+
export function createProgram() {
|
|
13
|
+
const program = new Command().name("nodetool");
|
|
14
|
+
const models = program.command("models").description("Model management");
|
|
15
|
+
const modelKinds = [
|
|
16
|
+
"llm",
|
|
17
|
+
"image",
|
|
18
|
+
"tts",
|
|
19
|
+
"asr",
|
|
20
|
+
"video",
|
|
21
|
+
"embedding"
|
|
22
|
+
];
|
|
23
|
+
function modelRow(m) {
|
|
24
|
+
return {
|
|
25
|
+
id: m["id"],
|
|
26
|
+
name: m["name"],
|
|
27
|
+
provider: m["provider"] ?? "",
|
|
28
|
+
type: m["type"] ?? "",
|
|
29
|
+
repo_id: m["repo_id"] ?? ""
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
models
|
|
33
|
+
.command("list")
|
|
34
|
+
.description("List all models (recommended + provider + HF cached); local by default, --api-url for remote")
|
|
35
|
+
.option("--api-url <url>", "Query a remote server instead of local providers/cache", process.env["NODETOOL_API_URL"])
|
|
36
|
+
.option("--provider <id>", "Filter models by provider", (value) => {
|
|
37
|
+
if (value.length > 128 || !/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(value)) {
|
|
38
|
+
throw new InvalidArgumentError("Provider must be an identifier of 1 to 128 characters");
|
|
39
|
+
}
|
|
40
|
+
return value;
|
|
41
|
+
})
|
|
42
|
+
.option("--json", "Output as JSON")
|
|
43
|
+
.action(async (opts) => {
|
|
44
|
+
try {
|
|
45
|
+
let rows;
|
|
46
|
+
if (opts.apiUrl) {
|
|
47
|
+
const client = createApiClient(opts.apiUrl);
|
|
48
|
+
rows = await client.models.all.query();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
await setupLocalDb();
|
|
52
|
+
rows = await listAllModels();
|
|
53
|
+
}
|
|
54
|
+
if (opts.provider) {
|
|
55
|
+
rows = rows.filter((model) => model.provider === opts.provider);
|
|
56
|
+
}
|
|
57
|
+
if (opts.json) {
|
|
58
|
+
asJson(rows);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
printTable(rows.map(modelRow));
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
process.exit(printCommandError(e, opts.json));
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
models
|
|
68
|
+
.command("providers [provider]")
|
|
69
|
+
.description("List configured providers and their capabilities")
|
|
70
|
+
.option("--json", "Output as JSON")
|
|
71
|
+
.action(async (provider, opts) => {
|
|
72
|
+
await setupLocalDb();
|
|
73
|
+
try {
|
|
74
|
+
const all = await listConfiguredProviderInfo();
|
|
75
|
+
const data = provider ? all.filter((item) => item.provider === provider) : all;
|
|
76
|
+
if (opts.json) {
|
|
77
|
+
asJson(data);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
printTable(data.map((p) => ({
|
|
81
|
+
provider: p.provider,
|
|
82
|
+
capabilities: p.capabilities.join(", ")
|
|
83
|
+
})));
|
|
84
|
+
}
|
|
85
|
+
catch (e) {
|
|
86
|
+
process.exit(printCommandError(e, opts.json));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
registerRecommendedCommand(models);
|
|
90
|
+
registerHfCommands(models);
|
|
91
|
+
models
|
|
92
|
+
.command("ollama")
|
|
93
|
+
.description("List Ollama models (queries the local daemon; --api-url for remote)")
|
|
94
|
+
.option("--api-url <url>", "Query a remote server instead of the local Ollama daemon", process.env["NODETOOL_API_URL"])
|
|
95
|
+
.option("--json", "Output as JSON")
|
|
96
|
+
.action(async (opts) => {
|
|
97
|
+
try {
|
|
98
|
+
let rows;
|
|
99
|
+
if (opts.apiUrl) {
|
|
100
|
+
const client = createApiClient(opts.apiUrl);
|
|
101
|
+
rows = await client.models.ollama.query();
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
await setupLocalDb();
|
|
105
|
+
rows = await listOllamaModels();
|
|
106
|
+
}
|
|
107
|
+
if (opts.json) {
|
|
108
|
+
asJson(rows);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
printTable(rows.map(modelRow));
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
process.exit(printCommandError(e, opts.json));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
models
|
|
118
|
+
.command("huggingface")
|
|
119
|
+
.description("List HuggingFace cached models (scans the local cache; --api-url for remote)")
|
|
120
|
+
.option("--api-url <url>", "Query a remote server instead of the local HuggingFace cache", process.env["NODETOOL_API_URL"])
|
|
121
|
+
.option("--query <q>", "Search query")
|
|
122
|
+
.option("--type <t>", "Filter by HF model type")
|
|
123
|
+
.option("--json", "Output as JSON")
|
|
124
|
+
.action(async (opts) => {
|
|
125
|
+
try {
|
|
126
|
+
let rows;
|
|
127
|
+
if (opts.apiUrl) {
|
|
128
|
+
const client = createApiClient(opts.apiUrl);
|
|
129
|
+
if (opts.query || opts.type) {
|
|
130
|
+
const search = {};
|
|
131
|
+
if (opts.query) {
|
|
132
|
+
search.query = String(opts.query);
|
|
133
|
+
}
|
|
134
|
+
if (opts.type) {
|
|
135
|
+
search.type = String(opts.type);
|
|
136
|
+
}
|
|
137
|
+
rows = await client.models.huggingfaceSearch.query(search);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
rows = await client.models.huggingfaceList.query();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else if (opts.query || opts.type) {
|
|
144
|
+
// Wrap a bare query in wildcards so it matches as a substring, the same
|
|
145
|
+
// normalization the server's huggingfaceSearch applies.
|
|
146
|
+
const rawQuery = opts.query ? String(opts.query) : undefined;
|
|
147
|
+
const query = rawQuery && !rawQuery.includes("*") ? `*${rawQuery}*` : rawQuery;
|
|
148
|
+
rows = await searchCachedHfModels(query ? [query] : undefined, opts.type ? [String(opts.type)] : undefined);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
rows = await readCachedHfModels();
|
|
152
|
+
}
|
|
153
|
+
if (opts.json) {
|
|
154
|
+
asJson(rows);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
printTable(rows.map(modelRow));
|
|
158
|
+
}
|
|
159
|
+
catch (e) {
|
|
160
|
+
process.exit(printCommandError(e, opts.json));
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
models
|
|
164
|
+
.command("by-provider <provider>")
|
|
165
|
+
.description(`List models for a provider. --kind one of: ${modelKinds.join(", ")}`)
|
|
166
|
+
.option("--kind <kind>", "Model kind", "llm")
|
|
167
|
+
.option("--json", "Output as JSON")
|
|
168
|
+
.action(async (provider, opts) => {
|
|
169
|
+
const kind = modelKinds.find((candidate) => candidate === opts.kind);
|
|
170
|
+
if (!kind) {
|
|
171
|
+
console.error(`Invalid --kind '${opts.kind}'. Must be one of: ${modelKinds.join(", ")}`);
|
|
172
|
+
process.exit(1);
|
|
173
|
+
}
|
|
174
|
+
await setupLocalDb();
|
|
175
|
+
try {
|
|
176
|
+
const rows = await listProviderModels(provider, kind);
|
|
177
|
+
if (opts.json) {
|
|
178
|
+
asJson(rows);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
printTable(rows.map(modelRow));
|
|
182
|
+
}
|
|
183
|
+
catch (e) {
|
|
184
|
+
process.exit(printCommandError(e, opts.json));
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
return program;
|
|
188
|
+
}
|
|
189
|
+
export async function run(argv) {
|
|
190
|
+
initializeCliRuntime(import.meta.url);
|
|
191
|
+
configureCliPackHost(import.meta.url);
|
|
192
|
+
try {
|
|
193
|
+
const args = argv[0] === "providers" && argv[1] === "info"
|
|
194
|
+
? ["models", "providers", ...argv.slice(2)] : [...argv];
|
|
195
|
+
await createProgram().parseAsync(args, { from: "user" });
|
|
196
|
+
}
|
|
197
|
+
finally {
|
|
198
|
+
await closePythonProviders();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
export const feature = { descriptor: { id: "cli-models", apiVersion: 1, requires: [], capabilities: ["cli:models"] }, run };
|
|
202
|
+
export default feature;
|
|
203
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAC,oBAAoB,EAAC,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACnJ,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,MAAM,UAAU,aAAa;IAC7B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAEzE,MAAM,UAAU,GAAG;QACj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,MAAM,aAAa,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3D,CAAC;YAAS,CAAC;QACT,MAAM,oBAAoB,EAAE,CAAC;IAC/B,CAAC;AACF,CAAC;AACD,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC;AAC5H,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodetool.d.ts","sourceRoot":"","sources":["../src/nodetool.ts"],"names":[],"mappings":""}
|
package/dist/nodetool.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodetool.js","sourceRoot":"","sources":["../src/nodetool.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,MAAM,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
|
+
"version": "0.8.9-beta.2",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=22.0.0"
|
|
6
|
+
},
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://nodetool.ai",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/nodetool-ai/nodetool/issues"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
2
15
|
"name": "@nodetool-ai/cli-models",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
16
|
+
"description": "NodeTool model discovery and Hugging Face cache commands",
|
|
17
|
+
"main": "dist/index.js",
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "node ../../scripts/build-typescript-workspace.mjs",
|
|
25
|
+
"test": "node ../../scripts/run-vitest.mjs run",
|
|
26
|
+
"lint": "node ../../scripts/run-tsc.mjs --noEmit"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@nodetool-ai/cli-common": "0.8.9-beta.2",
|
|
30
|
+
"@nodetool-ai/huggingface": "0.8.9-beta.2",
|
|
31
|
+
"@nodetool-ai/runtime": "0.8.9-beta.2",
|
|
32
|
+
"commander": "^12.1.0",
|
|
33
|
+
"@nodetool-ai/cli-local": "0.8.9-beta.2",
|
|
34
|
+
"@nodetool-ai/cli-providers": "0.8.9-beta.2",
|
|
35
|
+
"@nodetool-ai/protocol": "0.8.9-beta.2",
|
|
36
|
+
"@nodetool-ai/pack-manager": "0.8.9-beta.2",
|
|
37
|
+
"zod": "^4.1.13"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"vitest": "^5.0.1",
|
|
41
|
+
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
42
|
+
},
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"nodetool-dev": "./src/index.ts",
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"import": "./dist/index.js",
|
|
48
|
+
"default": "./dist/index.js"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "https://github.com/nodetool-ai/nodetool.git",
|
|
54
|
+
"directory": "packages/cli-models"
|
|
55
|
+
}
|
|
56
|
+
}
|