| Enumeration Member | Value |
|---|---|
CPU |
"CPU" |
GPU |
"GPU" |
Invalid |
"Invalid" |
NPU |
"NPU" |
- AudioClient
- AudioClientSettings
- Catalog
- ChatClient
- ChatClientSettings
- EmbeddingClient
- FoundryLocalManager
- Model
- ModelLoadManager
- ResponsesClient
- ResponsesClientSettings
end_index: number;start_index: number;type: string;content_index: number;item_id: string;part: ContentPart;sequence_number: number;type: "response.content_part.added";content_index: number;item_id: string;part: ContentPart;sequence_number: number;type: "response.content_part.done";deleted: boolean;id: string;object: string;Result of an explicit EP download and registration operation.
failedEps: string[];Names of EPs that failed to register.
registeredEps: string[];Names of EPs that were successfully registered.
status: string;Human-readable status message.
success: boolean;True if all requested EPs were successfully downloaded and registered.
Describes a discoverable execution provider bootstrapper.
isRegistered: boolean;True if this EP has already been successfully downloaded and registered.
name: string;The identifier of the bootstrapper/execution provider (e.g. "CUDAExecutionProvider").
Configuration options for the Foundry Local SDK. Use a plain object with these properties to configure the SDK.
optional additionalSettings?: {
[key: string]: string;
};Additional settings to pass to the core. Optional. Internal use only.
[key: string]: stringoptional appDataDir?: string;The directory where application data should be stored.
Optional. Defaults to {user_home}/.{appName}.
appName: string;REQUIRED The name of the application using the SDK. Used for identifying the application in logs and telemetry.
optional libraryPath?: string;The path to the directory containing the native Foundry Local Core libraries.
Optional. This directory must contain Microsoft.AI.Foundry.Local.Core, onnxruntime, and onnxruntime-genai binaries.
If not provided, the SDK attempts to discover them in standard locations.
optional logLevel?: "trace" | "debug" | "info" | "warn" | "error" | "fatal";The logging level for the SDK. Optional. Valid values: 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. Defaults to 'warn'.
optional logsDir?: string;The directory where log files are written.
Optional. Defaults to {appDataDir}/logs.
optional modelCacheDir?: string;The directory where models are downloaded and cached.
Optional. Defaults to {appDataDir}/cache/models.
optional serviceEndpoint?: string;The external URL if the web service is running in a separate process. Optional. This is used to connect to an existing service instance.
optional webServiceUrls?: string;The URL(s) for the local web service to bind to. Optional. Multiple URLs can be separated by semicolons. Example: "http://127.0.0.1:8080"
delta: string;item_id: string;output_index: number;sequence_number: number;type: "response.function_call_arguments.delta";arguments: string;item_id: string;name: string;output_index: number;sequence_number: number;type: "response.function_call_arguments.done";arguments: string;call_id: string;optional id?: string;name: string;optional status?: ResponseItemStatus;type: "function_call";call_id: string;optional id?: string;output: string | ContentPart[];optional status?: ResponseItemStatus;type: "function_call_output";optional description?: string;name: string;optional parameters?: Record<string, unknown>;optional strict?: boolean;type: "function";get alias(): string;string
get capabilities(): string | null;string | null
get contextLength(): number | null;number | null
get id(): string;string
get info(): ModelInfo;get inputModalities(): string | null;string | null
get isCached(): boolean;boolean
get outputModalities(): string | null;string | null
get path(): string;string
get supportsToolCalling(): boolean | null;boolean | null
get variants(): IModel[];Variants of the model that are available. Variants of the model are optimized for different devices.
IModel[]
createAudioClient(): AudioClient;createChatClient(): ChatClient;createResponsesClient(baseUrl): ResponsesClient;Creates a ResponsesClient for interacting with the model via the Responses API. Unlike createChatClient/createAudioClient (which use FFI), the Responses API is HTTP-based, so the web service base URL must be provided.
| Parameter | Type | Description |
|---|---|---|
baseUrl |
string |
The base URL of the Foundry Local web service. |
download(progressCallback?): Promise<void>;| Parameter | Type |
|---|---|
progressCallback? |
(progress) => void |
Promise<void>
isLoaded(): Promise<boolean>;Promise<boolean>
load(): Promise<void>;Promise<void>
removeFromCache(): void;void
selectVariant(variant): void;Select a model variant from variants to use for IModel operations.
An IModel from variants can also be used directly.
| Parameter | Type | Description |
|---|---|---|
variant |
IModel |
Model variant to select. Must be one of the variants in variants. |
void
Error if variant is not valid for this model.
unload(): Promise<void>;Promise<void>
reason: string;data: ResponseInputItem[];object: "list";text: string;type: "input_text";id: string;type: "item_reference";optional bytes?: number[];logprob: number;token: string;content: string | ContentPart[];optional id?: string;role: MessageRole;optional status?: ResponseItemStatus;type: "message";alias: string;cached: boolean;optional capabilities?: string | null;optional contextLength?: number | null;createdAtUnix: number;optional displayName?: string | null;optional fileSizeMb?: number | null;id: string;optional inputModalities?: string | null;optional license?: string | null;optional licenseDescription?: string | null;optional maxOutputTokens?: number | null;optional minFLVersion?: string | null;optional modelSettings?: ModelSettings | null;modelType: string;name: string;optional outputModalities?: string | null;optional promptTemplate?: PromptTemplate | null;providerType: string;optional publisher?: string | null;optional runtime?: Runtime | null;optional supportsToolCalling?: boolean | null;optional task?: string | null;uri: string;version: number;optional parameters?: Parameter[] | null;item: ResponseOutputItem;item_id: string;output_index: number;sequence_number: number;type: "response.output_item.added";item: ResponseOutputItem;item_id: string;output_index: number;sequence_number: number;type: "response.output_item.done";optional annotations?: Annotation[];optional logprobs?: LogProb[];text: string;type: "output_text";content_index: number;delta: string;item_id: string;output_index: number;sequence_number: number;type: "response.output_text.delta";content_index: number;item_id: string;output_index: number;sequence_number: number;text: string;type: "response.output_text.done";name: string;optional value?: string | null;assistant: string;prompt: string;optional system?: string | null;optional user?: string | null;optional effort?: string;optional summary?: string;optional content?: ContentPart[];optional encrypted_content?: string;optional id?: string;optional status?: ResponseItemStatus;optional summary?: string;type: "reasoning";refusal: string;type: "refusal";content_index: number;delta: string;item_id: string;sequence_number: number;type: "response.refusal.delta";content_index: number;item_id: string;refusal: string;sequence_number: number;type: "response.refusal.done";optional frequency_penalty?: number;optional input?: string | ResponseInputItem[];optional instructions?: string;optional max_output_tokens?: number;optional metadata?: Record<string, string>;optional model?: string;optional parallel_tool_calls?: boolean;optional presence_penalty?: number;optional previous_response_id?: string;optional reasoning?: ReasoningConfig;optional seed?: number;optional store?: boolean;optional stream?: boolean;optional temperature?: number;optional text?: TextConfig;optional tool_choice?: ResponseToolChoice;optional tools?: FunctionToolDefinition[];optional top_p?: number;optional truncation?: TruncationStrategy;optional user?: string;code: string;message: string;optional jsonSchema?: string;optional larkGrammar?: string;type: string;response: ResponseObject;sequence_number: number;type:
| "response.created"
| "response.queued"
| "response.in_progress"
| "response.completed"
| "response.failed"
| "response.incomplete";optional cancelled_at?: number | null;optional completed_at?: number | null;created_at: number;optional error?: ResponseError | null;optional failed_at?: number | null;frequency_penalty: number;id: string;optional incomplete_details?: IncompleteDetails | null;optional instructions?: string | null;optional max_output_tokens?: number | null;optional metadata?: Record<string, string> | null;model: string;object: "response";output: ResponseOutputItem[];parallel_tool_calls: boolean;presence_penalty: number;optional previous_response_id?: string | null;optional reasoning?: ReasoningConfig | null;status: ResponseStatus;store: boolean;temperature: number;text: TextConfig;tool_choice: ResponseToolChoice;tools: FunctionToolDefinition[];top_p: number;truncation: TruncationStrategy;optional usage?: ResponseUsage | null;optional user?: string | null;name: string;type: "function";input_tokens: number;optional input_tokens_details?: {
cached_tokens: number;
};cached_tokens: number;output_tokens: number;optional output_tokens_details?: {
reasoning_tokens: number;
};reasoning_tokens: number;total_tokens: number;deviceType: DeviceType;executionProvider: string;optional code?: string;optional message?: string;optional param?: string;sequence_number: number;type: "error";optional format?: TextFormat;optional verbosity?: string;optional description?: string;optional name?: string;optional schema?: unknown;optional strict?: boolean;type: string;optional name?: string;type: string;end_index: number;start_index: number;title: string;type: "url_citation";url: string;type ContentPart =
| InputTextContent
| OutputTextContent
| RefusalContent;type MessageRole = "system" | "user" | "assistant" | "developer";Role of a message in the Responses API.
type ResponseInputItem =
| MessageItem
| FunctionCallItem
| FunctionCallOutputItem
| ItemReference
| ReasoningItem;type ResponseItemStatus = "in_progress" | "completed" | "incomplete";Status of an individual response item.
type ResponseOutputItem =
| MessageItem
| FunctionCallItem
| ReasoningItem;type ResponseStatus =
| "queued"
| "in_progress"
| "completed"
| "failed"
| "incomplete"
| "cancelled";Status of a Response object.
type ResponseToolChoice =
| "none"
| "auto"
| "required"
| ResponseToolChoiceFunction;Controls which tool the model should use.
type ServiceTier = "default" | "auto" | "flex" | "priority";Service tier.
type StreamingEvent =
| ResponseLifecycleEvent
| OutputItemAddedEvent
| OutputItemDoneEvent
| ContentPartAddedEvent
| ContentPartDoneEvent
| OutputTextDeltaEvent
| OutputTextDoneEvent
| RefusalDeltaEvent
| RefusalDoneEvent
| FunctionCallArgsDeltaEvent
| FunctionCallArgsDoneEvent
| StreamingErrorEvent;type TruncationStrategy = "auto" | "disabled";Truncation strategy.
function getOutputText(response): string;Extracts the text content from an assistant message in a Response.
Equivalent to OpenAI Python SDK's response.output_text.
| Parameter | Type | Description |
|---|---|---|
response |
ResponseObject |
The Response object. |
string
The concatenated text from the first assistant message, or an empty string.