This gist shows a working local Pi provider setup for Apple's fm serve
Chat Completions endpoint.
It supports both Apple Foundation Models exposed by the fm CLI:
fm/system: on-device Apple Foundation Model, configured as 4K contextfm/pcc: Private Cloud Compute model, configured as 32K context