Node.js binding for Ailoy API
npm install ailoy-nodeAiloy is a lightweight library for building AI applications — such as agent systems or RAG pipelines — with ease. It is designed to enable AI features effortlessly, one can just import and use.
See our documentation for more details.
``bash`npm
npm install ailoy-nodeyarn
yarn add ailoy-node
`typescript
import * as ai from "ailoy-node";
async function main() {
// Create Qwen3-0.6B LocalLanguageModel
const model = await ai.LangModel.newLocal("Qwen/Qwen3-0.6B");
// Create an agent using this model
const agent = new ai.Agent(model);
// Ask a prompt and iterate over agent's responses
for await (const resp of agent.run("What is your name?")) {
console.log(resp);
}
}
await main();
`
- Rust >= 1.88
- Node.js >= LTS version
- C/C++ compiler
(recommended versions are below)
- GCC >= 13
- LLVM Clang >= 17
- Apple Clang >= 15
- MSVC >= 19.29
- CMake >= 3.28.0
- Git
- OpenMP (required to build Faiss)
- BLAS (required to build Faiss)
- LAPACK (required to build Faiss)
- Vulkan SDK (on Windows and Linux)
`bashInstall dev dependencies
npm install
under src/$3
Some test cases require specific environment variables to be set before running the test (e.g.
OPENAI_API_KEY). Please fill .env.template and rename to .env in order to run every tests.`bash
Run all test cases
npm run testRun test cases with filtering
npm run test -- -t "Agent.*Local"
`$3
`bash
npm pack
``