How pbaniket/chimeragrid works
1. Overall shape
ChimeraGrid is a single Python web application with a server-rendered UI. The architecture is centered on a Flask backend, HTML templates, static assets, and an AI-assisted transformation engine.
2. Primary entrypoint
The repository has appy.py as the likely Flask application entrypoint. From the README, this is what gets run to start the service. There is no separate frontend app, worker service, or database layer in the tree.
3. User-facing flow
The app appears to guide users through a multi-step wizard:
- home / landing
- file upload
- column selection
- sample display
- target input
- transformation review
- results
The templates in templates/ map directly to these stages.
4. Frontend boundary
The UI is rendered server-side with Jinja templates in templates/, while static/ contains the browser-side CSS and JavaScript. script.js likely handles client-side interactivity for the wizard, previews, or form behavior; the styling is split across style.css and home.css.
5. Core backend responsibility
The Flask layer likely orchestrates the entire workflow: receiving uploaded tabular data, storing intermediate selections in request/session state, rendering the next page, and eventually returning the generated transformation output. This backend is the main boundary between browser interaction and transformation logic.
6. Transformation engine
transformer.py is the key non-UI module. Based on the README, it likely builds prompts for the LLM, interprets examples from the selected table column(s), and produces a Python transformation function. This module is the main separation point between web orchestration and AI/data logic.
7. External AI dependency
The repository is explicitly integrated with Gemini 1.5 Flash through google-generativeai. That external LLM service is a core dependency, not an optional add-on: it is what turns a few examples into a human-readable Python function. The architecture therefore depends on outbound network calls to Google’s model API.
8. Data flow through the system
The central data path is:
uploaded table -> parsed into pandas/JSON-friendly structures -> user selects relevant columns and examples -> LLM prompt is assembled -> Gemini returns transformation logic -> generated Python code is shown in the review/results pages.
The application is focused on transforming tabular data rather than training or storing models.
9. Information passed between steps
The intermediate pages suggest the app preserves progressively richer context: the raw uploaded dataset, chosen source/target columns, a sample subset, the desired transformation intent, and then the generated code/output. Since there is no database directory or persistence layer, this state is likely temporary and held in-memory or session-backed across requests.
10. Output model
The product emphasizes transparent, editable Python output rather than a black-box prediction. So the final architectural output is not just transformed data, but also an inspectable transformation function, which is a distinct deliverable from the UI’s result page.
11. Technology stack that affects architecture
The app is Python/Flask on the server, pandas for data handling, and standard HTML/CSS/JavaScript on the client. Tailwind CSS is mentioned in the README, which suggests the UI is styled as a utility-first, template-driven interface rather than a component framework.
12. What is not present
There is no evidence of a database, message queue, auth subsystem, or multi-service backend in this repository. That makes ChimeraGrid a compact, request-driven web app whose main architectural concerns are form flow, data parsing, and LLM integration.
Main entry points: appy.py appy.py · transformer.py transformer.py · upload.html Upload · column_selection.html Columns
Components 15
Server UI
Server-rendered pages and browser assets for the wizard flow.
- Home · Initial landing page for the app.
templates/home.html - Upload · Page for uploading the input table.
templates/upload.html - Columns · Page for choosing relevant columns.
templates/column_selection.html - Sample · Page showing sampled rows or examples.
templates/sample_display.html - Target · Page for describing the desired transformation target.
templates/target_input.html - Review · Page for reviewing the generated transformation.
templates/review_transformation.html - Results · Final page showing the generated code or output.
templates/results.html - script.js · Client-side behavior for the wizard flow.
static/script.js - style.css · Main styling for the application UI.
static/style.css - home.css · Styling for the landing page.
static/home.css
Flask App
Request handling and workflow orchestration.
- appy.py · Starts the web app and wires routes.
appy.py - Tabular Data · In-memory parsing and preparation of uploaded tables.
- Request State · Temporary state passed between wizard steps.
Transformation Engine
Prompting and code generation logic backed by Gemini.
- transformer.py · Builds prompts and produces the transformation logic.
transformer.py - Gemini API · External model service used to generate transformations.
Connections 21
- appy.py → Home: serves · Renders the landing page.
- appy.py → Upload: routes · Starts the upload flow.
- appy.py → Columns: routes · Advances to column selection.
- appy.py → Sample: routes · Shows sampled data for review.
- appy.py → Target: routes · Collects the target transformation intent.
- appy.py → Review: routes · Shows the generated transformation for approval.
- appy.py → Results: routes · Displays the final output.
- Upload → Tabular Data: parses · Uploaded files are read into tabular structures.
- Columns → Request State: stores · Selected columns are kept for later steps.
- Sample → Request State: stores · Sample context is preserved across requests.
- Target → Request State: stores · User intent is carried into generation.
- appy.py → transformer.py: calls · Backend invokes the transformation engine.
- transformer.py → Tabular Data: consumes · Uses table data and examples to build context.
- transformer.py → Gemini API: prompts · Sends prompt and examples to the LLM service.
- Gemini API → transformer.py: returns · Returns generated transformation text or code.
- transformer.py → Review: produces · Feeds review page with generated function details.
- Review → Results: confirms · Approved transformation is shown as final output.
- script.js → Upload: enhances · Adds browser-side interactivity to form flow.
- script.js → Columns: enhances · Supports dynamic selection behavior.
- style.css → Home: styles · Applies the main UI theme.
- home.css → Home: styles · Applies landing-page specific styling.