Skip to content

apple_fm_shim

apple_fm_shim

Apple Foundation Models shim.

Thin FastAPI server exposing Apple Intelligence's on-device foundation model as an OpenAI-compatible API, for pointing external OpenAI clients at AFM. Only runs on macOS 26+ with Apple Intelligence enabled. Wraps apple-fm-sdk's LanguageModelSession as /v1/chat/completions and /v1/models.

OpenJarvis's own preferred path is the in-process afm engine (openjarvis.engine.apple_fm), which avoids an HTTP hop and a second process whose CPU energy would otherwise land inside the same measurement window.

Usage: uvicorn openjarvis.engine.apple_fm_shim:app --host 127.0.0.1 --port 8079

Classes