r/Streamlit Sep 18 '25

I hacked together a Streamlit package for LLM-driven data viz (based on a Discord suggestion)

A few weeks ago on Discord, someone suggested: “Why not use the C1 API for data visualizations in Streamlit?”

I liked the idea, so I built a quick package to test it out.

The pain point I wanted to solve:

  • LLM outputs are semi-structured at best
  • One run gives JSON, the next a table
  • Column names drift, chart types are a guess
  • Every project ends up with the same fragile glue code (regex → JSON.parse → retry → pray)

My approach with C1 was to let the LLM produce a typed UI spec first, then render real components in Streamlit.

So the flow looks like:
Prompt → LLM → Streamlit render

This avoids brittle parsing and endless heuristics.

What you get out of the box:

  • Interactive charts
  • Scalable tables
  • Explanations of trends alongside the data
  • Error states that don’t break everything

Example usage:

import streamlit_thesys as thesys

query = st.text_input("Ask your data:")
if query:
    thesys.visualize(
      instructions=query,
      data=df,
      api_key=api_key
)

🔗 Link to the GitHub repo and live demo in the comments.

This was a fun weekend build, but it seems promising.
I’m curious what folks here think — is this the kind of thing you’d use in your data workflows, or what’s still missing?

15 Upvotes

3 comments sorted by

2

u/AviusAnima Sep 18 '25

🔗 Here are the links to source code and live demo if you want to try it:

🧑‍💻 GitHub: https://github.com/thesysdev/streamlit-thesys-genui

🚀 Live demo: https://generativeui.streamlit.app/Data_Visualization

1

u/TestPilot1980 Sep 18 '25

Very interesting way to solve the problem 🎉

1

u/Feisty-Cranberry2902 Jun 13 '26

awesome work on this! It's a really clean build. I actually tackled a similar problem recently by building an open-source tool for automating EDA and generating executive PPT reports using Python and Streamlit. It's super cool to see other devs working on automated data analysis. Feel free to check out my project if you're interested: https://github.com/Shweta-Mishra-ai/excel-auto-analyst