Skip to main content
Version: @ai-coustics/aic-sdk 0.24.0, Core SDK 0.24.0. API index · Node.js quickstart.

Model

Read-only model weights. Use Model.fromFile; there is no public constructor. Enhancement, VAD and analysis models are different types. A model can supply multiple independent compatible objects. Those objects retain the weights after this handle is disposed. The file stays memory-mapped until the last dependent object is released; do not change or delete it meanwhile.

Model.fromFile

path names a local .aicmodel file. Loads it synchronously and returns a new handle. Throws for an invalid path, filesystem failure, corrupt model or incompatible format. It does not download the model. Keep the file unchanged while any object retains it.

Model.dispose

Releases this handle’s native reference synchronously. Idempotent. Instance methods then throw Model has been disposed; existing processors, VADs and analyzers retain their own model reference. Static factories remain callable.

Model.download

modelId is the exact catalog ID; downloadDir is the destination directory, created if needed. Returns a promise for the local path. Work runs on the libuv pool. The downloader resolves a compatible artifact through its manifest/cache and verifies the checksum of an existing file before reuse. It can fetch or refresh metadata and replace an invalid cached file. It can reject for an unknown/incompatible ID, network, checksum or filesystem failure. For a deployment that must load without downloads, provision the file first and use fromFile.

Model.getId

Returns the loaded model’s identifier, which can include build and format suffixes beyond the requested download ID. Use it when recording an evaluation. Throws after disposal.

Model.getOptimalSampleRate

Returns the model’s native rate in Hz as a JavaScript number. Throws after disposal. Native frequency coverage does not expand when host input is resampled from a higher rate.

Model.getOptimalBlockSize

sampleRate is the intended whole-number input rate in Hz. Returns the corresponding optimal mono block length in samples as a JavaScript number. This query does not validate an entire audio configuration; initialize does. Throws after disposal.

OtelConfig

A TypeScript object interface, not a JavaScript constructor. Accepted by Processor, ProcessorAsync, Vad and VadAsync. Supplying it overrides environment-based OpenTelemetry settings for that instance. Analyzer has no otelConfig argument in this release. This configuration does not replace SDK authentication or usage reporting.

OtelConfig.enable

Required boolean. Enables or disables OpenTelemetry export for this instance. Disabling it does not waive credential or usage-reporting requirements.

OtelConfig.sessionId

Optional string. If omitted, the SDK generates a session identifier. Avoid customer data or secrets in this value.

OtelConfig.exportIntervalMs

Optional nonnegative whole-number interval in milliseconds. Omission or 0 requests the SDK default of 60,000 ms. The wrapper passes a 32-bit unsigned integer to the SDK.

getCompatibleModelVersion

Returns the model-file format version supported by the loaded SDK. This is not a model display version or npm package version. No credential or model is needed.

getVersion

Returns the underlying native SDK version string. It can differ from the npm package version. No credential or model is needed.

Example

Save as inspect-model.cjs and run node inspect-model.cjs path/to/model.aicmodel after installing the pinned package. This local inspection needs no SDK key. The output identifies the actual model and its native geometry.
inspect-model.cjs
Node.js API index · Errors and recovery · Stream lifecycle.