How shubankar-sridhar/mlproject works
This is an enterprise natural-language-to-SQL application: users submit questions, the backend generates and validates SQL, executes it, and can return chart specifications for the results. The repository also exposes model management and training endpoints. The sampled route and inference code show the query orchestration; visualization internals and training implementation are present in the tree but were not sampled, so their internal connections are not inferred.
Main entry points: routes.py API routes · App.jsx Query and results UI · ResultsView.jsx Results view · dependencies.py Schema and rules
Components 28
Query interface
- Query and results UI
frontend/src/App.jsx - Query input
frontend/src/components/QueryInput.jsx - Results view
frontend/src/components/ResultsView.jsx - Chart renderer
frontend/src/components/ChartRenderer.jsx - Data table
frontend/src/components/DataTable.jsx
API and access
- API routes
src/pipeline2/api/routes.py - Auth and rate limits
src/pipeline2/api/dependencies.py - Health checks
src/pipeline2/api/health.py - Model manager
src/pipeline2/api/dependencies.py - Model registry
models/registry/models/qwenModel/metadata.json - Training job
src/pipeline2 - Schema and rules
src/pipeline2/api/dependencies.py - Database schema
configs/schema.json - Business rules
configs/business_rules.json
SQL generation
- Llama inference
src/pipeline2/inference/llama_engine.py - Prompt builder
src/pipeline2/inference/prompt_builder.py - Structured output parser
src/pipeline2/inference/structured_output.py
SQL execution
- SQL validator
src/pipeline2/sql/validator.py - SQL parser
src/pipeline2/sql/parser.py - SQL executor
src/pipeline2/sql/executor.py
Visualization
- Result profiler
src/pipeline2/visualization/profiler.py - Role detector
src/pipeline2/visualization/role_detector.py - Chart candidates
src/pipeline2/visualization/candidate_generator.py - Candidate scorer
src/pipeline2/visualization/scorer.py - Vega-Lite generator
src/pipeline2/visualization/vega_generator.py
Other components
- User
- Rate-limit Redis
- Query database
Connections 23
- User → Query input: enters query
frontend/src/components/QueryInput.jsx - Query input → Query and results UI: submits
frontend/src/App.jsx - Query and results UI → API routes: sends query
- API routes → Auth and rate limits: checks access
src/pipeline2/api/routes.py - Auth and rate limits → Rate-limit Redis: checks limits
- API routes → Health checks: routes health
src/pipeline2/api/routes.py - API routes → Model manager: loads model
src/pipeline2/api/routes.py - Model manager → Model registry: reads metadata
src/pipeline2/api/dependencies.py - API routes → Training job: starts job
src/pipeline2/api/routes.py - API routes → Schema and rules: gets schema
src/pipeline2/api/routes.py - Schema and rules → Database schema: loads schema
src/pipeline2/api/dependencies.py - Schema and rules → Business rules: loads rules
src/pipeline2/api/dependencies.py - API routes → Llama inference: generates SQL
src/pipeline2/api/routes.py - Llama inference → Prompt builder: builds prompt
src/pipeline2/inference/llama_engine.py - Llama inference → Structured output parser: parses output
src/pipeline2/inference/llama_engine.py - API routes → SQL validator: validates SQL
src/pipeline2/api/routes.py - SQL validator → SQL parser: parses SQL
src/pipeline2/sql/validator.py - API routes → SQL executor: executes SQL
src/pipeline2/api/routes.py - SQL executor → Query database: queries
- API routes → Vega-Lite generator: generates chart spec
src/pipeline2/api/routes.py - Query and results UI → Results view: renders results
frontend/src/App.jsx - Results view → Chart renderer: renders chart
frontend/src/components/ResultsView.jsx - Results view → Data table: renders table
frontend/src/components/ResultsView.jsx