You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pivot.example.js and indictrans.js required model files to be manually pre-downloaded before running, unlike quickstart.js and batch.example.js which auto-download Bergamot models from Firefox CDN
New users running the examples for the first time would get a "model not found" error with no automatic resolution
How does it solve it?
pivot.example.js: Replace manual fs.existsSync checks with ensureBergamotModelFiles() and getBergamotFileNames() from bergamot-model-fetcher, auto-downloading es→en and en→it models from Firefox CDN when not found locally
indictrans.js: Create new lib/indictrans-model-fetcher.js that uses @qvac/registry-client to download the ggml-indictrans2-en-indic-dist-200M-q4_0.bin model from the QVAC registry when not found locally
Add @qvac/registry-client as a devDependency and export the new fetcher module
Both examples still support env var overrides (BERGAMOT_ESEN_PATH, BERGAMOT_ENIT_PATH, INDICTRANS_MODEL_PATH) for custom local paths
Bump package version to 2.0.3
How was it tested?
npx standard lint passes on all changed files
bare examples/pivot.example.js — models auto-downloaded from Firefox CDN, pivot translation (Spanish → English → Italian) completed successfully
Verified cached models are reused on subsequent runs (skips download)
API Changes
// New module exportconst{
ensureIndicTransModelFile,
getIndicTransFileName,
downloadIndicTransFromRegistry,INDICTRANS_MODELS}=require('@qvac/translation-nmtcpp/lib/indictrans-model-fetcher')// Ensures model is present, downloads from QVAC registry if notawaitensureIndicTransModelFile('./model/indictrans/model.bin')
RamazTs
changed the title
feat: auto-download models in pivot and indictrans examples
QVAC-17265 feat: auto-download models in pivot and indictrans examples
Apr 15, 2026
**PR Tier:** TIER1
**Current Status:** ✅ APPROVED
**Requirements:**
- 1 Team Member approval ✅ (1/1)
- 1 Team Lead OR Management approval ✅ (1/1)
---
*This comment is automatically updated when reviews change.*
Automated E2E mobile testing powered by AWS Device Farm Tests located in: test/mobile/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
pivot.example.jsandindictrans.jsrequired model files to be manually pre-downloaded before running, unlikequickstart.jsandbatch.example.jswhich auto-download Bergamot models from Firefox CDNHow does it solve it?
fs.existsSyncchecks withensureBergamotModelFiles()andgetBergamotFileNames()frombergamot-model-fetcher, auto-downloading es→en and en→it models from Firefox CDN when not found locallylib/indictrans-model-fetcher.jsthat uses@qvac/registry-clientto download theggml-indictrans2-en-indic-dist-200M-q4_0.binmodel from the QVAC registry when not found locally@qvac/registry-clientas a devDependency and export the new fetcher moduleBERGAMOT_ESEN_PATH,BERGAMOT_ENIT_PATH,INDICTRANS_MODEL_PATH) for custom local pathsHow was it tested?
npx standardlint passes on all changed filesbare examples/pivot.example.js— models auto-downloaded from Firefox CDN, pivot translation (Spanish → English → Italian) completed successfullyAPI Changes