✨ AI Assistant for Writer
Add AI-powered correction, rewriting and summarization commands to LibreOffice Writer.
Latest available package:
AI-Assistant-for-Writer-0.2.0.oxt
Downloads of this version:
14
Total extension downloads:
14
File size: 46.9 KB
Download the LibreOffice extensionHow to Install AI Assistant for Writer
Download the OXT extension file, open LibreOffice, choose Tools, Extensions, click Add, and select the downloaded file. Install the extension for the current user and restart LibreOffice.
Open a Writer document, select some text, right-click the selection, and open the AI Assistant submenu. You can correct, rewrite or summarize the selected text.
Why Use AI Assistant for Writer
- Correct spelling, grammar, punctuation and syntax
- Rewrite selected text while preserving its meaning
- Summarize long paragraphs directly in Writer
- Review the generated result before replacing the original text
- Use local AI models through Ollama
- Use OpenAI models through the OpenAI API
- Configure the provider without storing API keys in documents
- Works directly inside LibreOffice Writer
- Available for Windows, macOS and Linux
- Free extension with support for local AI processing
Requirements and Limitations
The extension requires LibreOffice 24.2 or newer and the LibreOffice Python scripting component. An AI provider must be configured before using the commands. Ollama must be installed, running and have the selected model available. OpenAI requires a valid API key and an account with API access. OpenAI API usage may generate charges.
Privacy and Data Processing
With a local Ollama model, selected text is sent to the Ollama service running on your computer. With OpenAI, selected text is transmitted to the OpenAI API for processing. Do not send confidential information to an external provider unless its data handling policy is suitable for your use case.
Available AI Commands
- Correct a selected paragraph
- Improve spelling and grammar
- Rewrite text in a clearer style
- Rephrase text while preserving its meaning
- Summarize a long passage
- Prepare concise notes from selected content
- Improve drafts without leaving LibreOffice Writer
Configure the Extension With Ollama
Ollama is the default provider. Install Ollama, start its local service, download a model, and configure the extension to use the same model name. The default Ollama server address is http://localhost:11434.
- Install Ollama from https://ollama.com/download
- Download a model with: ollama pull gemma4:e2b
- Set LIBREOFFICE_AI_PROVIDER to ollama
- Set LIBREOFFICE_AI_OLLAMA_MODEL to gemma4:e2b
- Optional: set LIBREOFFICE_AI_OLLAMA_BASE_URL to http://localhost:11434
- Completely close and restart LibreOffice after changing environment variables
Ollama Configuration on Windows
Run the following commands in PowerShell. These commands save the settings for the current Windows user.
- [Environment]::SetEnvironmentVariable("LIBREOFFICE_AI_PROVIDER", "ollama", "User")
- [Environment]::SetEnvironmentVariable("LIBREOFFICE_AI_OLLAMA_MODEL", "gemma4:e2b", "User")
- [Environment]::SetEnvironmentVariable("LIBREOFFICE_AI_OLLAMA_BASE_URL", "http://localhost:11434", "User")
- Close every LibreOffice window and restart LibreOffice
Ollama Configuration on Linux or macOS
Export the variables before starting LibreOffice from the same terminal. To keep the configuration after a restart, add the exports to the appropriate shell profile.
- export LIBREOFFICE_AI_PROVIDER="ollama"
- export LIBREOFFICE_AI_OLLAMA_MODEL="gemma4:e2b"
- export LIBREOFFICE_AI_OLLAMA_BASE_URL="http://localhost:11434"
- Start LibreOffice from the same terminal session
Configure the Extension With OpenAI
Create an OpenAI API key and store it in the OPENAI_API_KEY environment variable. The extension uses the OpenAI Responses API. Its default OpenAI model is gpt-5-mini and its default API address is https://api.openai.com/v1.
- Create an API key at https://platform.openai.com/api-keys
- Set LIBREOFFICE_AI_PROVIDER to openai
- Set OPENAI_API_KEY to your private API key
- Optional: set LIBREOFFICE_AI_OPENAI_MODEL to gpt-5-mini
- Optional: set LIBREOFFICE_AI_OPENAI_BASE_URL to https://api.openai.com/v1
- Never publish or share your OpenAI API key
- Completely close and restart LibreOffice after changing environment variables
OpenAI Configuration on Windows
Run these commands in PowerShell and replace your-api-key with your own OpenAI API key.
- [Environment]::SetEnvironmentVariable("LIBREOFFICE_AI_PROVIDER", "openai", "User")
- [Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "your-api-key", "User")
- [Environment]::SetEnvironmentVariable("LIBREOFFICE_AI_OPENAI_MODEL", "gpt-5-mini", "User")
- Close every LibreOffice window and restart LibreOffice
OpenAI Configuration on Linux or macOS
Export the variables before starting LibreOffice. Replace your-api-key with your own OpenAI API key.
- export LIBREOFFICE_AI_PROVIDER="openai"
- export OPENAI_API_KEY="your-api-key"
- export LIBREOFFICE_AI_OPENAI_MODEL="gpt-5-mini"
- Start LibreOffice from the same terminal session
Optional Connection Settings
The request timeout is 120 seconds by default. It can be changed with LIBREOFFICE_AI_TIMEOUT. Custom Ollama or OpenAI-compatible server addresses can be configured with the corresponding base URL variables.
- LIBREOFFICE_AI_TIMEOUT controls the timeout in seconds
- LIBREOFFICE_AI_OLLAMA_BASE_URL controls the Ollama server address
- LIBREOFFICE_AI_OPENAI_BASE_URL controls the OpenAI API base address
- Base addresses must begin with http:// or https://
- Restart LibreOffice after changing any setting
How to Use the Extension
After installation and configuration, open a Writer document and select the text you want to process. Right-click the selection, choose AI Assistant, and select Correct, Rewrite or Summarize. The extension displays the generated result for confirmation before replacing the selected text.
- Open a LibreOffice Writer document
- Select a non-empty section of text
- Right-click the selected text
- Open the AI Assistant submenu
- Choose Correct, Rewrite or Summarize
- Review the generated result
- Confirm the replacement or cancel it
Supported Features
| Feature | Supported |
|---|---|
| Correct selected text | Yes |
| Rewrite selected text | Yes |
| Summarize selected text | Yes |
| OpenAI and Ollama support | Yes |
| Windows, macOS and Linux | Yes |
AI Assistant for Writer – Frequently Asked Questions
Which LibreOffice version is required?
AI Assistant for Writer requires LibreOffice 24.2 or newer and the LibreOffice Python scripting component.
How do I install the extension?
Download the OXT file, open LibreOffice, choose Tools and Extensions, click Add, select the downloaded file, install it for the current user, and restart LibreOffice.
How do I use AI Assistant in Writer?
Select text in a Writer document, right-click the selection, open the AI Assistant submenu, and choose Correct, Rewrite or Summarize.
Can I use the extension without OpenAI?
Yes. Ollama is the default provider and can run compatible AI models locally on your computer without an OpenAI API key.
How do I select Ollama as the provider?
Set LIBREOFFICE_AI_PROVIDER to ollama, set LIBREOFFICE_AI_OLLAMA_MODEL to the name of an installed model, and restart LibreOffice.
Which Ollama model should I use?
You can use a text-generation model supported by your computer. For example, download gemma4:e2b with the command ollama pull gemma4:e2b and set LIBREOFFICE_AI_OLLAMA_MODEL to gemma4:e2b.
Why does the extension say that the Ollama model cannot be found?
The model name configured in LIBREOFFICE_AI_OLLAMA_MODEL must exactly match an installed Ollama model. Run ollama ls to see installed models and ollama pull followed by the model name to download one.
Why can the extension not connect to Ollama?
Make sure Ollama is installed and running, and verify that LIBREOFFICE_AI_OLLAMA_BASE_URL points to the correct server. The default address is http://localhost:11434.
How do I use OpenAI?
Set LIBREOFFICE_AI_PROVIDER to openai, store your API key in OPENAI_API_KEY, optionally choose a model with LIBREOFFICE_AI_OPENAI_MODEL, and restart LibreOffice.
Is a ChatGPT subscription sufficient?
The extension uses the OpenAI API and requires an OpenAI API key with API access. ChatGPT subscriptions and OpenAI API billing are managed separately.
Where is the OpenAI API key stored?
The extension reads the OPENAI_API_KEY environment variable. The key is not stored inside the Writer document or directly in the extension source files.
Does the extension send my text over the Internet?
With OpenAI, the selected text is sent to the OpenAI API. With a local Ollama model, the selected text is processed through the Ollama service running on your computer.
Why are new environment variables not detected?
LibreOffice reads the environment available when it starts. Completely close LibreOffice, including any background process or Quickstarter, and then launch it again.
Can I use a remote Ollama server?
Yes. Set LIBREOFFICE_AI_OLLAMA_BASE_URL to the HTTP or HTTPS address of the remote Ollama server. Ensure that the server is secured and accessible from the computer running LibreOffice.
Can I change the request timeout?
Yes. Set LIBREOFFICE_AI_TIMEOUT to a positive number of seconds and restart LibreOffice. The default timeout is 120 seconds.
Is the extension free?
The extension itself is free. Local Ollama usage does not require an OpenAI API key, but hardware and electricity are required. OpenAI API requests may generate usage charges.
