How LiveReview Built an LLM That Generates Charts Using JSON, Not Pixels

LiveReview, maker of an AI-powered code review tool called Livi, developed a system that lets a large language model produce data charts without generating any images directly. Instead of having the LLM render pixels, the team trained it to output Vega-Lite, a JSON-based grammar that declaratively describes chart structure, leaving actual rendering to the Vega-Lite engine. The approach prevents the model from fabricating visual data, since the LLM writes SQL queries but never handles the real numbers — those are injected by backend Go code after the queries are executed. A two-step SQL generation process first estimates result size to avoid impractical charts, while a separate SQL guard blocks non-read-only queries and enforces tenant-level data isolation. The same Vega-Lite definition is used to render both an interactive browser chart and a static PNG for Slack, enabling consistent output across platforms.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in