---
title: "Introduction"
description: "Declarative cards, multi-stage turn execution, and deterministic state settlement on Effect v4."
---

> Documentation Index
> Fetch the complete documentation index at: https://tavern.piepia.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

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.

> **Bilingual & Agent-Ready Documentation**
>
> Prefer Chinese? Switch to [简体中文](https://tavern.piepia.space/zh/introduction/) in the top bar. Every page on this site also publishes a clean Markdown twin (`/<slug>/index.md`) and an agent discovery index at `/llms.txt`.

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

1. **Install workspace dependencies**

   ```sh
   vp install
   ```
2. **Start the full-stack web workspace**

   ```sh
   bun --bun vp run dev
   ```

   Opens the Solid 2.0 client with HMR and an in-process `/api` session backed by `.dev/tavern.db`. Set `MODEL=fake` to run without spending API tokens.
3. **Or play and inspect from the terminal**

   ```sh
   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.yaml
   ```
4. **Run static checks & verification**

   ```sh
   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` |

Source: https://tavern.piepia.space/introduction/index.mdx
