Ask Grok - A calibre Plugin to Ask Questions About Books
A versatile plugin that lets you ask questions about books directly in calibre using various AI models, including Grok, Google Gemini, Ollama (Local AI), and DeepSeek.
Why Use This Plugin?
With a multitude of AI tools available, you might want to leverage AI to ask questions about a book directly within calibre. However, doing this manually means you’d need to copy-paste the book’s information—like its title, author, or publisher—into an AI tool. This plugin eliminates that hassle by letting you call the capabilities of **Grok, Google Gemini, Ollama Local AI, or DeepSeek** directly in calibre, with no copy-pasting required! Just select a book, choose your preferred AI, ask your question, and get answers seamlessly.
----
Features- Ask questions about books with AI directly in calibre
- Configurable API key for various AI models: Grok, Google Gemini, and DeepSeek
- Support for Ollama (Local AI) for private and local AI interactions
- Automatically includes the current book's metadata (title, author, publisher) - no copy-paste needed
- Simple single input-output dialog interface
- Customizable prompt template
- Preview-able interface shortcuts
- Check plugin version info in the interface
- New! Edit Random Question Prompts: Customize the AI-generated question ideas.
- New! Enable Streaming Config for every AI: Choose whether to receive AI responses as they are generated for a more interactive experience.
- Enhanced Internationalization: Extensive interface text has been added for a more globally friendly experience.
---
Installation
Method 1: Install via GitHub Zip File
- Download the plugin zip file (attached below as Ask_Grok.zip)
- In calibre, go to Preferences -> Plugins -> Load plugin from file
- Select the downloaded Ask_Grok.zip file to install
- Restart calibre after installation
Method 2: Install via calibre Official Plugin Market
- Open calibre’s Preferences
- Go to Plugins
- Click Get new plugins
- Search for Ask Grok in the Filter by name field
- Select the plugin and install
- Restart calibre
---
How to Get Your API Key(s)- For Grok: Go to https://console.x.ai/, create a team if needed, navigate to API Keys, click Create API Keys, name it (e.g., calibre_Ask_Grok), save, and copy the generated Key value (e.g., Bearer x-ai ***** or x-ai *****).
- For Google Gemini: Visit the Google AI Studio or Google Cloud Console to generate your API key.
- For DeepSeek: Obtain your API key from the DeepSeek official website.
- For Ollama (Local AI): No API key is strictly needed, as it runs locally. Ensure Ollama is installed and a model is running on your system.
---
Configure API Keys and AI Models in calibre- In calibre, click the Ask Grok dropdown menu in the toolbar, then select Configure.
- Select your desired AI Model (e.g., Grok, Gemini, DeepSeek, Ollama).
- Paste your API Key (if applicable) into the relevant input box (e.g., X.AI Authorization Token for Grok).
- For Ollama, you might configure the local server endpoint.
- Click Save.
- You’ll see a Save successful message.
---
How to Use the Plugin- Select a book in your calibre library.
- Click the Ask Grok button in the toolbar.
- Select your preferred AI model from the dropdown.
- Enter your question in the popup dialog.
- Click Send to get the AI’s answer.
- Click Suggestion? to see AI-generated question ideas.
- Utilize the Edit Random Question Prompts option in configurations to customize these suggestions.
---
Shortcuts
---
Supported Languages[*]Danish (da), German (de), English (en), Spanish (es), Finnish (fi), French (fr), Japanese (ja), Dutch (nl), Norwegian (no), Portuguese (pt), Russian (ru), Swedish (sv), Simplified Chinese (zh), Traditional Chinese (zht), Cantonese (yue)[/list]
---
Requirements- calibre 7.25 or higher
- External Python modules: requests, bleach, markdown2
Note: The plugin uses built-in calibre modules like PyQt5 for the GUI and standard Python libraries (os, sys, json, etc.).
---
AI Model API Key Notes- API call limits and pricing depend on your selected AI model provider (Grok, Google Gemini, DeepSeek) and your account permissions.
- For Ollama, performance depends on your local hardware and the downloaded model.
----
Recent Updates (v1.2.0 & v1.2.1)- v1.2.0 New Features:
- AI: Google Gemini Supported
- AI: Ollama Local AI Supported
- AI: DeepSeek Supported
- v1.2.0 Enhancements:
- Edit Random Question Prompts: Customize suggestions for AI-generated questions.
- Enable Streaming Config in every AI: Get real-time AI responses.
- i18n Enhancement: Further improved internationalization.
- v1.2.1 Fixes:
- The Random Question button is now correctly triggered when the Grok model is selected.
- Results returned by Gemini and Grok models are no longer truncated.
- Extensive internationalization interface text has been added for better user experience.
- v1.2.2 Fixes:
- Fixed the Random Question button in DeepSeek's max tokens.
- v1.2.3 Fixes:
- Fixed the issue where the interface loading would freeze due to not filling in the API Key.
---
Privacy Handling- The plugin sends book metadata (title, author, publisher, publish time, language) to the selected AI model but excludes user-defined data like Tags or Comments.
- Your AI API Key (Grok, Gemini, DeepSeek) is stored locally in a JSON file and isn’t sent to any third-party server.
- Uses Python’s requests module for external API calls; no third-party servers are involved in data processing by the plugin itself beyond direct API calls to your chosen AI provider.
- The privacy policy of each AI model (Grok, Gemini, DeepSeek) regarding data usage for model training may vary. Please consult their respective official statements.
- You can set the Grok API Key via environment variable: XAI_AUTH_TOKEN.
- For other models, environment variable support may be added in future updates or is handled by their specific API client libraries.
Grok Official Statement: Private Chat is private and won’t be used for training, but may be retained for up to 30 days for safety purposes.
---
Feedback Welcome!
Let me know if you have any questions or suggestions for the plugin. I’ll update this thread with any new features or changes.
GitHub Repository
You can find the source code and contribute to the project on GitHub:
https://github.com/sheldonrrr/ask_grok