Skip to content

clchinkc/streamlit-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM-Powered Document Editor: DSPy & LangChain Integration for Intelligent Writing (OpenRouter/OpenAI/Deepseek/Gemini/Github/Ollama)

X URL Streamlit

An intelligent writing assistant with multi-LLM integration for enhanced content creation and editing.

screen_recording.mov

Leverage DSPy's LLM orchestration and LangChain's document processing to create, refine, and manage content with unprecedented efficiency. Ideal for technical writers, content creators, and knowledge workers seeking intelligent document editing.

📚 Table of Contents

🚀 Quick Start

Try the live demo immediately: Open in Streamlit

  1. Clone repository:
git clone https://github.com/clchinkc/streamlit-editor.git
python -m venv venv
source venv/bin/activate  # Unix/MacOS
# .\venv\Scripts\activate  # Windows
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure Streamlit secrets:
mkdir -p .streamlit
touch .streamlit/secrets.toml

Add the following to .streamlit/secrets.toml:

# API Keys (at least one required)
[openrouter]
OPENROUTER_API_KEY = "your_openrouter_api_key"
OPENROUTER_MODEL = "your_openrouter_model"

[openai]
OPENAI_API_KEY = "your_openai_api_key"

[deepseek]
DEEPSEEK_API_KEY = "your_deepseek_api_key"

[gemini]
GEMINI_API_KEY = "your_gemini_api_key"

[github]
GITHUB_TOKEN = "your_github_token"

[ollama]
OLLAMA_MODEL = "your_ollama_model"
  1. (If you want to use Ollama) Setup Ollama:

First, install Ollama.

Then start Ollama server with the specified model:

ollama run your_ollama_model
  1. Launch application:
streamlit run streamlit_editor.py

And the app will be running on http://localhost:8501.

✨ Intelligent Document Workflows

Combined Features & User Processes

1. Content Creation Phase

  • Multi-format Editing Suite

    • ✍️ Dual-mode editor (Editor + Markdown Preview)
    • 📥 File ingestion: Drag-and-drop .md/.txt support
    • 📤 Export flexibility: Download markdown or clipboard copy
  • Structural Tools

    • 🗂️ LangChain-powered document chunking
    • 📚 Section-level editing

2. AI Collaboration Phase

  • Context-Aware Assistance

    • 🤖 DSPy-powered feedback suggestions (general or specific to reference text)
    • 📑 Automated section summarization
    • 🧩 LLM-driven content regeneration
    • 📝 Review and compare AI-generated changes
  • Quality Control

    • 🔍 Semantic feedback tracking with source references
    • 📊 Real-time feedback dashboard
    • ✅ Accept/reject AI suggestions with diff view

3. Finalization & Management

  • Output Optimization

    • 🧮 Batch operation processing for bulk edits
  • Advanced Orchestration

    • 🚦 DSPy-managed suggestion pipeline
    • 📜 Version history tracking
    • 🌐 Multi-modal previews (raw + rendered views)
    • 📄 Pagination for summaries

⚙️ System Architecture

🔧 Technical Stack

Component Technology Purpose
AI Framework DSPy LLM operations management
Text Processing LangChain Document chunking
UI Framework Streamlit Web interface
Visualization Streamlit Mermaid Document flow diagrams

📄 License

MIT Licensed - See LICENSE for details.