Swift package

Use AFM in process without importing the whole server.

The repository publishes modular Swift Package Manager products. New libraries should depend on the narrowest product that owns the capability they use.

Add the package

dependencies: [
    .package(
        url: "https://github.com/scouzi1966/maclocal-api.git",
        branch: "main"
    )
]

Products

ProductResponsibility
AFMKitCoreProvider contracts and portable core types
AFMOpenAICompatOpenAI-compatible request and response types
AFMKitMLXMLX model loading and inference
AFMKitFoundationModelsApple Foundation Models backend
AFMKitFoundationModels27Newer OS-specific Foundation Models surface
AFMKitDwarfStarDwarfStar runtime integration
AFMKitServicesVision, Speech, and embedding services
AFMKitHigh-level headless inference facade
AFMServerVapor HTTP layer

Provider boundary

AFMKit separates portable request/session contracts from the runtime provider. That lets a consumer choose MLX or Foundation Models without importing the Vapor server. Runtime-specific capabilities remain visible instead of being flattened into false parity.

Availability

Apple framework products preserve OS availability boundaries. Keep newer Foundation Models APIs behind their documented availability checks and use the dedicated product where required. Headless products do not require the WebUI.

Examples and source contracts

The repository's AFMKit public API guide is the compatibility baseline. Runnable consumer examples live in the Examples directory.