Think of it as SillyTavern for 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.
- 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 Smaller Models — Works well with lightweight language models and supports Ollama, LM Studio, and OpenAI-compatible providers.
- 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.
See the Getting Started guide for setup instructions, prerequisites, and configuration.
- AI Assist — Edit and Chat modes, context window, reasoning
- Writing Guide — Dual-agent system, manifests, character profiles, workspace demo.
- Configuration — Workspace, appearance, editor, endpoints, context settings
We welcome contributions of all kinds. See CONTRIBUTING.md to get started. Please read our Code of Conduct.
This project is licensed under the GNU Affero General Public License v3.0 — see LICENSE for details.
Commercial licenses are available for proprietary use. Contact us for details.



