AI writing companion powered by frontier models
A feature-rich markdown editor with access to the world's best AI models - GPT-4, Claude, Gemini, Grok, and 100+ more. All the power of SanctumWriter, supercharged with cloud AI.
| Feature | SanctumWriter | SanctumWriter Pro |
|---|---|---|
| Local Models (Ollama/LM Studio) | ✅ | ✅ |
| OpenRouter (100+ models) | ❌ | ✅ |
| OpenAI (GPT-4o, GPT-4) | ❌ | ✅ |
| Anthropic (Claude 3.5, Opus) | ❌ | ✅ |
| Google (Gemini Pro, Flash) | ❌ | ✅ |
| xAI (Grok 3) | ❌ | ✅ |
| 100% Local/Private | ✅ | Local + Cloud |
| Cost | Free | Provider fees apply |
Choose SanctumWriter if you want 100% privacy and free usage with local models.
Choose SanctumWriter Pro if you want access to frontier AI models like GPT-4 and Claude.
- 📝 Markdown Editor - Full-featured editor with syntax highlighting (CodeMirror)
- 🤖 AI Writing Companion - Chat with AI to help write and edit
- ✨ Agentic Editing - AI directly modifies your document (no copy/paste!)
- 🎯 Selection-Aware - Highlight text and ask the AI to rewrite just that section
- 📁 File Browser - Navigate and manage your documents
- 👁️ Live Preview - See rendered markdown as you type
- ⚡ Frontier Models - Access GPT-4, Claude, Gemini, Grok instantly
- 🌐 OpenRouter Integration - One API key = 100+ models
- 🔄 Seamless Switching - Switch between local and cloud models anytime
- 🔑 Secure Key Storage - API keys stored locally, never on our servers
- 👥 Council of Writers - Multi-model review system
- 🔍 Research Integration - SearXNG search with AI summaries
- 📚 RAG Knowledge Base - Reference documents for context
- 🧠 Session Memory - AI remembers across conversations
- 📖 Citations & Bibliography - Academic citation management
- 📁 Multi-Document Projects - Obsidian-compatible project folders
- 📤 Export - PDF, DOCX, HTML with table of contents
git clone https://github.com/TheAIHorizon/SanctumWriterPro.git
cd SanctumWriterPro
npm installnpm run devOpen http://localhost:3130 in your browser.
- Go to Settings (gear icon) → API Keys tab
- Add at least one API key:
Click the provider dropdown in the header → Select a cloud provider → Choose a model.
OpenRouter is the easiest way to get started - one API key gives you access to:
- GPT-4o, GPT-4 Turbo
- Claude 3.5 Sonnet, Claude 3 Opus
- Llama 3.1 405B
- Mistral Large
- Gemini Pro
- And 100+ more models
SanctumWriter Pro is free for noncommercial use under the Polyform Noncommercial License (see License). You only pay for the cloud API usage:
| Provider | Approximate Cost |
|---|---|
| OpenRouter | Varies by model ($0.10 - $15 per 1M tokens) |
| OpenAI GPT-4o | ~$5 per 1M tokens |
| Anthropic Claude 3.5 | ~$3 per 1M tokens |
| Google Gemini | Often free tier available |
💡 Tip: For most writing, a few dollars goes a long way. A typical document edit costs fractions of a cent.
- API keys stored locally in your browser's localStorage
- Keys sent directly to providers - we never see them
- No telemetry - we don't track your usage
- Source-visible - the code in this repository is publicly readable so you can audit it yourself (this is not a statement about license/reuse rights — see License)
For maximum privacy, use the free SanctumWriter with local models.
- Framework: Next.js 14
- Editor: CodeMirror 6
- Styling: Tailwind CSS
- State: Zustand
- LLM: Ollama, LM Studio, OpenRouter, OpenAI, Anthropic, Google, xAI
- Create or open a document
- Write markdown in the editor
- Use the AI chat to get help
- Add your API key in Settings → API Keys
- Select a cloud provider from the dropdown
- Choose a model
- Chat with frontier AI!
- Highlight text in the editor
- Ask: "Rewrite this" or "Make it more concise"
- AI directly modifies just the selected text
Add your API key in Settings → API Keys for the provider you want to use.
The provider is available but not configured. Click it anyway, then add your key in Settings.
- Check your API key is correct
- Verify the provider's service is operational
- Some providers require billing setup before API works
Local providers (Ollama, LM Studio) still work! They're in the "Local (Free)" section of the provider menu.
- SanctumWriter - Free, 100% local version
- Ollama - Run models locally
- OpenRouter - Multi-model API gateway
Polyform Noncommercial License 1.0.0 — see LICENSE for the full text. Free for personal, educational, research, and other noncommercial use; commercial use requires a separate license from the copyright holder. This matches the upstream SanctumWriter project and is the standard license across the Sanctum suite. It is a source-available license, not an OSI "open source" license: you can read and audit the code, but reuse is limited to noncommercial purposes. (An earlier README claimed "MIT"; that was a documentation error.)
SanctumWriter Pro - Frontier AI at your fingertips.