Ailoy 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.
# npm
npm install ailoy-node
# yarn
yarn add ailoy-node
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();
# Install dev dependencies
npm install
# This generates `ailoy_core.<platform>.node` under `src/`
npm run build:napi
# This builds the bundled index.js and index.d.ts under `dist/`
npm run build:ts
# To build napi module and typescript at once
npm run build
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.
# Run all test cases
npm run test
# Run test cases with filtering
npm run test -- -t "Agent.*Local"
npm pack