Grammar and spelling-fixing tool using Apple's Foundation Model, run locally on any Apple Silicon Macs.
Build the binary with:
$ make
You will need to have Xcode installed to compile the Swift LLM bridge. The output of the build process is a grammar-fix
binary that you can run.
Run the command and pass the input string:
$ /grammar-fix "he eat two apple"
For a while now, Apple devices shipped with an on-device language model. The model can be used for some writing tasks, but it's only accessible for Swift via the Foundation Models framework.
This project bridged the API and expose it as a C function, so we can use it for simple tasks like fixing grammar.