margin
Margin is an open-source, local-first AI writing studio for Markdown users.
Think of it as SillyTavern for story writing: a customizable environment where writers can collaborate with context-aware AI agents, swap models, manage prompts, and build their own creative workflows -- all while keeping their work on their own machine.
Instead of treating AI as a chat window, Margin integrates it directly into the writing process. Draft scenes, brainstorm plots, maintain world lore, rewrite passages, and iterate on ideas inside a distraction-free editor designed for long-form writing.
Why margin?
- Markdown-Native Writing Environment -- A distraction-free editor designed for long-form writing projects and documentation.
- Runs Locally -- Your manuscripts, notes, and context stay on your machine. No required cloud services or telemetry.
- Optimized for Local Models -- Works well with lightweight language models and supports Ollama, LM Studio, and OpenAI-compatible providers. Or bring your OpenCode, Claude Code, Codex, or Antigravity subscription.
- Automatic Context Management -- Organize characters, lore, outlines, and style guides into folders. Margin automatically includes the relevant context for each task.
- Customizable AI Workflows -- Configure prompts, agents, and writing pipelines to match your process instead of adapting to rigid presets.
- Interactive Diff Review -- Review AI-generated edits with clear inline diffs before accepting or rejecting changes.
- Imagine Images -- Describe maps, mood boards, character sketches, or scene references in words and generate them with OpenAI, Stability, FAL, Google Gemini, or local ComfyUI workflows.
- Workspace Profiles -- Link or scaffold multiple project folders, switch from the sidebar, with optional Git init.
Sections
- Getting Started -- System requirements, installation, and first launch.
- Configuration -- All settings explained: workspaces, appearance, context, endpoints, harness, images.
- Writing Guide -- How AI assist works, character profiles, style guides, manifests, custom prompts, and images.
- Debugging -- Inspecting AI logs and prompts, local telemetry, and fixing common image issues.
Quick Links
- GitHub: github.com/prxshetty/margin
- Report an Issue: github.com/prxshetty/margin/issues
