# 📜 S I L L Y L O R E S M I T H 📜

**AI-Powered Lorebook Builder for SillyTavern**

*by Eph at ephemeradev.net · est. 2026 · Open Source 💜*

---

A desktop app that crawls wiki pages, summarizes them with AI, and builds structured lorebook entries for __[SillyTavern](https://github.com/SillyTavern/SillyTavern)__ and other AI roleplay platforms.

Built by a mentally ill untrained aegosexual who wanted it to exist, nobody else was making it, and because your AI boyfriend deserves a lore-accurate backstory.

The Cat supervised.

---

## ✦ Features

**Wiki Crawling**

> Point it at any Fandom wiki category page and it'll discover every page under it. Configurable depth, parallel crawling with 1-8 worker threads, and portal page support for those wikis that organize things weird.

**AI Summarization**

> Feed your crawled pages to Claude, GPT, or any OpenAI-compatible provider and get back structured lorebook entries. 8 voice styles from Neutral to Ephemera. Approximate cost estimation before you commit, and Batch processing with progress tracking.

**Full Lorebook Editor**

> Create, edit, delete, reorder, set triggers, priority, insertion order, constant status, and selective logic. There are entry health indicators to tell you when something looks wrong, and it includes undo/redo because mistakes happen. (I'm a mistake)

**Multiple AI Providers**

> → **Anthropic (Claude)**: the one who actually reads the wiki page
> → **OpenAI (GPT)**: the popular one
> → **OpenRouter**: the buffet
> → **Ollama (Local)**: for the off-grid loresmiths
> → **OpenAI-Compatible**: Together, Groq, LM Studio, whatever speaks the format

**Import / Export**

> Import from SillyTavern JSON, World Info, JSONL chat logs, plain text, or CSV. You can export it to a SillyTavern-compatible JSON or another option; it's your lorebook, your format.

**8 Voice Styles**

> Neutral · Serious · Deadpan · Comedic · Dramatic · Lyrical · Narrative · Ephemera
>
> Each one changes how the AI writes your entries. Deadpan is for when you want your lore delivered like a Wikipedia article that's given up. Ephemera is... well...it's a vibe. My vibe.

**AI Brain**

> Auto-link related entries, generate glossaries, find what's missing from your lorebook, cluster entries by theme, map character relationships. It's like having a lore consultant who never sleeps.

**Advanced Tools**

> Batch operations, entry normalization, duplicate detection, find-and-replace across all entries, tag management, content analysis.

**Profiles & Projects**

> Persistent mode saves everything between sessions. Ephemeral mode for quick one-offs. Project Chest lets you manage multiple lorebooks. Profile avatars with 17 hand-drawn icons.

**Dark Theme**

> 30+ accent colors organized into lore-themed palettes (Bard's Flirtation, Soft Necromancy, Dragon's Breath...). Everything is dark. We don't do light mode here.

**14,700+ Lines of Code**

> One developer. One cat. Zero formal training. No regrets. Some regrets. Many regrets.

---

## 🚀 Installation & Setup

### Option A: Download the .exe

Go to [**Releases**](../../releases), download the zip, extract, double-click `SillyLoresmith.exe`. Done.

### Option B: Run from Source

1. Install Python 3.10+ from [python.org](https://python.org)
   * ⚠️ **CHECK "Add Python to PATH"** during install.
2. Install Pillow (for icons):
   ```
   pip install Pillow
   ```
3. Clone or download this repo
4. Run it:
   ```
   python main.py
   ```

### Option C: Build the .exe Yourself

1. Do Option B first to make sure it works
2. Double-click `build.bat` or run:
   ```
   pip install pyinstaller
   python -m PyInstaller --onefile --noconsole --name SillyLoresmith --icon=app_icon.ico main.py
   ```
3. Your exe lands in `dist/`

---

## 🔑 Provider Setup

**Anthropic (Claude):**

> → Get a key at [console.anthropic.com](https://console.anthropic.com)
> → Default model: `claude-sonnet-4-20250514`
> → Recommended for lorebook writing. Claude reads the source material and actually cares.

**OpenAI (GPT):**

> → Get a key at [platform.openai.com](https://platform.openai.com)
> → Default model: `gpt-4o`

**OpenRouter:**

> → Get a key at [openrouter.ai](https://openrouter.ai)
> → Access to dozens of models through one API key

**Ollama (Local / Offline):**

> → Install from [ollama.com](https://ollama.com)
> → Run: `ollama pull llama3`
> → No API key, no internet, no charges
> → Best with 13B+ parameter models for quality lore

**OpenAI-Compatible:**

> → Set Base URL to your provider's endpoint
> → Works with Together AI, Groq, LM Studio, etc.

---

## 📁 Project Structure

| File | What It Does |
| --- | --- |
| `main.py` | Entry point. Startup dialog, DPI awareness, error handling. |
| `app.py` | The whole app. 10,000+ lines. I'm sorry. |
| `widgets.py` | Custom dark-themed UI components. |
| `theme.py` | Colors and font definitions. |
| `config.py` | Provider configs, prompts, lorebook defaults. |
| `profile_manager.py` | Persistent profile storage and theme colors. |
| `startup_dialog.py` | The "Ephemeral or Persistent?" launcher. |
| `helpers.py` | Token estimation, undo manager, status/API logging. |
| `wiki_crawler.py` | Wiki crawling, page classification, link extraction. |
| `api_calls.py` | OpenAI, Anthropic, Gemini API integrations. |
| `chat_parser.py` | SillyTavern chat log parsing. |
| `build.bat` | One-click Windows exe builder. |
| `icons/` | 19 hand-drawn profile avatar icons. |
| `*.png` | Voice style icons and mascot images. |

---

## ⚠️ Disclaimers

**API Keys & Charges**

> Your API keys are stored locally on YOUR machine. They go nowhere except to the provider you selected. Eph is NOT responsible for any API charges you incur. The cost estimator is approximate. Check your provider dashboard for real billing.

**Wiki Content**

> Content crawled from wikis belongs to its original creators. Lorebooks you build are for personal, non-commercial roleplay use. Don't be weird about it.

**No Warranty**

> This software is provided as-is. It works on my machine. If it doesn't work on yours, bug reports are welcome. Mean comments will be read aloud to The Cat, who will not care.

**Privacy**

> SillyLoresmith collects nothing. No telemetry, no analytics, no tracking. Your data stays on your machine. Your writing goes only to the AI provider you choose.

---

## 🐾 FAQ

**"Why is the file 10,000 lines?"**

> I don't want to talk about it.

**"Can I use this for D&D?"**

> Absolutely. Crawl any Fandom wiki, Forgotten Realms, Critical Role, whatever. It'll build lorebook entries from anything with a wiki.

**"Does this work with Kobold / Oobabooga / other frontends?"**

> The export format is SillyTavern JSON (World Info). If your frontend can import that, yes. If not, you can export as plain text or CSV.

**"The AI summarized my favorite character badly"**

> Try a different voice style, increase the detail level, or write a custom prompt. Garbage in, garbage out, and also sometimes AI just has opinions.

**"Something is broken"**

> Open an issue. Include what you were doing, what happened, and what you expected. Screenshots help. Vague reports of "it doesn't work" will be shown to The Cat.

---

## 💬 Support & Links

🌐 **Website:** [ephemeradev.net](https://ephemeradev.net)

🐾 **Other projects:** [InkPaw](https://github.com/ephemera02/InkPaw) - AI prose polisher

💜 **Support development:** [ephemeradev.net](https://ephemeradev.net) - tips welcome, never required

---

## Credits

**Created by Eph at Ephemera**

Built with the assistance of Claude (Anthropic), who was patient beyond reason.

Mascot: The Cat, who did the real work.

Icons: Hand-drawn in PIL because AI-generated icons have licensing problems and also they looked cursed.

---

## License

MIT License. See [LICENSE](LICENSE) for details.

---

*"She believed she could build a lorebook generator and she mostly did."*

🐾
