We're introducing new APIs in https://github.com/MarkEdit-app/MarkEdit-api for user scripts to access Foundation Models on macOS Tahoe.
Foundation Models | Apple Developer Documentation

Perform tasks with the on-device model that specializes in language understanding, structured output, and tool calling.

Apple Developer Documentation

Interfaces have been implemented: https://github.com/MarkEdit-app/MarkEdit-api/commit/fbfb08f1b34c53651a2566543f90e011a2d286d0

The recording is a demo extension (WIP).