Class: FoundryLocalManager

April 1, 2026 ยท View on GitHub

foundry-local-sdk / FoundryLocalManager

Class: FoundryLocalManager

The main entry point for the Foundry Local SDK. Manages the initialization of the core system and provides access to the Catalog and ModelLoadManager.

Accessors

catalog

Get Signature

get catalog(): Catalog;

Gets the Catalog instance for discovering and managing models.

Returns

Catalog

The Catalog instance.


isWebServiceRunning

Get Signature

get isWebServiceRunning(): boolean;

Whether the web service is currently running.

Returns

boolean


urls

Get Signature

get urls(): string[];

Gets the URLs where the web service is listening. Returns an empty array if the web service is not running.

Returns

string[]

An array of URLs.

Methods

createResponsesClient()

createResponsesClient(modelId?): ResponsesClient;

Creates a ResponsesClient for interacting with the Responses API. The web service must be started first via startWebService().

Parameters

ParameterTypeDescription
modelId?stringOptional default model ID for requests.

Returns

ResponsesClient

A ResponsesClient instance.

Throws

Error - If the web service is not running.


discoverEps()

discoverEps(): EpInfo[];

Discovers available execution providers (EPs) and their registration status.

Returns

EpInfo[]

An array of EpInfo describing each available EP.


downloadAndRegisterEps()

Call Signature

downloadAndRegisterEps(): Promise<EpDownloadResult>;

Downloads and registers execution providers.

Returns

Promise<EpDownloadResult>

A promise that resolves with an EpDownloadResult describing the outcome.

Call Signature

downloadAndRegisterEps(names): Promise<EpDownloadResult>;

Downloads and registers execution providers.

Parameters
ParameterTypeDescription
namesstring[]Array of EP names to download.
Returns

Promise<EpDownloadResult>

A promise that resolves with an EpDownloadResult describing the outcome.

Call Signature

downloadAndRegisterEps(progressCallback): Promise<EpDownloadResult>;

Downloads and registers execution providers, reporting progress.

Parameters
ParameterTypeDescription
progressCallback(epName, percent) => voidCallback invoked with (epName, percent) as each EP downloads. Percent is 0-100.
Returns

Promise<EpDownloadResult>

A promise that resolves with an EpDownloadResult describing the outcome.

Call Signature

downloadAndRegisterEps(names, progressCallback): Promise<EpDownloadResult>;

Downloads and registers execution providers, reporting progress.

Parameters
ParameterTypeDescription
namesstring[]Array of EP names to download.
progressCallback(epName, percent) => voidCallback invoked with (epName, percent) as each EP downloads. Percent is 0-100.
Returns

Promise<EpDownloadResult>

A promise that resolves with an EpDownloadResult describing the outcome.


startWebService()

startWebService(): void;

Starts the local web service. Use the urls property to retrieve the bound addresses after the service has started. If no listener address is configured, the service defaults to 127.0.0.1:0 (binding to a random ephemeral port).

Returns

void

Throws

Error - If starting the service fails.


stopWebService()

stopWebService(): void;

Stops the local web service.

Returns

void

Throws

Error - If stopping the service fails.


create()

static create(config): FoundryLocalManager;

Creates the FoundryLocalManager singleton with the provided configuration.

Parameters

ParameterTypeDescription
configFoundryLocalConfigThe configuration settings for the SDK (plain object).

Returns

FoundryLocalManager

The initialized FoundryLocalManager instance.

Example

const manager = FoundryLocalManager.create({
  appName: 'MyApp',
  logLevel: 'info'
});