Migration: RAG moved from the SDK to @qvac/rag. A standalone package for ingestion and retrieval.
QVAC Logo
SDKCapabilities
v0.25, the current release

Runtime capabilities

Check which capability contracts, and which major version of each, a runtime provides before loading a model.

Overview

An app built and released separately from the runtime it talks to cannot assume which operations that runtime serves: the runtime may have been assembled with a reduced plugin set, or with plugins from another vendor. getRuntimeCapabilities() lists the capability contracts the runtime's registered plugins declare, so the app can check for the contracts it needs before it loads a model.

Each entry names a contract and its major version:

{
  id: string                  // for example 'transcription'
  version: number             // major version, from 1
  operations: string[]        // every plugin that provides the contract implements these
  partialOperations: string[] // only some of those plugins implement these
}

The list is sorted by id and then version. A session handle has the same method and gets the same list. An empty list means the request succeeded and no registered plugin declares a contract. A runtime released before getRuntimeCapabilities rejects the request with an error instead, so treat an error as "capabilities unknown", not as "nothing available".

Contracts

A contract groups the operations whose schemas share a core. QVAC defines these contracts, all at major 1:

IDOperationsOptional operations
completioncompletionStreambatchCompletionStream, calcTokens
fine-tuningfinetune
translationtranslate
embeddingembed, embedBatch
rerankingrerank
decisiondecide
classificationclassify
transcriptiontranscribetranscribeStream
bci-transcriptionbciTranscribebciTranscribeStream
text-to-speechtextToSpeechtextToSpeechStream
ocrocrStream
stereo-depth-estimationestimateDisparity
image-generationdiffusionStream
image-upscalingupscaleStream
video-generationvideoStream
world-simulationworldStepStream, worldSceneStream
audio-generationaudioGenStreamaudioEditStream
audio-understandingaudioUnderstand
vision-language-actionvlaRun, vlaHparams, vlaSetEmbodiment

A contract with a dotted ID, such as acme.diarization, is defined by a third-party plugin rather than by QVAC. A third-party plugin can also provide a QVAC contract.

Contract IDs are also the keys of the runtime's deadline configuration.

An optional operation appears in operations when every plugin that provides the contract implements it, and in partialOperations when only some do. With the default plugin set, transcribeStream is in partialOperations: Whisper and Parakeet stream, MOSS does not. A call goes to the plugin of the model it names, so transcribeStream on a MOSS model still fails.

A contract names operations, not the inputs a provider accepts. embedding@1 is provided by both a text embedding plugin and an image embedding plugin, so the model you load decides whether text or images work.

Versions

Match on id and version together. A contract's major increases only on a change that breaks callers, such as removing an operation or changing a field's type. New optional fields and new optional operations do not change the major, and neither do SDK or addon releases.

An entry means that a registered plugin declares that major. The runtime checks that the plugin has a handler for each required operation, called the way the contract calls it, but not what the handler returns. When two majors of one contract are listed, each is a separate declaration: a call reaches the major that the plugin of the selected model serves.

Limits

The list comes from plugin registration only. It loads no model, and it does not check:

  • that a plugin's native addon loads on this device;
  • that model files exist, or that the device has the memory to load them;
  • which operations a particular model supports. A diffusion model, for example, still refuses videoStream although its plugin provides video-generation.

A call can therefore still fail with an error such as ModelOperationNotSupportedError.

A plugin that declares no contracts is not listed, and its operations can still be called as before.

Example

The following script lists the contracts the runtime provides and checks for the ones the app needs:

runtime-capabilities.js
import { CAPABILITY_CONTRACTS, getRuntimeCapabilities } from '@qvac/sdk';
// The contracts and majors this app was built against.
const REQUIRED = [CAPABILITY_CONTRACTS.completion, CAPABILITY_CONTRACTS.transcription];
function describe(capability) {
    const partial = capability.partialOperations.length
        ? `; only some plugins: ${capability.partialOperations.join(', ')}`
        : '';
    return `${capability.id}@${capability.version}: ${capability.operations.join(', ')}${partial}`;
}
try {
    const capabilities = await getRuntimeCapabilities();
    console.log('▸ Capability contracts the runtime provides');
    for (const capability of capabilities)
        console.log(`  ${describe(capability)}`);
    const missing = REQUIRED.filter((required) => !capabilities.some((capability) => capability.id === required.id && capability.version === required.version));
    if (missing.length > 0) {
        console.error(`✖ Missing: ${missing.map((m) => `${m.id}@${m.version}`).join(', ')}`);
        process.exit(1);
    }
    console.log('\n▸ Every required contract is available.');
    process.exit(0);
}
catch (error) {
    console.error('✖', error);
    process.exit(1);
}

Tip: all examples throughout this documentation are self-contained and runnable. For instructions on how to run them, see the JS/TS quickstart, the Python quickstart, or the Kotlin quickstart.

On this page

Ask anything about QVAC.