schema_token_cost --visualize

Your AI doesn't need more tokens. It needs context. To write SQL against your warehouse, an LLM must be told the schema — every table, column, and relationship. On a 28-table schema that's ~4,400 tokens per query, every query, before the user even asks anything. Drag the schema graph to orbit; move the sliders to watch the bill grow; flip on a semantic layer to watch it shrink.

RAW SCHEMA DUMP
entire schema injected into every prompt
0
TOKENS / QUERY

SCHEMA & TRAFFIC

Semantic layer / cached context mode

THE BILL

schema tokens / query
relationship (FK) tokens
tokens / day
schema cost / month
saved vs raw dump

WHY PROMPTS BLOAT

MITIGATION PLAYBOOK

  • Retrieve, don't dump: embed table/column descriptions, retrieve only the 3–6 tables relevant to the question. Most queries touch a tiny subgraph.
  • Semantic layer: expose curated metrics and entities ("revenue", "active_user") instead of raw DDL. The model picks a metric; the layer compiles correct SQL — fewer tokens AND fewer join hallucinations.
  • Prompt caching: providers discount repeated prefixes (often ~90%). A stable schema block placed first in the prompt gets cached; only the user question is full price.
  • Views & naming hygiene: wide denormalized views and self-describing names (customer_ltv_usd) let you send fewer tables with less explanation.
Enjoy this tool? Build your own with Super