A newer version of the Gradio SDK is available:
5.10.0
metadata
sdk: gradio
LLM LSP
A proof of concept for intelligent document editing that works like humans do - scan, jump, edit.
The Idea
Instead of making AI read entire documents, we let it:
- Scan headers to find location (like grep)
- Jump to right section (like sed)
- Make targeted changes
- Put it back (like cat)
Quick Start
pip install -r requirements.txt # openai, gradio
from lsp import LSP
editor = LSP(api_key="your-key")
editor.edit("doc.md", "add version warning")
How It Works
- Map Sections Fast
sections = find_sections("doc.md") # Uses grep-like scan
- AI Picks Target
{
"sections": {"## Setup": 10, "## Config": 50},
"task": "add version warning",
"target": "## Setup at line 10"
}
- Extract & Edit
content = extract_section(file, 10, 49) # Just that piece
new_content = ai.modify(content) # AI edits small part
- Put It Back
replace_section(file, 10, 49, new_content)
Try It
python main.py # Launches Gradio UI
Status
- POC stage
- Works with markdown files
- Uses gpt-4o-mini
- Basic UI
Limits
- One section at a time
- Just markdown for now
- No fancy error handling
- Will fuck up if sections aren't clear
Next Steps?
- Handle multiple sections
- Better section detection
- More formats
- Whatever you need it to do