voyageai-cli 1.33.0 → 1.33.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/package.json +2 -1
- package/src/commands/doctor.js +27 -0
- package/src/lib/banner.js +1 -0
- package/src/lib/welcome.js +1 -1
- package/src/nano/nano-bridge.py +1 -1
- package/src/playground/index.html +24 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "voyageai-cli",
|
|
3
|
-
"version": "1.33.
|
|
3
|
+
"version": "1.33.2",
|
|
4
4
|
"description": "CLI for Voyage AI embeddings, reranking, and MongoDB Atlas Vector Search",
|
|
5
5
|
"_comment": "This package contains the CLI + web playground. The electron/ directory is excluded via .npmignore and distributed via GitHub Releases.",
|
|
6
6
|
"bin": {
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"test": "node --test test/**/*.test.js",
|
|
39
|
+
"prepare": "git config core.hooksPath scripts/hooks 2>/dev/null || true",
|
|
39
40
|
"reset": "node scripts/reset.js",
|
|
40
41
|
"version": "node scripts/sync-nano-version.js && git add src/nano/nano-bridge.py",
|
|
41
42
|
"release": "./scripts/release.sh",
|
package/src/commands/doctor.js
CHANGED
|
@@ -23,6 +23,7 @@ const CHECKS = {
|
|
|
23
23
|
llmConnection: { name: 'LLM API Connection', required: false },
|
|
24
24
|
mongodb: { name: 'MongoDB Connection', required: false },
|
|
25
25
|
pdfParse: { name: 'PDF Support (pdf-parse)', required: false },
|
|
26
|
+
nano: { name: 'Local Inference (voyage-4-nano)', required: false },
|
|
26
27
|
config: { name: 'Configuration Files', required: false },
|
|
27
28
|
};
|
|
28
29
|
|
|
@@ -441,6 +442,31 @@ async function fixPdfParse() {
|
|
|
441
442
|
}
|
|
442
443
|
}
|
|
443
444
|
|
|
445
|
+
function checkNano() {
|
|
446
|
+
try {
|
|
447
|
+
const { checkPython, checkVenv, checkDeps, checkModel } = require('../nano/nano-health');
|
|
448
|
+
const python = checkPython();
|
|
449
|
+
if (!python.ok) {
|
|
450
|
+
return { ok: null, message: 'Python 3.10+ not found', hint: 'Run: vai nano setup' };
|
|
451
|
+
}
|
|
452
|
+
const venv = checkVenv();
|
|
453
|
+
if (!venv.ok) {
|
|
454
|
+
return { ok: null, message: 'Not set up', hint: 'Run: vai nano setup (one-time install — enables free local embeddings)' };
|
|
455
|
+
}
|
|
456
|
+
const deps = checkDeps();
|
|
457
|
+
if (!deps.ok) {
|
|
458
|
+
return { ok: null, message: 'Dependencies missing', hint: 'Run: vai nano setup' };
|
|
459
|
+
}
|
|
460
|
+
const model = checkModel();
|
|
461
|
+
if (!model.ok) {
|
|
462
|
+
return { ok: null, message: 'Model not downloaded', hint: 'Run: vai nano setup' };
|
|
463
|
+
}
|
|
464
|
+
return { ok: true, message: 'Ready (free local embeddings via voyage-4-nano)' };
|
|
465
|
+
} catch {
|
|
466
|
+
return { ok: null, message: 'Not set up', hint: 'Run: vai nano setup (one-time install — enables free local embeddings)' };
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
444
470
|
async function runDoctor(options = {}) {
|
|
445
471
|
const { json, verbose, fix } = options;
|
|
446
472
|
|
|
@@ -460,6 +486,7 @@ async function runDoctor(options = {}) {
|
|
|
460
486
|
{ key: 'llmConnection', fn: checkLLMConnection },
|
|
461
487
|
{ key: 'mongodb', fn: checkMongoDB },
|
|
462
488
|
{ key: 'pdfParse', fn: checkPdfParse },
|
|
489
|
+
{ key: 'nano', fn: checkNano },
|
|
463
490
|
{ key: 'config', fn: checkConfig },
|
|
464
491
|
];
|
|
465
492
|
|
package/src/lib/banner.js
CHANGED
|
@@ -66,6 +66,7 @@ function showQuickStart() {
|
|
|
66
66
|
console.log(` ${pc.cyan('$ vai embed "hello world"')} Generate embeddings`);
|
|
67
67
|
console.log(` ${pc.cyan('$ vai models')} List available models`);
|
|
68
68
|
console.log(` ${pc.cyan('$ vai demo')} Interactive walkthrough`);
|
|
69
|
+
console.log(` ${pc.cyan('$ vai nano setup')} Enable free local embeddings`);
|
|
69
70
|
console.log('');
|
|
70
71
|
console.log(` Run ${pc.cyan('vai <command> --help')} for detailed usage.`);
|
|
71
72
|
console.log('');
|
package/src/lib/welcome.js
CHANGED
|
@@ -96,7 +96,7 @@ async function runWelcome(opts = {}) {
|
|
|
96
96
|
console.log(pc.bold(' What to do next:\n'));
|
|
97
97
|
console.log(` ${pc.cyan('vai quickstart')} Zero-to-search tutorial (2 min)`);
|
|
98
98
|
console.log(` ${pc.cyan('vai doctor')} Verify your full setup`);
|
|
99
|
-
console.log(` ${pc.cyan('vai
|
|
99
|
+
console.log(` ${pc.cyan('vai nano setup')} Enable free local embeddings`);
|
|
100
100
|
console.log(` ${pc.cyan('vai embed "hello"')} Generate your first embedding`);
|
|
101
101
|
console.log('');
|
|
102
102
|
console.log(pc.dim(' Run vai --help to see all commands.\n'));
|
package/src/nano/nano-bridge.py
CHANGED
|
@@ -16388,19 +16388,37 @@ let chatSessionId = null;
|
|
|
16388
16388
|
|
|
16389
16389
|
function updateHealthDots(config) {
|
|
16390
16390
|
var dots = [
|
|
16391
|
-
{ id: 'healthDotOllama', available: config.ollamaAvailable
|
|
16392
|
-
|
|
16393
|
-
{ id: '
|
|
16391
|
+
{ id: 'healthDotOllama', available: config.ollamaAvailable,
|
|
16392
|
+
tipAvail: 'Ollama: running', tipMissing: 'Ollama: not detected' },
|
|
16393
|
+
{ id: 'healthDotNano', available: config.nanoAvailable,
|
|
16394
|
+
tipAvail: 'voyage-4-nano: ready',
|
|
16395
|
+
tipMissing: 'voyage-4-nano: not set up — run "vai nano setup" in your terminal' },
|
|
16396
|
+
{ id: 'healthDotApiKey', available: config.hasApiKey,
|
|
16397
|
+
tipAvail: 'API key: configured', tipMissing: 'API key: not set' },
|
|
16394
16398
|
];
|
|
16395
16399
|
dots.forEach(function(d) {
|
|
16396
16400
|
var el = document.getElementById(d.id);
|
|
16397
16401
|
if (el) {
|
|
16398
16402
|
el.className = 'health-dot ' + (d.available ? 'available' : 'unavailable');
|
|
16399
|
-
el.title = d.available
|
|
16400
|
-
|
|
16401
|
-
: el.id.replace('healthDot', '') + ': not detected';
|
|
16403
|
+
el.title = d.available ? d.tipAvail : d.tipMissing;
|
|
16404
|
+
el.style.cursor = d.available ? '' : 'help';
|
|
16402
16405
|
}
|
|
16403
16406
|
});
|
|
16407
|
+
// Show nano setup hint below embedding dropdown when nano is unavailable
|
|
16408
|
+
var nanoHint = document.getElementById('nanoSetupHint');
|
|
16409
|
+
if (!nanoHint) {
|
|
16410
|
+
var embedRow = document.getElementById('healthDotNano');
|
|
16411
|
+
if (embedRow && embedRow.parentElement) {
|
|
16412
|
+
nanoHint = document.createElement('div');
|
|
16413
|
+
nanoHint.id = 'nanoSetupHint';
|
|
16414
|
+
nanoHint.style.cssText = 'font-size:11px;margin-top:4px;padding:6px 8px;border-radius:6px;background:rgba(239,68,68,0.08);border:1px solid rgba(239,68,68,0.15);';
|
|
16415
|
+
nanoHint.innerHTML = '<span style="opacity:0.9">Free local embeddings available!</span> Run <code style="background:rgba(0,212,170,0.15);padding:1px 5px;border-radius:3px;font-size:10px;">vai nano setup</code> in your terminal to enable.';
|
|
16416
|
+
embedRow.parentElement.parentElement.appendChild(nanoHint);
|
|
16417
|
+
}
|
|
16418
|
+
}
|
|
16419
|
+
if (nanoHint) {
|
|
16420
|
+
nanoHint.style.display = config.nanoAvailable ? 'none' : 'block';
|
|
16421
|
+
}
|
|
16404
16422
|
// Show API key row if no API key (so user sees the red dot and knows to add one)
|
|
16405
16423
|
var apiKeyRow = document.getElementById('chatApiKeyRow');
|
|
16406
16424
|
if (apiKeyRow && !config.hasApiKey) {
|