Skip to main content

LocalModels API

Local Models API

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

Quick Reference

MethodDescription
deleteDeletes a downloaded model from local storage.
downloadInitiates the download of a model for local execution.
getRetrieves detailed information about a specific local model.
getAvailableRetrieves the catalog of models available for local download and execution.
listLists all models that have been downloaded to the local machine.
loadLoads a downloaded model into system memory for inference.
unloadUnloads a model from system memory.

Methods


delete

client.localModels.delete(modelId: string): Promise<unknown>

Deletes a downloaded model from local storage.

Permanently removes the model files from disk, freeing storage space. The model must be unloaded from memory before deletion. It can be re-downloaded later if needed.

ParameterTypeRequiredDescription
modelIdstringYesThe unique identifier of the model to delete

Returns: Promise<unknown> — A promise that resolves when the model has been removed from disk

Full reference →


download

client.localModels.download(data: DownloadLocalModelRequest): Promise<unknown>

Initiates the download of a model for local execution.

Starts an asynchronous download of the specified model. Large models may take significant time and disk space. Monitor download progress through status endpoints.

ParameterTypeRequiredDescription
dataDownloadLocalModelRequestYesThe download request configuration

Returns: Promise<unknown> — A promise that resolves when the download has been initiated

Full reference →


get

client.localModels.get(modelId: string): Promise<LocalModel>

Retrieves detailed information about a specific local model.

Returns comprehensive metadata for a model including its size, quantization level, architecture, and current status (downloaded, loaded, etc.).

ParameterTypeRequiredDescription
modelIdstringYesThe unique identifier of the model to retrieve

Returns: Promise<LocalModel> — A promise that resolves to the model's detailed information

Full reference →


getAvailable

client.localModels.getAvailable(): Promise<LocalModel[]>

Retrieves the catalog of models available for local download and execution.

Returns all models that can be downloaded from supported registries (e.g., Ollama, GGUF) for local inference. Use this to browse what models are available before downloading.

No parameters.

Returns: Promise<LocalModel[]> — A promise that resolves to an array of available local models

Full reference →


list

client.localModels.list(): Promise<LocalModel[]>

Lists all models that have been downloaded to the local machine.

Returns metadata for models currently stored on disk, regardless of whether they are currently loaded into memory for inference.

No parameters.

Returns: Promise<LocalModel[]> — A promise that resolves to an array of downloaded local models

Full reference →


load

client.localModels.load(data: LoadLocalModelRequest): Promise<unknown>

Loads a downloaded model into system memory for inference.

Prepares a local model for use by loading its weights into RAM or VRAM. The model must be downloaded first. Once loaded, it can serve inference requests without additional startup latency.

ParameterTypeRequiredDescription
dataLoadLocalModelRequestYesThe load request configuration

Returns: Promise<unknown> — A promise that resolves when the model has been loaded into memory

Full reference →


unload

client.localModels.unload(data: UnloadLocalModelRequest): Promise<unknown>

Unloads a model from system memory.

Releases the memory (RAM/VRAM) occupied by a loaded model. The model remains on disk and can be loaded again later. Use this to free resources when a model is no longer needed.

ParameterTypeRequiredDescription
dataUnloadLocalModelRequestYesThe unload request configuration

Returns: Promise<unknown> — A promise that resolves when the model has been unloaded from memory

Full reference →