@appweaver/ai
v2.10.0
Published
Appweaver - the backend framework for AI-first development (@ai)
Maintainers
Readme
Description
@appweaver/ai is the AI module of Appweaver, enabled by installing it.
AiService calls the models (LLMs) of the endpoints of the ai config: a whole response, a stream, an object matching
a TypeBox schema, a classification or embeddings, directly or through the ai queue, running the tools the model calls
(createAiTool). The models are named by references (local:qwen3:8b) or by aliases (fast, smart), so every
environment picks its own: a local Ollama while developing, the built-in mock model in the tests, OpenRouter or OpenAI
in production. The drivers are modules of their own, every installed one usable at once: @appweaver/openai reaches
OpenAI and every OpenAI-compatible server.
Installation
npm install @appweaver/ai @appweaver/openaior weaver module add ai in a project created with @appweaver/create.
{
"config": {
"ai": {
"endpoints": { "local": { "preset": "ollama" } },
"defaultModel": "local:qwen3:8b",
"aliases": { "fast": "local:qwen3:8b" }
}
}
}const ai = inject(AiService);
const { text } = await ai.generate({ model: 'fast', prompt: 'Summarize: ...' });
for await (const delta of ai.stream({ prompt: question }))
process.stdout.write(delta);Documentation
- Appweaver README – getting started, configuration, and the overview of every package
- AI reference – the endpoints, the presets,
AiService, the tools and the drivers - Agent skill – the complete framework reference shipped to every scaffolded project
License
Appweaver is MIT licensed.
