A Layla mini-app that turns a one-line world premise into a structured, keyword-triggered lorebook ready to import into SillyTavern.
Lorebook Studio guides you through focused areas of your setting, streams context-aware lore drafts from Layla's on-device model, and keeps you in control of what becomes canon. Accept, edit, or reject each entry, answer optional worldbuilding questions, then export the finished work in SillyTavern World Info format.
- Start from a single sentence, theme, or vibe
- Explore model-proposed areas or name your own
- Generate three complementary lore entries per round
- Edit titles, content, and activation keywords before accepting an entry
- Reject unwanted ideas so later rounds avoid repeating them
- Answer probing and detail questions to steer future generations
- Build multiple connected areas using established lore as context
- Preview and save a SillyTavern-compatible World Info JSON file
- Stream generation with stop, retry, and partial-result recovery controls
- Seed your world. Enter a short premise such as "A desert city where water debts pass down bloodlines."
- Choose an area. Pick one of three generated directions or type a specific corner of the setting you want to explore.
- Shape the canon. Review each drafted entry, adjust its text and matching keywords, then accept or reject it.
- Add your intent. Answer optional questions or leave a creator note to establish conflicts, exceptions, sensory details, and other specifics.
- Keep building. Continue the current area or move to another one. Existing entries and answers inform later generations.
- Export. Save
lorebook_export.jsonand import it with SillyTavern's World Info/lorebook importer.
| Seed your world | Choose an area to develop |
|---|---|
![]() |
![]() |
| Review drafted entries | Refine the lore |
|---|---|
![]() |
![]() |
Export to SillyTavern
- Node.js 20 or newer
- npm
- LM Studio, or another OpenAI-compatible streaming chat server
Install dependencies:
npm installFor browser development, start LM Studio's local server at its default OpenAI-compatible endpoint:
http://127.0.0.1:1234/v1/chat/completions
Then start Vite:
npm run devDuring development, the app installs a mock Layla host and forwards model
requests to LM Studio. The /lmstudio Vite proxy avoids browser CORS
restrictions.
To override the defaults, copy .env.example to .env.local and edit:
VITE_LM_STUDIO_MODEL=local-model
VITE_LM_STUDIO_CHAT_ENDPOINT=/lmstudio/v1/chat/completions
VITE_LM_STUDIO_API_KEY=VITE_LM_STUDIO_CHAT_ENDPOINT may also be a full URL when the target server
allows cross-origin requests.
In production, chat generation goes through @layla-network/sdk and the bridge
provided by the Layla WebView. The app uses Layla's on-device model and file
save API, so no model endpoint or API key is embedded in the production build.
Create the production bundle with:
npm run buildThe build is written to dist/. vite-plugin-singlefile bundles the app into a
WebView-friendly HTML file, while Vite copies the mini-app manifest and artwork
from public/.
Layla listing metadata lives in public/app.json:
{
"title": "SillyTavern Lorebook Studio",
"tagline": "Build SillyTavern Lorebooks in Layla.",
"description": "Develop a world premise into focused lore entries, refine the canon with guided questions, and export the result in SillyTavern World Info format.",
"iconUri": "icon.jpg",
"backgroundImgUri": "bg.jpg"
}Accepted drafts are exported as keyed SillyTavern World Info entries. Each entry includes:
- The accepted lore text
- Its edited or automatically extracted activation keywords
- An area-prefixed memo for organization
- Selective matching with 100% probability
- An insertion depth of 4
Creator answers guide later generation but are not emitted as standalone entries in the exported lorebook.
.
+-- assets/ # README screenshots
+-- public/
| +-- app.json # Layla mini-app metadata
| +-- bg.jpg # Listing background
| +-- icon.jpg # Listing icon
+-- src/
| +-- libs/
| | +-- defensiveJsonParser.ts
| | +-- keywordExtraction.ts
| | +-- laylaClient.ts
| | +-- lmStudioMock.ts
| | +-- lorebookapi.ts
| +-- App.tsx # UI, workflow, state, and export
| +-- index.css
| +-- main.tsx # App bootstrap and development mock
+-- .env.example
+-- package.json
+-- vite.config.ts
| Command | Description |
|---|---|
npm run dev |
Start the local Vite server |
npm run build |
Type-check and create the production build |
npm run preview |
Preview the production build locally |
npm run lint |
Run ESLint |
- React 19
- TypeScript
- Vite
@layla-network/sdkvite-plugin-singlefilecompromisefor supplemental keyword extraction- Lucide React
Visit the official Layla website: https://www.layla-network.ai/
Download the Layla app:




