OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Evaluation & Observability

Tealeaves

TeaLeaves is a Python pipeline for inspecting how Hugging Face language models process prompts. It annotates prompt regions, captures attention across model layers, and produces heatmaps, cooking curves, layer animations and variant comparisons; its logit-lens view tracks token-rank trajectories through layers.

Independent OpenViST project profile, based on linked sources.

Tealeaves — OpenViST project profile in AI Evaluation & Observability.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use TeaLeaves when output-only comparisons do not explain how prompt changes affect attention patterns, and you can run analysis on a Hugging Face model with sufficient GPU memory.

Who it is for

  • Prompt developers investigating how revisions affect model attention.
  • Researchers studying prompt processing and model interpretability.
  • Teams evaluating prompt variants across test cases, including structured-output tasks.

Documented uses

  • Mark named regions in system prompts and user messages for analysis.
  • Capture attention weights across layers and examine token- or region-level patterns.
  • Compare prompt variants using delta tables, multi-seed stability analysis and reports.
  • Inspect token-rank trajectories with the logit lens.
Before you choose

Requirements & limits

  • Rendering and analysis can be installed locally; running the model engine uses a separate GPU-dependency installation.
  • GPU memory requirements rise with model size: the repository estimates about 21 GB VRAM for 8B parameters and 69 GB for 32B, plus its stated memory rule of thumb.
  • The workflow requires structured prompt regions and conversation test cases before analysis.
  • TeaLeaves is a pipeline that produces analysis outputs, rather than a low-level hook library requiring users to assemble their own analysis.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Prepare prompt inputs and define analysis regions

Create the structured input files TeaLeaves uses before running model analysis.

Before you start

  • A system prompt text file.
  • A regions JSON file defining named spans with markers, regular expressions or character ranges.
  • A conversations JSON file containing test cases.

Steps

  1. Create a regions JSON file that names prompt spans, such as rules, examples, context and current message.

  2. Save the full system prompt as system_prompt.txt.

  3. Save conversation test cases in conversations.json.

  4. Run the documented input-preparation module with the prompt, regions and conversations files to produce test_cases.json.

Expected outcome

A test_cases.json input file prepared for the documented analysis stage.

Guide limitations

  • This guide covers input preparation only; it does not run model analysis or verify that the inputs are valid.
Source-based practical guide

Render and compare existing TeaLeaves results

Generate documented visualizations and comparison reports from result files already produced by the pipeline.

Before you start

  • TeaLeaves installed locally with rendering and analysis dependencies.
  • Result files in a results directory, including baseline and modified variants for comparison.

Steps

  1. Render a per-token heatmap from a result JSON file.

  2. Render per-region attention trajectories as cooking curves, or render an animated layer sweep.

  3. Optionally generate a multi-sample aggregate from a results directory.

  4. Run the comparison module with named baseline and modified variants, then generate a markdown report from the experiment directories.

Expected outcome

Rendered attention views and, when comparison inputs are provided, variant comparison output and a markdown report.

Guide limitations

  • This guide starts from existing result files and does not cover model setup or capture.
  • The documented commands assume the shown module names, file layout and variant identifiers.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
18 October 2026
Original website title
taylorsatula/TeaLeaves · Official homepage title · retained in its source language