QVAC Logo

unloadModel( )

Unloads a previously loaded model from the server.

function unloadModel(params): Promise<void>;

When the last model is unloaded and no providers are active, the RPC connection is automatically closed, allowing the process to exit naturally.

Parameters

NameTypeRequired?DefaultDescription
params.modelIdstringThe unique identifier of the model to unload
params.clearStoragebooleanfalseWhether to clear the storage for the model

Returns

Promise<void> — Resolves when the model is unloaded.

Throws

ErrorWhen
INVALID_RESPONSE_TYPEResponse type does not match expected "unloadModel"
MODEL_UNLOAD_FAILEDThe server reports unload failure

Example

await unloadModel({ modelId: "model-123" });

// Unload and clear cached files
await unloadModel({ modelId: "model-123", clearStorage: true });

On this page