dsh-tavern (Tavern): Using SillyTavern Cards in DSH for Role-Play and Group Chat

Introduction

DSH does not have a built-in character card application out of the box. Common role-playing tools (such as SillyTavern) typically come with their own server-side, model configuration, and authentication state. This means maintaining a separate stack outside of DSH, along with additional account and billing management. dsh-tavern “Tavern” embeds a character card chat application directly into the DSH panel. Generation runs through DSH’s current model, and responses stream token by token over SSE — no extra browser login or model configuration required.

What Is This

dsh-tavern is a single-user character card and role-playing plugin, maintained by frankfurtlin. It brings a SillyTavern-style character card library and chat interface into DSH: a new “Tavern” entry appears in the sidebar. Click a card to enter a full-screen chat, and group chats support 2–5 character cards taking turns speaking. Generation is handled by DSH’s current model — the plugin calls DSH’s LLM via the /tavern-agent gateway. The plugin itself does not provide an application server; you need to deploy the Python + PostgreSQL + Vue stack on your host machine and run the API and static site via systemd.

Core Features

Character Cards

  • Card library grid with search: 5 preset cards are auto-loaded on first visit (Xuanjing, Pei Yu, Naifer, Shen Yan, Tang Tuantuan). Filter by character name or description.
  • Import SillyTavern cards: supports PNG or JSON cards. character_book in v2/v3 is automatically imported as a world book.
  • Card details & export: edit settings (description / personality / scenario / greeting / system prompt / post-instructions / tags), export as PNG/JSON, soft-delete.
  • Avatars: built-in cards are cropped to 512×512 thumbnails.

Chat

  • 1-on-1 chat: click a card to resume the most recent conversation or start a new one. Responses stream token by token over SSE.
  • Stop / Regenerate: you can interrupt after sending. Regenerating appends a new version; switch between versions with ‹n/m›.
  • Message management: edit or delete your own messages; rename the chat title.
  • Import / Export: export as JSONL/JSON (1-on-1), import SillyTavern JSONL (1-on-1 only).
  • History pagination: long chats are paginated at 200 messages, with a “Load earlier” option.

Group Chat

  • Start a group chat with 2–5 cards: select 2–5 in the card library, then click “Start Group Chat” at the bottom.
  • Turn-based speaking: characters take turns in the order selected. Assistant bubbles show the speaker’s name and avatar.
  • Regenerate: the original speaker is preserved.
  • Export: group chat JSONL includes speaker_name.

World Book

  • Injection rules: keyword (≤20), always-active, specified depth (at_depth, 0–100), probability (0–100%), order (ascending).
  • Injection position: before/after character definition, before examples / at specified depth.
  • Injection preview: type a sample message in the card details to see which entries are triggered, why, and the assembled injection text.

Settings

  • Personas: supports multiple personas and a default persona.
  • Presets: save system/main/jailbreak/post_history prompts and sampling parameters (temperature/top_p/max_tokens/stop). Can be set as default; overridable per 1-on-1 chat page.
  • Regex replacement: account-level regex rules applied before a response is persisted. Supports enable/disable and two-step deletion.

Generation via DSH

  • When AI_MODE=dsh, the application server calls DSH’s ctx.llm.stream through the plugin gateway /tavern-agent/v1/stream.
  • If the gateway is unavailable, the error is reported as-is — no fabricated responses.

Installation & Activation

Installing the plugin and deploying the host application require two separate steps.

Plugin Installation

  1. Check out the repository on your host machine, e.g., /opt/dsh/dsh-tavern.
  2. Add the plugin in DSH Web (path is an example — replace with your own checkout path):
dsh plugin --profile web add /opt/dsh/dsh-tavern
  1. Add dsh-tavern to dsh.profile.bundles in the profile’s package.json, then restart DSH Web:
systemctl restart deepseek-harness.service

Host Application Deployment

The following steps use /opt/dsh/dsh-tavern as the example path. Replace with your own directory.

  1. Clone the repository and create a virtual environment:
sudo git clone https://github.com/frankfurtlin/dsh-tavern /opt/dsh/dsh-tavern
cd /opt/dsh/dsh-tavern
python3.12 -m venv app/venv
app/venv/bin/pip install -r app/server/requirements.lock
  1. Generate and edit .env:
python scripts/init-env.py

Edit app/.env with at least the following:
- DATABASE_URL: point to your PostgreSQL instance.
- AI_MODE=dsh: route generation through DSH’s model.
- DSH_AGENT_URL=http://127.0.0.1:3080/tavern-agent/v1: gateway URL.
- DSH_AGENT_SECRET and DSH_TAVERN_AGENT_SECRET must have the same value.
- DSH_TRUSTED_AUTH=true.
- DSH_TRUSTED_SECRET must match the host’s DSH_TAVERN_TRUSTED_SECRET.
- DSH_TRUSTED_USERNAME: must point to an existing active account (the plugin does not auto-create accounts).

  1. Initialize the database and build the frontend:
cd app/server && set -a && . ../.env && set +a && ../venv/bin/alembic upgrade head && cd ../..
cd app/client && npm ci && npm run build && cd ../..
  1. Start the application services:
sudo cp deploy/systemd/dsh-tavern-api.service.example /etc/systemd/system/dsh-tavern-api.service
sudo cp deploy/systemd/dsh-tavern-web.service.example /etc/systemd/system/dsh-tavern-web.service
sudo systemctl daemon-reload
sudo systemctl enable --now dsh-tavern-api dsh-tavern-web
curl -s http://127.0.0.1:8001/health/ready

The plugin only handles sidebar and panel integration. You are responsible for installing and running the application server.

Typical Usage

  1. Click “Tavern” in the sidebar; the panel displays the character card grid.
  2. First use: click “Import Card” and upload a SillyTavern card (PNG or JSON). The card appears in the grid.
  3. Click the card body to enter chat (resumes the most recent conversation if one exists, otherwise starts a new one from the greeting). Responses stream over SSE.
  4. For long chats, paginate to load earlier messages. The last response can be “Regenerated”; use ‹n/m› to switch between versions.
  5. To help the model learn more about the setting: add entries under “World Book” in the card details, then use “Injection Preview” to verify triggers and the injected text.
  6. For multiple setups: go to “Settings” to manage personas, presets, and regex replacement rules.

Use Cases & Cautions

  • Ideal for users who need to use SillyTavern character cards directly within DSH for role-playing and group chats.
  • The plugin runs with the current DSH process privileges. Review the source code and license (MIT) before installing.
  • The plugin does not provide an application server and does not manage models. Generation requires a DSH login with a default model set, and AI_MODE=dsh must be enabled.
  • Single-user interface with a fixed light theme and Chinese language.
  • P3 removed legacy features such as story mode, worlds, branching, and long-term memory. The corresponding old routes now redirect to the card library home page.
  • Group chat has limitations: soft-deleting a member’s card will cause the group chat to return 404; group chat JSONL can no longer be re-imported as a group chat; speaking order is fixed.

In Brief

dsh-tavern “Tavern” embeds SillyTavern-style character cards and chat into DSH, supporting both 1-on-1 and group chats. Generation runs through DSH’s current model, making it ideal for developers and users who want to manage character cards, write, and role-play all within a single interface.

Directory Page & GitHub

  • Plugin directory page: https://www.skillhub.cn/plugins/frankfurtlin/dsh-tavern
  • GitHub: https://github.com/frankfurtlin/dsh-tavern
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye