Class: Model
April 2, 2026 ยท View on GitHub
foundry-local-sdk / Model
Class: Model
Represents a high-level AI model that may have multiple variants (e.g., quantized versions, different formats). Manages the selection and interaction with a specific model variant.
Implements
Constructors
Constructor
new Model(variant): Model;
Parameters
| Parameter | Type |
|---|---|
variant | ModelVariant |
Returns
Model
Accessors
alias
Get Signature
get alias(): string;
Gets the alias of the model.
Returns
string
The model alias.
Implementation of
capabilities
Get Signature
get capabilities(): string | null;
Returns
string | null
Implementation of
contextLength
Get Signature
get contextLength(): number | null;
Returns
number | null
Implementation of
id
Get Signature
get id(): string;
Gets the ID of the currently selected variant.
Returns
string
The ID of the selected variant.
Implementation of
info
Get Signature
get info(): ModelInfo;
Gets the ModelInfo of the currently selected variant.
Returns
The ModelInfo object.
Implementation of
inputModalities
Get Signature
get inputModalities(): string | null;
Returns
string | null
Implementation of
isCached
Get Signature
get isCached(): boolean;
Checks if the currently selected variant is cached locally.
Returns
boolean
True if cached, false otherwise.
Implementation of
outputModalities
Get Signature
get outputModalities(): string | null;
Returns
string | null
Implementation of
path
Get Signature
get path(): string;
Gets the local file path of the currently selected variant.
Returns
string
The local file path.
Implementation of
supportsToolCalling
Get Signature
get supportsToolCalling(): boolean | null;
Returns
boolean | null
Implementation of
variants
Get Signature
get variants(): IModel[];
Gets all available variants for this model.
Returns
IModel[]
An array of IModel objects.
Implementation of
Methods
createAudioClient()
createAudioClient(): AudioClient;
Creates an AudioClient for interacting with the model via audio operations.
Returns
An AudioClient instance.
Implementation of
createChatClient()
createChatClient(): ChatClient;
Creates a ChatClient for interacting with the model via chat completions.
Returns
A ChatClient instance.
Implementation of
createResponsesClient()
createResponsesClient(baseUrl): ResponsesClient;
Creates a ResponsesClient for interacting with the model via the Responses API.
Parameters
| Parameter | Type | Description |
|---|---|---|
baseUrl | string | The base URL of the Foundry Local web service. |
Returns
A ResponsesClient instance.
Implementation of
download()
download(progressCallback?): Promise<void>;
Downloads the currently selected variant.
Parameters
| Parameter | Type | Description |
|---|---|---|
progressCallback? | (progress) => void | Optional callback to report download progress. |
Returns
Promise<void>
Implementation of
isLoaded()
isLoaded(): Promise<boolean>;
Checks if the currently selected variant is loaded in memory.
Returns
Promise<boolean>
True if loaded, false otherwise.
Implementation of
load()
load(): Promise<void>;
Loads the currently selected variant into memory.
Returns
Promise<void>
A promise that resolves when the model is loaded.
Implementation of
removeFromCache()
removeFromCache(): void;
Removes the currently selected variant from the local cache.
Returns
void
Implementation of
selectVariant()
selectVariant(variant): void;
Selects a specific variant.
Parameters
| Parameter | Type | Description |
|---|---|---|
variant | IModel | The model variant to select. Must be one of the variants in variants. |
Returns
void
Throws
Error - If the variant does not belong to this model.
Implementation of
unload()
unload(): Promise<void>;
Unloads the currently selected variant from memory.
Returns
Promise<void>
A promise that resolves when the model is unloaded.