voyageai-cli 1.10.0 → 1.12.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 +23 -0
- package/demo.gif +0 -0
- package/package.json +1 -1
- package/src/cli.js +2 -0
- package/src/commands/about.js +85 -0
- package/src/commands/benchmark.js +418 -0
- package/src/commands/embed.js +5 -0
- package/src/commands/playground.js +7 -3
- package/src/commands/store.js +15 -4
- package/src/lib/api.js +6 -0
- package/src/lib/catalog.js +2 -0
- package/src/lib/explanations.js +76 -2
- package/src/lib/math.js +5 -0
- package/src/playground/index.html +530 -1
- package/test/commands/about.test.js +23 -0
- package/test/commands/benchmark.test.js +67 -0
- package/test/commands/embed.test.js +10 -0
- package/test/lib/explanations.test.js +6 -0
- package/voyageai-cli-playground.png +0 -0
|
@@ -241,6 +241,73 @@ describe('benchmark command', () => {
|
|
|
241
241
|
assert.ok(optionNames.includes('--save'), 'should have --save option');
|
|
242
242
|
});
|
|
243
243
|
|
|
244
|
+
it('has asymmetric subcommand', () => {
|
|
245
|
+
const program = new Command();
|
|
246
|
+
registerBenchmark(program);
|
|
247
|
+
const benchCmd = program.commands.find(c => c.name() === 'benchmark');
|
|
248
|
+
const asymSub = benchCmd.commands.find(c => c.name() === 'asymmetric');
|
|
249
|
+
assert.ok(asymSub, 'asymmetric subcommand should be registered');
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it('asymmetric has --doc-model and --query-models options', () => {
|
|
253
|
+
const program = new Command();
|
|
254
|
+
registerBenchmark(program);
|
|
255
|
+
const benchCmd = program.commands.find(c => c.name() === 'benchmark');
|
|
256
|
+
const asymSub = benchCmd.commands.find(c => c.name() === 'asymmetric');
|
|
257
|
+
const optionNames = asymSub.options.map(o => o.long);
|
|
258
|
+
assert.ok(optionNames.includes('--doc-model'), 'should have --doc-model');
|
|
259
|
+
assert.ok(optionNames.includes('--query-models'), 'should have --query-models');
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it('asymmetric defaults doc-model to voyage-4-large', () => {
|
|
263
|
+
const program = new Command();
|
|
264
|
+
registerBenchmark(program);
|
|
265
|
+
const benchCmd = program.commands.find(c => c.name() === 'benchmark');
|
|
266
|
+
const asymSub = benchCmd.commands.find(c => c.name() === 'asymmetric');
|
|
267
|
+
const opt = asymSub.options.find(o => o.long === '--doc-model');
|
|
268
|
+
assert.equal(opt.defaultValue, 'voyage-4-large');
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
it('has quantization subcommand with quant alias', () => {
|
|
272
|
+
const program = new Command();
|
|
273
|
+
registerBenchmark(program);
|
|
274
|
+
const benchCmd = program.commands.find(c => c.name() === 'benchmark');
|
|
275
|
+
const quantSub = benchCmd.commands.find(c => c.name() === 'quantization');
|
|
276
|
+
assert.ok(quantSub, 'quantization subcommand should be registered');
|
|
277
|
+
assert.ok(quantSub.aliases().includes('quant'), 'should have "quant" alias');
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it('quantization has --model, --dtypes, --query options', () => {
|
|
281
|
+
const program = new Command();
|
|
282
|
+
registerBenchmark(program);
|
|
283
|
+
const benchCmd = program.commands.find(c => c.name() === 'benchmark');
|
|
284
|
+
const quantSub = benchCmd.commands.find(c => c.name() === 'quantization');
|
|
285
|
+
const optionNames = quantSub.options.map(o => o.long);
|
|
286
|
+
assert.ok(optionNames.includes('--model'), 'should have --model');
|
|
287
|
+
assert.ok(optionNames.includes('--dtypes'), 'should have --dtypes');
|
|
288
|
+
assert.ok(optionNames.includes('--query'), 'should have --query');
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it('quantization defaults dtypes to float,int8,ubinary', () => {
|
|
292
|
+
const program = new Command();
|
|
293
|
+
registerBenchmark(program);
|
|
294
|
+
const benchCmd = program.commands.find(c => c.name() === 'benchmark');
|
|
295
|
+
const quantSub = benchCmd.commands.find(c => c.name() === 'quantization');
|
|
296
|
+
const dtypesOpt = quantSub.options.find(o => o.long === '--dtypes');
|
|
297
|
+
assert.equal(dtypesOpt.defaultValue, 'float,int8,ubinary');
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
it('quantization has --dimensions, --save, --file options', () => {
|
|
301
|
+
const program = new Command();
|
|
302
|
+
registerBenchmark(program);
|
|
303
|
+
const benchCmd = program.commands.find(c => c.name() === 'benchmark');
|
|
304
|
+
const quantSub = benchCmd.commands.find(c => c.name() === 'quantization');
|
|
305
|
+
const optionNames = quantSub.options.map(o => o.long);
|
|
306
|
+
assert.ok(optionNames.includes('--dimensions'), 'should have --dimensions');
|
|
307
|
+
assert.ok(optionNames.includes('--save'), 'should have --save');
|
|
308
|
+
assert.ok(optionNames.includes('--file'), 'should have --file');
|
|
309
|
+
});
|
|
310
|
+
|
|
244
311
|
it('batch defaults batch-sizes to 1,5,10,25,50', () => {
|
|
245
312
|
const program = new Command();
|
|
246
313
|
registerBenchmark(program);
|
|
@@ -29,4 +29,14 @@ describe('embed command', () => {
|
|
|
29
29
|
const optionNames = embedCmd.options.map(o => o.long);
|
|
30
30
|
assert.ok(optionNames.includes('--input-type'), 'should have --input-type option');
|
|
31
31
|
});
|
|
32
|
+
|
|
33
|
+
it('has --output-dtype flag with float default', () => {
|
|
34
|
+
const program = new Command();
|
|
35
|
+
registerEmbed(program);
|
|
36
|
+
const embedCmd = program.commands.find(c => c.name() === 'embed');
|
|
37
|
+
const optionNames = embedCmd.options.map(o => o.long);
|
|
38
|
+
assert.ok(optionNames.includes('--output-dtype'), 'should have --output-dtype option');
|
|
39
|
+
const opt = embedCmd.options.find(o => o.long === '--output-dtype');
|
|
40
|
+
assert.equal(opt.defaultValue, 'float');
|
|
41
|
+
});
|
|
32
42
|
});
|
|
@@ -17,6 +17,7 @@ describe('explanations', () => {
|
|
|
17
17
|
'api-keys',
|
|
18
18
|
'api-access',
|
|
19
19
|
'batch-processing',
|
|
20
|
+
'quantization',
|
|
20
21
|
'benchmarking',
|
|
21
22
|
];
|
|
22
23
|
|
|
@@ -90,6 +91,11 @@ describe('explanations', () => {
|
|
|
90
91
|
batch: 'batch-processing',
|
|
91
92
|
model: 'models',
|
|
92
93
|
batching: 'batch-processing',
|
|
94
|
+
quantize: 'quantization',
|
|
95
|
+
int8: 'quantization',
|
|
96
|
+
binary: 'quantization',
|
|
97
|
+
matryoshka: 'quantization',
|
|
98
|
+
dtype: 'quantization',
|
|
93
99
|
};
|
|
94
100
|
|
|
95
101
|
it('alias map covers expected aliases', () => {
|
|
Binary file
|