Skip to content

feat: add Node.js CPU bindings - #31

Open
zhangzhenghao wants to merge 1 commit into
mainfrom
feat/node-bindings
Open

zhangzhenghao wants to merge 1 commit into
mainfrom
feat/node-bindings

Conversation

@zhangzhenghao

Copy link
Copy Markdown
Collaborator

Summary

  • Add synchronous Node-API CPU bindings under node/, with TypeScript declarations and CommonJS loading.
  • Expose model metadata, tokenization, text/audio embeddings, frame/CLaMP3 features, decoding/resampling, and explicit close; copy typed-array outputs and validate inputs.
  • Build self-contained static ggml/ICU/miniaudio dependencies with cmake-js; include pinned native sources and licenses in independently installable npm source tarballs.
  • Add deterministic CLAP/MERT integration fixtures, numerical text comparison and a subprocess regression for token-array getter reentrancy.
  • Add Linux x64/ARM64, macOS and Windows CI for source builds, types, packaging and standalone installed-package tests.

Verification

  • Independent review passed after fixing reentrant close/use-after-free and Apple MODULE linking.
  • Linux x64 Node runtime tests: 8/8 passed, including actual CLAP waveform/text and MERT frame/feature inference and NumPy numerical reference.
  • TypeScript checks passed.
  • Source tarball build/install and installed-package fixture generation/runtime tests passed (8/8).
  • Existing native CTest: 26/26 passed.
  • git diff --check passed.

Notes

  • Requires Node.js 22+, CMake 3.20+ and a C++17 toolchain; builds from source (no prebuilt binaries).
  • CPU-only synchronous API blocks its JavaScript thread; use a separate model per worker thread.
  • macOS, Windows and ARM verification is delegated to this PR's CI; published-weight accuracy/performance is not benchmarked here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants