lsp / README.md
airabbitX's picture
Update README.md
85db553 verified

A newer version of the Gradio SDK is available: 5.10.0

Upgrade
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:

  1. Scan headers to find location (like grep)
  2. Jump to right section (like sed)
  3. Make targeted changes
  4. 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

  1. Map Sections Fast
sections = find_sections("doc.md")  # Uses grep-like scan
  1. AI Picks Target
{
    "sections": {"## Setup": 10, "## Config": 50},
    "task": "add version warning",
    "target": "## Setup at line 10"
}
  1. Extract & Edit
content = extract_section(file, 10, 49)  # Just that piece
new_content = ai.modify(content)         # AI edits small part
  1. 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