Effect Tavern is a ground-up full-stack harness for AI roleplay and interactive fiction, built on Effect v4, Solid 2.0, UI SDK (@ui-sdk), and Bun.
Instead of relying on prompt incantations, chat-depth injections, and regex scrapers, Effect Tavern treats every card as declarative data plus deterministic rules. Code owns the control loop, seeded dice, state transitions, and prompt-cache boundaries; the LLM is called only at typed stage seams to classify, narrate prose, and extract structured facts.
Explore the Docs
Core Concepts
Understand the 8-stage turn spine, immutable log tree, unified WorldState, and prompt-cache zones.
Card Authoring & Workshop
Design cards with the two-hat workflow, author rules, lore, and products, or remaster legacy cards.
CLI & Headless Host
Run one command, tavern, for zero-token testing, terminal play, Workshop compilation, and SSE hosting.
Layers, Packs & Hats
Customize voice, writing switches, enhancer packs, provider hats, and decision pre-checks without presets.
Desktop & Phone App
Install the app, find where it keeps the library, and see what its Go host does for the page.
Web Client & UI Architecture
Explore the spatial shell, non-jumping reader, Turn Inspector, and cross-platform @ui-sdk controls.
Quick Start
Prerequisites: Bun >= 1.4.5 and Vite+ (vp; Bun installs the packages).
Install workspace dependencies
vp installStart the full-stack web workspace
bun --bun vp run devOpens the Solid 2.0 client with HMR and an in-process
/apisession backed by.dev/tavern.db. SetMODEL=faketo run without spending API tokens.Or play and inspect from the terminal
bun run tavern card install packages/runtime/test/cards/wuxia.yaml MODEL=fake bun run tavern play wuxia --greeting 0 --input "走进竹林" bun run tavern card check packages/runtime/test/cards/wuxia.yamlRun static checks & verification
vp check vp run verify cd packages/client && vp run verify:ui
Fixture & Sample Cards
The program ships with no cards: a new install’s shelf is empty, and cards arrive as files or from a card library the player adds. The repository keeps four YAML cards as test fixtures in packages/runtime/test/cards/ (with full-length remasters such as samples/life-of-pi/life-of-pi.yaml alongside them)—architectural exemplars and live regression suites, installed like any other card file:
| Card ID | Mode & Channel | Demonstrates |
|---|---|---|
banxing |
participant / act |
Pure chat card with zero rules or lore; voice-sample fiction fragment |
ri |
participant / act |
Multi-stage scale bands, hidden route switches, 3 openings, latching readout |
wuxia |
participant / act |
Action rolls, readout bands, 3-layer lore, director, world record & table, guard |
yandao |
author / note |
Protagonist-free world simulation with card-owned pov slot and turn-1 window |
life-of-pi (samples/) |
participant / act |
Multi-day time loop with post-record passages, digest epoch boundaries & end: true |