Skip to content

Repository files navigation

margin

License: AGPL-3.0 Python: 3.10+ Node: 18+

An AI writing workspace with smart context management and deep customization.

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.

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 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.

Screenshots

Editor home Edit preview
Chat preview Home full view

Getting Started

See the Getting Started guide for setup instructions, prerequisites, and configuration.

Docs

  • 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

Contributing

We welcome contributions of all kinds. See CONTRIBUTING.md to get started. Please read our Code of Conduct.

License

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.

About

longer format writing tool for smaller llms.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages