Grammar and spelling-fixing tool using Apple's Foundation Model, run locally on any Apple Silicon Macs.
How to compile
Build the binary with:
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.
How to use
Run the command and pass the input string:
$ /grammar-fix "he eat two apple"
# output: He ate two apples.
What is this and how does it work?
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.