QVAC Logo
How-to guides

Plugin system

Enable and disable built-in AI capabilities, and add new ones via custom plugins.

Overview

Each QVAC AI capability maps to a built-in plugin in the SDK. This lets you enable only what you need for your project and reduce your application's final bundle size.

In addition, you can add custom plugins — both your own and community ones — that extend QVAC's capabilities. In both cases, you'll use the QVAC configuration file and the SDK CLI.

Built-in plugins

Catalog

All the built-in plugins you can select, along with the AI tasks that depend on each one:

PluginUse in qvac.config.*AI tasks that require it
LLM@qvac/sdk/llamacpp-completion/pluginCompletion; multimodal; RAG
Embeddings@qvac/sdk/llamacpp-embedding/pluginText embeddings; RAG
ASR with whisper.cpp@qvac/sdk/whispercpp-transcription/pluginTranscription
ASR with Parakeet@qvac/sdk/parakeet-transcription/pluginTranscription
NMT@qvac/sdk/nmtcpp-translation/pluginTranslation
TTS@qvac/sdk/onnx-tts/pluginText-to-Speech
OCR@qvac/sdk/onnx-ocr/pluginOCR

Enabling

In your qvac.config.*, add the built-in plugins you’ll need in your project. For example:

qvac.config.json
{
  "plugins": [
    "@qvac/sdk/llamacpp-completion/plugin",
    "@qvac/sdk/onnx-ocr/plugin"
  ]
}

When developing for desktop environment, use the QVAC CLI to (re)bundle the SDK only with the selected plugins:

npx qvac bundle sdk

Only the selected plugins are included in your bundle, significantly reducing your application size. If plugins is omitted or an empty array, it bundles all built-in plugins by default.

See QVAC CLI to learn how to install and use it.

Custom plugins

Custom plugins are consumed as npm packages. Install the package, enable it in your qvac.config.* file like any built-in plugin, then import and use its API alongside the SDK's regular API.

Enabling

Install the plugin package in your project. For example:

npm i qvac-echo-plugin

In your qvac.config.*, add its <package_name>/plugin specifier alongside any built-in plugins. For example:

qvac.config.json
{
  "plugins": [
    "@qvac/sdk/llamacpp-completion/plugin",
    "qvac-echo-plugin/plugin"
  ]
}

When developing for desktop environment, use the SDK CLI to (re)bundle the SDK with all listed plugins:

npx qvac bundle sdk

Tip: when adding one or more custom plugins, you must also add all the built-in plugins you will need to use.

Usage

Custom plugins are consumed as npm packages. Install the package, enable it in your qvac.config.* file like any built-in plugin, then import and use its API alongside the SDK’s regular API.

import { loadModel, unloadModel } from "@qvac/sdk";

// 1. Import the API you need from the custom plugin package:
import { echo, echoStream } from "qvac-echo-plugin";

// 2. Load the model(s) required by the custom plugin:
const modelId = await loadModel({
  modelSrc: "/path/to/echo-model.bin",
  modelType: "echo",
});

// 3. Call functions exposed by the custom plugin API:
const result = await echo({ modelId, message: "Hello, plugin system!" });
console.log(result);

for await (const char of echoStream({ modelId, message: "Streaming test!" })) {
  process.stdout.write(char);
}

await unloadModel({ modelId });

Notes

On this page