Consider donating to support development: https://ko-fi.com/johnbalis
This is a LibreOffice Writer extension that enables inline generative editing with local inference. It's compatible with language models supported by text-generation-webui
and ollama
.
This extension provides two powerful commands for LibreOffice Writer:
Hotkey: CTRL + q
- This 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.
Hotkey: CTRL + e
- 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.
- Download the latest version of Localwriter via the releases page.
- Open LibreOffice.
- Navigate to
Tools > Extensions
. - Click
Add
and select the downloaded.oxt
file. - Follow the on-screen instructions to install the extension.
To use Localwriter, you need a backend model runner. Options include text-generation-webui
and Ollama
. Choose the backend that best suits your needs. Ollama is generally easier to set up. In either of these options, you will have to download and set a model.
After installation and model setup:
- Enable the local OpenAI API (this ensures the API responds in a format similar to OpenAI).
- Verify that the intended model is working (e.g., openchat3.5, suitable for 8GB VRAM setups).
- Set the endpoint in Localwriter to
localhost:5000
(or the configured port).
- Installation instructions are available here.
- Download and use a model (gemma3 isn't bad)
- Ensure the API is enabled.
- Set the endpoint in Localwriter to
localhost:11434
(or the configured port). - Manually set the model name. (This is required for Ollama to work)
In the settings, you can configure:
- Maximum number of additional tokens for "Extend Selection."
- Maximum number of additional tokens (above the number of letters in the original selection) for "Edit Selection."
- Custom "system prompts" for both "Extend Selection" and "Edit Selection." These prompts are prepended to the selection before sending it to the language model. For example, you can use a sample of your writing to guide the model's style.
(See License.txt
for the full license text)
Except where otherwise noted in source code, this software is provided with a MPL 2.0 license.
The code not released with an MPL2.0 license is released under the following terms. License: Creative Commons Attribution-ShareAlike 3.0 Unported License, License: The Document Foundation https://creativecommons.org/licenses/by-sa/3.0/
A large amount of code is derived from the following MPL2.0 licensed code from the Document Foundation https://gerrit.libreoffice.org/c/core/+/159938
MPL2.0
Copyright (c) 2024 John Balis