Bring Your Own Model (BYOM) data visualization
Upload a CSV, ask natural language questions, get interactive charts via the Agent-to-User Interface (A2UI) pattern.
The frontend UI is published on GitHub Pages: edvardhov.github.io/a2prism
Note: The hosted demo is the static UI only. Chart generation requires the FastAPI backend running locally (or your own deployment) with your LLM API key configured in Settings.
You ask (query + CSV) → Your model (your API key) → JSON (A2UI) → A2Prism validates → Recharts renders
- You upload a CSV and ask a question in plain English.
- The backend summarizes the dataset (columns, dtypes, stats, sample rows) and sends a structured prompt to your LLM via LiteLLM.
- The model returns JSON describing an
InteractiveChartconfig. - A2Prism validates the response and the frontend renders a bar, line, pie, or scatter chart.
Click the ? button in the app header for a full pipeline walkthrough.
User → Next.js UI → FastAPI (/api/analyze) → Pandas + LiteLLM → A2UI JSON → Recharts
| Layer | Stack |
|---|---|
| Frontend | Next.js (App Router), Tailwind CSS, Lucide React, Recharts |
| Backend | FastAPI, Pandas, LiteLLM, Uvicorn |
| State | React useState, API keys in browser localStorage |
docker compose up --build- Frontend: http://localhost:3000
- Backend: http://localhost:8000
- Health check: http://localhost:8000/health
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000cd frontend
cp .env.local.example .env.local # if present
npm install
npm run devOpen http://localhost:3000.
- Open Settings in the sidebar.
- Select a provider (OpenAI, Anthropic, Groq, Google Gemini) or choose Custom for any LiteLLM-supported model string.
- Enter your API key and model name.
- Settings are stored in
localStorageand sent only as request headers to your LLM provider via the backend.
Your API key and CSV data go directly to your configured model provider. A2Prism does not store them.
| Provider | Model string example |
|---|---|
| OpenAI | gpt-4o-mini |
| Anthropic | claude-3-5-sonnet-20241022 |
| Groq | groq/llama-3.1-70b-versatile |
gemini/gemini-2.5-flash |
- Configure API key and model in Settings.
- Upload a
.csvfile or pick an example dataset from the sidebar. - Ask a question, e.g. "Show me sales by region" or "Plot revenue over time".
- The backend summarizes the CSV with Pandas, calls your model via LiteLLM, and returns A2UI JSON.
- The frontend renders the chart with Recharts.
Headers:
x-api-key— your LLM provider API keyx-model-name— LiteLLM model string
Body (multipart/form-data):
file— CSV filequery— natural language question
Response (A2UI JSON):
{
"component": "InteractiveChart",
"config": {
"chartType": "bar",
"title": "Sales by Region",
"xAxisDataKey": "region",
"yAxisDataKey": "sales",
"description": "Total sales aggregated by region",
"data": [
{ "region": "North", "sales": 12000 },
{ "region": "South", "sales": 9500 }
]
}
}a2prism/
├── backend/
│ ├── main.py # FastAPI app, /api/analyze endpoint
│ ├── requirements.txt
│ └── Dockerfile
├── frontend/
│ ├── app/ # Next.js App Router pages
│ ├── components/ # UI + ChartRenderer
│ ├── lib/ # API client, localStorage helpers
│ └── Dockerfile
├── docs/
│ ├── logo-light.svg # README logo (light mode)
│ └── logo-dark.svg # README logo (dark mode)
├── .github/workflows/ # GitHub Pages deployment
├── docker-compose.yml
├── LICENSE # MIT
└── package.json # semver (0.1.0)
This project follows Semantic Versioning. Current release: v0.1.0.
MIT © 2026 Edvard Hovhannisyan