LanguageTool is an open source alternative to Grammarly, can be self-hosted, and supports LibreOffice
LanguageTool is a free grammar checker and paraphraser for English, Spanish, and 30 other languages. Instantly check your text for grammar and style mistakes.
The extension is not libre, though.