A simple NPM package to use pre-trained AI models easily.
npm install easy-ai-oneEasyAI is a tiny prototype NPM package demonstrating an opinionated "all-in-one" workflow:
- tokenizer training (minimal BPE),
- simple n-gram model loader and generator (fallback),
- optional use of @xenova/transformers if installed.
Usage
Run the example:
``bash`
npm run example
Run tests:
`bash`
npm test
Files of interest:
- src/tokenizer.js — minimal BPE trainer + encode/decode + save/loadsrc/model.js
- — n-gram train/loadsrc/generator.js
- — sampling generatormodels/default-model.json
- — small bundled bigram modelexamples/simple-generation.js
- — example using EasyAI.getInstance()`
This is a prototype. For production-grade tokenizers/models use established libraries (tokenizers, transformers, ONNX runtimes).