Skip to content

AppleBackend

Defined in: index.ts:121

Backend adapter for Apple MLX Framework.

new AppleBackend(config): AppleBackend

Defined in: index.ts:126

AppleConfig = {}

AppleBackend

readonly metadata: AdapterMetadata

Defined in: index.ts:122

Adapter metadata for identification and capabilities.

BackendAdapter.metadata

execute(request, _signal?): Promise<IRChatResponse>

Defined in: index.ts:181

Execute non-streaming chat completion request.

IRChatRequest

AbortSignal

Promise<IRChatResponse>

BackendAdapter.execute


executeStream(request, _signal?): IRChatStream

Defined in: index.ts:286

Execute streaming chat completion request using Apple Foundation Models streaming.

IRChatRequest

AbortSignal

IRChatStream

BackendAdapter.executeStream


fromIR(request): object

Defined in: index.ts:419

Convert IR request to Apple Foundation Models format.

IRChatRequest

object

optional instructions: string

options: object

optional maximumResponseTokens: number

optional sampling: "random" | "default"

optional temperature: number

prompt: string

BackendAdapter.fromIR


healthCheck(): Promise<boolean>

Defined in: index.ts:491

Health check.

Promise<boolean>

BackendAdapter.healthCheck


initialize(): Promise<void>

Defined in: index.ts:156

Initialize the Apple Foundation Models. Must be called before execute().

Promise<void>


toIR(response, originalRequest): IRChatResponse

Defined in: index.ts:470

Convert Apple Foundation Models response to IR format.

string

IRChatRequest

IRChatResponse

BackendAdapter.toIR