QVAC Logo
Getting started

Configuration

Use qvac.config.* to configure QVAC's overall behavior.

Overview

QVAC configuration is loaded once during initialization from qvac.config.* file — qvac.config.json, qvac.config.js, or qvac.config.ts — and remains immutable for the lifetime of the SDK instance. To provide configuration, either set the QVAC_CONFIG_PATH environment variable or place a qvac.config.* file at the root of your project.

When using only the SDK, providing a configuration is not required. If you do not provide one, the SDK uses the default settings. When using the HTTP server, however, providing a configuration is required.

Examples

Below are examples of qvac.config.* files. Values marked with <placeholders> should be replaced with your actual values.

qvac.config.json
{
  "plugins": ["<builtin_plugin_1>", "<custom_plugin_2>"],
  "loggerConsoleOutput": true,
  "loggerLevel": "info",
  "swarmRelays": ["<hyperbee_key_1>", "<hyperbee_key_2>"],
  "cacheDirectory": "</absolute/path/to/.qvac/models>",
  "httpDownloadConcurrency": 3,
  "httpConnectionTimeoutMs": 10000,
  "deviceDefaults": [
    {
      "name": "Samsung Galaxy force CPU",
      "match": { "platform": "android", "deviceBrand": "samsung" },
      "defaults": { "llm": { "device": "cpu" } }
    }
  ],
  "serve": {
    "models": {
      "<model_alias>": {
        "model": "<SDK_MODEL_CONSTANT>",
        "default": true,
        "preload": true,
        "config": {}
      }
    }
  }
}

Options

The following table lists all supported configuration options for qvac.config.*:

OptionDescriptionTypeRequiredDefault
pluginsPlugin specifiers to bundle (built-in and/or custom).string[]NoAll built-in plugins
loggerConsoleOutputEnable or disable console output for SDK loggers.booleanNotrue
loggerLevelGlobal log level for all SDK loggers."error" | "warn" | "info" | "debug"No"info"
swarmRelaysHyperswarm relay public keys (hex strings) for improved P2P connectivity (blind relays).string[]No
cacheDirectoryAbsolute path to the directory where models and other cached assets are stored.stringNo~/.qvac/models
httpDownloadConcurrencyMaximum number of concurrent HTTP downloads for sharded models.numberNo3
httpConnectionTimeoutMsTimeout in milliseconds for HTTP connection establishment (applies to HEAD and GET requests).numberNo10000
deviceDefaultsOverride loaded model config for specific devices. First matching pattern wins. Use it to optimize for different hardware.DevicePattern[]No
serveConfiguration for the HTTP server.ServeConfigNo

DevicePattern

FieldDescriptionTypeRequired
nameHuman-readable label for this pattern (used in logs).stringYes
matchWhich device(s) to target. All specified fields must match.DeviceMatchYes
defaultsModel config overrides to apply when matched.DeviceConfigDefaultsYes

DeviceMatch

FieldDescriptionTypeRequired
platformTarget platform."android" | "ios"Yes
deviceBrandCase-insensitive exact brand (e.g., "samsung", "google").stringNo
deviceModelPrefixCase-sensitive prefix match on the device model (e.g., "Pixel 10" matches "Pixel 10 Pro").stringNo
deviceModelContainsSubstring match on the device model (e.g., "Galaxy" matches "Samsung Galaxy S25").stringNo

DeviceConfigDefaults

Maps each model-type key to a model config object. For example (inside DevicePattern.defaults):

{
  "llm": { "device": "cpu", "ctx_size": 1024 },
  "embeddings": { "device": "cpu", "flashAttention": "off" }
}

Model types (allowed keys): llm | embeddings | whisper | parakeet | nmt | tts | ocr

Important: for the exact config fields supported by each model type (key), see modelConfigloadModel() at @qvac/sdk API reference.

ServeConfig

The serve.models field is a map of model aliases to model entries. Keys are the model aliases — the names that HTTP clients use in the model field of their requests. Values can be either a string (SDK model constant name, e.g., "QWEN3_600M_INST_Q4") or a ModelEntry object:

FieldDescriptionTypeRequired
modelSDK model constant name.stringYes (unless using src + type)
srcExplicit model source (URL or path).stringYes (if no model)
typeModel type: llm | embeddings | whisper | parakeet | nmt | tts | ocr.stringYes (if using src)
defaultUse as the default model for its endpoint category.booleanNo (false)
preloadLoad model into memory on server startup.booleanNo (true for constant entries, false for explicit)
configModel config overrides (same as modelConfig in loadModel()).objectNo

Example:

{
  "serve": {
    "models": {
      "my-llm": {
        "model": "QWEN3_600M_INST_Q4",
        "default": true,
        "preload": true,
        "config": { "ctx_size": 8192 }
      },
      "my-embed": "GTE_LARGE_FP16"
    }
  }
}

On this page