Skip to content

Laszlobeer/AI-Writer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

49 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Writer πŸ–‹οΈ

logo

A sleek desktop application for AI-assisted writing powered by Ollama and built with PyQt5. Let your local LLM continue your stories, articles, or documents seamlessly.

Python PyQt5 Ollama License


✨ Features

  • πŸ€– AI Text Completion - Continue your writing with local LLM models via Ollama
  • 🎨 Light/Dark Theme - Toggle between beautiful light and dark modes
  • 🌑️ Temperature Control - Adjust creativity vs. focus (0.0 - 2.0)
  • πŸ“Š Token Limit - Control response length (10 - 2000 tokens)
  • πŸ“ Model Selection - Choose from all your installed Ollama models
  • πŸ’Ύ Multiple Export Formats - Save as .txt or .docx (Word)
  • πŸ–₯️ Modern UI - Clean, responsive interface with sidebar controls

πŸ“‹ Requirements

System Requirements

  • Python 3.8+
  • Ollama installed and running locally
  • Operating System: Windows, macOS, or Linux

Python Dependencies

PyQt5>=5.15.0
requests>=2.28.0
python-docx>=0.8.11  # Optional, for .docx support

πŸš€ Installation

1. Install Ollama

First, ensure Ollama is installed and running on your system:

Windows/macOS:

# Download from https://ollama.ai
# Then pull a model
ollama pull thewindmom/hermes-3-llama-3.1-8b

Linux:

curl -fsSL https://ollama.ai/install.sh | sh
ollama pull thewindmom/hermes-3-llama-3.1-8b

2. Clone the Repository

git clone https://github.com/Laszlobeer/AI-Writer.git
cd ai-writer

3. Create Virtual Environment (Recommended)

python -m venv venv

# Windows
venv\Scripts\activate

# macOS/Linux
source venv/bin/activate

4. Install Dependencies

pip install -r requirements.txt

Or install manually:

pip install PyQt5 requests python-docx

🎯 Usage

Starting the Application

python ai writer.py

Basic Workflow

  1. Select a Model - Click the model dropdown and choose an installed Ollama model
  2. Write Your Text - Start typing in the editor
  3. Click Generate - Press the ✨ Generate button or use keyboard shortcut
  4. Save Your Work - Export as .txt or .docx

Controls

Control Description
πŸŒ™/β˜€οΈ Toggle Light/Dark theme
πŸ”„ Refresh available models
✨ Generate Trigger AI completion
πŸ“„ Save .txt Export as text file
πŸ“• Save .docx Export as Word document
🌑️ Temperature Adjust creativity (left=focused, right=creative)
πŸ“Š Token Limit Set maximum response length

βš™οΈ Configuration

Default Settings

Setting Default Value Description
Temperature 0.7 Balance between creativity and coherence
Token Limit 2000 Maximum tokens in AI response
Ollama URL http://localhost:11434 Local Ollama server endpoint

Customizing Settings

You can modify default values in the source code (ai_writer.py):

# In ai_writer.py
OLLAMA_URL = "http://localhost:11434"
DEFAULT_TOKEN_LIMIT = 140
DEFAULT_TEMPERATURE = 0.7

Temperature Guide

  • 0.0 - 0.5 🎯 Focused, deterministic output
  • 0.5 - 1.0 βš–οΈ Balanced creativity and coherence
  • 1.0 - 2.0 🎨 Highly creative, unpredictable output

πŸ–ΌοΈ Screenshots

Light Mode

Light Mode

Dark Mode

Dark Mode


πŸ”§ Troubleshooting

Ollama Connection Error

Cannot connect to Ollama. Is it running?

Solution: Ensure Ollama service is running:

ollama serve

No Models Found

No models available

Solution: Pull a model:

ollama run thewindmom/hermes-3-llama-3.1-8b

python-docx Not Available

install python-docx for .docx

Solution: Install the package:

pip install python-docx

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Ollama - Local LLM infrastructure
  • PyQt5 - GUI framework

About

A code that will help you write a story

Resources

License

Stars

4 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages