https://github.com/wagtail/wagtail-ai
Get help with your Wagtail content using AI superpowers.
https://github.com/wagtail/wagtail-ai
ai django wagtail
Last synced: 3 months ago
JSON representation
Get help with your Wagtail content using AI superpowers.
- Host: GitHub
- URL: https://github.com/wagtail/wagtail-ai
- Owner: wagtail
- License: mit
- Created: 2023-03-03T16:33:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-18T16:12:29.000Z (11 months ago)
- Last Synced: 2025-06-27T00:25:05.228Z (3 months ago)
- Topics: ai, django, wagtail
- Language: Python
- Homepage: https://wagtail-ai.readthedocs.io/latest
- Size: 382 KB
- Stars: 159
- Watchers: 12
- Forks: 23
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README

# Wagtail AI
Get help with your content using AI superpowers.
[](https://opensource.org/licenses/MIT)
[](https://badge.fury.io/py/wagtail-ai)
[](https://github.com/wagtail/wagtail-ai/actions/workflows/test.yml)Wagtail AI integrates Wagtail with AI's APIs (think ChatGPT) to help you write and correct your content.
Right now, it can:
* Finish what you've started - write some text and tell Wagtail AI to finish it off for you
* Correct your spelling/grammar
* Let you add your own custom prompts
* Automatically generate alt-tags for your uploaded images
* Work with multiple LLM providers including local models, OpenAI, Mistral, Claude and many others## Demos
### Rich-text integration
https://user-images.githubusercontent.com/27112/223072938-8cb5ccff-4835-489a-8be4-cca85001885e.mp4
### Alt-text generation
https://github.com/wagtail/wagtail-ai/assets/27617/5ffd5493-b39c-4d38-bed8-fdd243920eb5
## Requirements & Costs
Wagtail AI supports [many different LLMs](https://wagtail-ai.readthedocs.io/latest/ai-backends/), with OpenAI models
available by default. To use these, you'll need an OpenAI account and an API key. There'll also be some cost involved.For the OpenAI API used here (`gpt-3.5-turbo`), the [cost](https://openai.com/pricing) is
- $0.0005 per 1000 tokens for input tokens (prompt)
- $0.0015 per 1000 tokens for output tokens (answer)Here is an estimated cost breakdown for the `correction` prompt on a 1000-word paragraph.
### We assume that:
- Prompt is 30 words and the existing paragraph is 1000 words (Input)
- Each word is 1.3 tokens (Tokens multiplier)
- We get back 1000 words back (Output)### Then:
- **Input tokens :** (35 + 1000) x 1.3 = 1345.5 tokens.
- **Output tokens :** 1000 x 1.3 = 1300
- **Input tokens cost :** 1345.5 / 1000 * $0.0005 = $0.00067275
- **Output tokens cost :** 1300 / 1000 * $0.0015 = $0.00195
- **Total cost :** $0.00262275## Links
- [Documentation](https://wagtail-ai.readthedocs.io/)
- [Changelog](https://github.com/wagtail/wagtail-ai/blob/main/CHANGELOG.md)
- [Contributing](https://wagtail-ai.readthedocs.io/latest/contributing/)
- [Discussions](https://github.com/wagtail/wagtail-ai/discussions)
- [Security](https://github.com/wagtail/wagtail-ai/security)## Supported Versions
* Wagtail 5.2
* Django 4.2
* Python 3.11