A simple desktop AI assistant for drafting message replies using local LLMs via Ollama.
Project description
Draft Writer Bot
A simple, privacy-focused Windows desktop application that uses a locally running small language model (via Ollama) to help you quickly draft replies to messages, with streaming output.
Features
- Simple Interface: Easily paste the original message and your instruction.
- AI-Powered Drafts: Generates draft replies based on your intent using a local LLM.
- Streaming Output: See the AI response appear word-by-word for a responsive feel.
- Local & Private: Uses Ollama to run a language model directly on your machine. Your messages and instructions are never sent to any external cloud service, ensuring your privacy.
- Offline Capable: Works without an internet connection after the initial setup of Ollama and the model.
- Lightweight: Designed to work with very small LLMs (like the default
qwen2.5:0.5b) suitable for less powerful computers. - Copy to Clipboard: Easily copy the fully generated draft with a single click.
- Clear Inputs: Button to quickly clear all text fields and reset for a new task.
- Status Bar: Provides feedback on the current application state (Ready, Generating, Copied, Error).
- Dark Theme: Uses a modern dark theme provided by CustomTkinter.
Prerequisites
Before you install and run Draft Writer Bot, you must have the following installed and configured:
- Python: Version 3.9 or higher is recommended (the application was developed with 3.13). Ensure Python is added to your system's PATH during installation. You can download Python from python.org.
- Ollama: This application relies entirely on Ollama to run the language model locally.
- Download and install Ollama for Windows from the official website: ollama.com.
- Follow their installation instructions.
- Ollama Language Model: After installing Ollama, you need to download the specific language model the application will use. The default and recommended lightweight model is
qwen2.5:0.5b.- Open your Command Prompt or PowerShell.
- Run the command:
ollama pull qwen2.5:0.5b
- Wait for the download (approx. 400MB) to complete.
- (Important): Ensure the Ollama application/service is running in the background before you start Draft Writer Bot. You can usually check this from your system tray or by running
ollama listin the terminal.
Installation
You can install Draft Writer Bot using one of the following methods:
Option 1: From PyPI (Recommended Method - Once Published)
(Note: Replace draft-writer-bot with the actual package name on PyPI once published)
- Open Command Prompt or PowerShell.
- Run the following command:
pip install draft-writer-bot
- This will download and install the application and its dependencies (
customtkinter,httpx).
Option 2: From Source (Using Git)
This method is suitable if you want to run the latest development version or modify the code.
- Clone the Repository:
git clone [https://github.com/tousif47/Draft-Writer-Bot.git](https://github.com/tousif47/Draft-Writer-Bot.git) cd Draft-Writer-Bot
- Create Virtual Environment (Recommended): This keeps the dependencies isolated.
python -m venv venv
- Activate Virtual Environment:
- On Windows Command Prompt:
venv\Scripts\activate - On Windows PowerShell:
.\venv\Scripts\Activate.ps1(You might need to adjust execution policy:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process) - On Linux/macOS:
source venv/bin/activate
- On Windows Command Prompt:
- Install Dependencies: Install the required Python libraries listed in
requirements.txt.pip install -r requirements.txt
Running the App
- CRITICAL: Ensure the Ollama application/service is running in the background and has the
qwen2.5:0.5bmodel (or the model specified via environment variable) available. - If installed from PyPI:
- Open your terminal/Command Prompt.
- Run the application command:
(Note: Replace
draft-writer-botwith the actual command defined in your package setup)draft-writer-bot
- If running from source:
- Make sure your virtual environment is activated (you should see
(venv)at the start of your terminal prompt). - Navigate to the project's root directory (
Draft-Writer-Bot/) in your terminal. - Run the main script:
python src/main.py
- Make sure your virtual environment is activated (you should see
Usage Guide
- Launch the Draft Writer Bot application.
- Paste the message you received into the top text box ("1. Paste Original Message").
- Type your instruction on how you want to reply (e.g., "Agree and suggest 2 PM", "Politely refuse", "Ask for clarification on point 3") into the middle text box ("2. Your Instruction").
- Click the "Generate Draft" button.
- Observe the status bar at the bottom. It will indicate "Generating draft...".
- The AI's response will appear word-by-word (streaming) in the bottom text box ("3. Generated Draft").
- Wait for the generation to complete. The status bar will update to "Draft generated successfully" or show an error message.
- Review the generated draft. If you like it, click the "Copy Draft" button. The status bar will confirm "Draft copied to clipboard!".
- Paste the draft into your email, chat client, or other application.
- Click the "Clear All" button to reset the text fields and prepare for a new task.
Optional Configuration (Environment Variables)
The application uses default settings for connecting to Ollama. You typically do not need to change these unless you have a custom Ollama setup. If needed, you can override the defaults by setting environment variables before launching the application:
DWB_OLLAMA_URL: Sets the base URL for your Ollama instance.- Default:
http://localhost:11434
- Default:
DWB_MODEL: Sets the name of the Ollama model to use. Make sure you have pulled this model usingollama pull <model_name>.- Default:
qwen2.5:0.5b
- Default:
Example (Setting on Windows Command Prompt before running):
set DWB_MODEL=mistral
set DWB_OLLAMA_URL=[http://192.168.1.100:11434](http://192.168.1.100:11434)
python src/main.py
Example (Setting on Windows PowerShell before running):$env:DWB_MODEL="mistral"
$env:DWB_OLLAMA_URL="[http://192.168.1.100:11434](http://192.168.1.100:11434)"
python src/main.py
(Note: Environment variables set this way are usually only active for the current terminal session.)TroubleshootingError: "Connection Error: Could not connect...": Make sure the Ollama application/service is running on your computer before you start Draft Writer Bot. Check if the URL (http://localhost:11434 by default) is correct.Error: "HTTP Error: 404 Not Found..." (mentioning model name): Make sure you have downloaded the required model using ollama pull <model_name> (e.g., ollama pull qwen2.5:0.5b).Slow Generation: Performance depends heavily on your computer's CPU/RAM. The qwen2.5:0.5b model is designed to be lightweight, but generation still takes processing power. Ensure no other demanding applications are running.Weird/Incorrect Replies: The quality of the draft depends on the small LLM's capabilities and the clarity of your instruction. Try rephrasing your instruction or being more specific. See the prompt structure in src/llm_interface.py for how the AI is guided.License*(Replace this section with your chosen open-source license
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file draft_writer_bot-1.0.0.tar.gz.
File metadata
- Download URL: draft_writer_bot-1.0.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29437f595a50efcfcb51202c6ff223fedc68379702c75271c22aac65f67d686b
|
|
| MD5 |
dd5d666853df56152e08a2ffeb67ec92
|
|
| BLAKE2b-256 |
e778fb68d5f15ed612ed1446559710e291022c3ba3f782924ba97d5c6ed4ea45
|
File details
Details for the file draft_writer_bot-1.0.0-py3-none-any.whl.
File metadata
- Download URL: draft_writer_bot-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
331bde78bddf3d5bc62626b533eacefe7638df023be1a150e1eb94e879b13b14
|
|
| MD5 |
e21dcf46b2f6f1c3664ac3c807572f0b
|
|
| BLAKE2b-256 |
1f43c928883bbcdf5226b46d5dc9e40c38358cd6ed466b81f992d3f029148fc3
|