localwriter: A LibreOffice Writer extension for local generative AI

LibreOffice is a privacy-oriented office suite that runs on your own computer and doesn’t include AI features out-of-the-box. But we know that many users are interested in combining AI tools with the suite, so we talked to John Balis who is working on a (fully optional!) LibreOffice extension called localwriter. Here’s what he had to say…

What does the extension do?

Localwriter is a libreoffice writer extension to allow for inline generative editing with local inference. It can be used with any language model supported by Ollama or text-generation-webui. This extension adds two powerful commands to LibreOffice Writer:

  • Extend Selection – Uses a language model to predict what comes after the selected text. There are a lot of ways to use this. Some example use cases for this include, writing a story or an email given a particular prompt, adding additional possible items to a grocery list, or summarizing the selected text.
  • Edit Selection – A dialog box appears to prompt the user for instructions about how to edit the selected text, then the selected text is replaced by the edited text. Some examples for use cases for this include changing the tone of an email, translating text to a different language, and semantically editing a scene in a story.

When did you start working on it?

I started working on localwriter in July 2024, because I wanted an AI tool to assist with my writing that would benefit from the intrinsic advantages in terms of availability (can’t lose access), confidentiality (doesn’t leak data), and integrity (no surprise model version changes) that come with using a fully open source local AI stack instead of a third-party API. I feel it is really important to embrace learning to benefit from artificial intelligence without sacrificing agency, and this software follows from that line of thinking.

What are the current limitations, and what’s coming next?

localwriter currently only supports LibreOffice Writer, although Calc support is in development and will be offered in the next release. Another limitation is that it does not support streaming, and does not offer a “Chat with document” feature.

How can others help to improve it?

There are a ton of open feature requests in the repository from several users, which should be really easy for an experienced LibreOffice extension developer to complete. I can easily set up anyone interested with a task to work on. Tests would be welcome, as currently it doesn’t have any tests. Also, donating to me helps me allocate my own time towards development.

Get the extension here

Leave a Reply