QVAC-14302 feat[api]: export RuntimeStats interface in NMT addon index.d.ts#1613
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolve changelog conflict: bump version to 2.0.3 (2.0.2 already taken on main). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Preview deployments for qvac-docs-staging ⚡️
Commit: Deployment ID: Static site name: |
Tier-based Approval Status |
Resolved conflicts in package.json (version bump on top of upstream's 2.1.0) and CHANGELOG.md (added 2.1.1 entry above upstream's 2.1.0 entry).
gianni-cor
left a comment
There was a problem hiding this comment.
Requesting one doc change before merge: please add a JSDoc on RuntimeStats covering the unit asymmetry and which backend emits which fields.
Verified against the C++ producers (TranslationModel.cpp lines 565-617 and nmt_state_backend.cpp lines 273-288):
totalTime,decodeTime,encodeTime→ seconds (us / 1e6)TTFT→ milliseconds (C++:encodeTime * 1000.0)TPS→ tokens per secondtotalTokens→ integer count
The field names give no hint of the seconds-vs-ms split, so without docs a consumer will reasonably assume all *Time fields share units. The sibling qvac-lib-infer-whispercpp already documents this on its own RuntimeStats — same pattern would work nicely here. Inline suggestion attached.
|
Pre-existing nit, not introduced by this PR — but you're already touching adjacent docs:
console.log('Translation completed in:', response.stats.totalTime, 'ms')Verified at Two options to make this consistent with the new console.log('Translation completed in:', response.stats.totalTime, 's')or console.log('Translation completed in:', response.stats.totalTime * 1000, 'ms')Up to you whether to fix here or in a follow-up — flagging since the new typed interface will make this contradiction more visible to SDK users. |
Address review on PR #1613: - Add JSDoc to `RuntimeStats` clarifying that `totalTime`/`encodeTime`/ `decodeTime` are seconds while `TTFT` is milliseconds, and listing which fields each backend emits (Bergamot omits `encodeTime`/`TTFT`). Note that pivot translations use prefixed keys. - Fix README quickstart that printed `totalTime` with a `'ms'` label even though the C++ producer emits seconds.
✅ E2E Mobile Test Results - iOSOverall Status: PASSED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
✅ E2E Mobile Test Results - AndroidOverall Status: PASSED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
🧪 C++ Test Coverage ReportCoverage: 📊 Detailed Coverage |
|
/review |
❌ E2E Mobile Test Results - iOSOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - AndroidOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - iOSOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - AndroidOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - iOSOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - AndroidOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - iOSOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - iOSOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - AndroidOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - AndroidOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - iOSOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - AndroidOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - iOSOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
❌ E2E Mobile Test Results - AndroidOverall Status: FAILED Test Summary
Links
Automated E2E mobile testing powered by AWS Device Farm |
Summary
RuntimeStatsinterface inpackages/qvac-lib-infer-nmtcpp/index.d.tstotalTokens,totalTime,decodeTime,TPS(required);encodeTime,TTFT(optional — GGML backend only)addon/src/model-interface/TranslationModel.cppFiles changed
packages/qvac-lib-infer-nmtcpp/index.d.ts— addedRuntimeStatsinterface (8 lines)Test plan
RuntimeStatsfrom@qvac/translation-nmtcpp