The Fifth Elephant 2024 Annual Conference

India’s most prestigious Big Data, Machine learning & Data Science conference



Subhom Mitra

@subhom_mitra Author

Abhijeet Kumar

@abhijeet3922 Author

Chat with Tables: Query tabular data in English using self-hosted Large Language Models

Submitted May 15, 2024

Business users and non-technical professionals often need to quickly analyse or transform tabular data in spreadsheets for ad hoc business intelligence. However, they might lack the necessary programming knowledge to do so themselves and therefore must reach out to a data analyst. Such unexpected delays have the potential to incur huge opportunity costs for time-sensitive business decisions which must be informed by accurate analysis of data.

Generative AI powered by Large Language Models (LLMs) is being used to create novel text, images, and even videos. LLMs specialising in generating code are already being used in enterprise solutions like GitHub Copilot, Gemini Code Assist by Google, watsonx by IBM, and Amazon Q Developer (previously Amazon CodeWhisperer) to boost productivity for developers and programmers. Along the same lines, there now exist LLMs specialising in generating Structured Query Language (SQL), which is widely used across enterprise domains to manage databases and analyse and transform tabular data.

Workshop Objective

In this workshop we demonstrate how to create a web application from scratch using Streamlit and Ollama which can be used to analyse and query CSV files using natural language and the power of LLMs.


  1. Quick overview of the workshop
  2. Demo of the application
  3. Discussion on running LLMs locally for data privacy
  4. Hands-on: Setting up Ollama model server
  5. Hands-on: Setting up Streamlit and building quick interactive front-end applications
  6. Hands-on: Pipeline for using natural language prompts to transform tabular data using CSV files
  7. Hands-on: Data processing techniques like Prompt Pruning and Correcting LLM Hallucinations using Static Analysis with sqlglot
  8. Discussion on how to create generic “Chat with X” capabilities

Recommended Reading

We will be using the following tools during the workshop. Participants might find it useful to make themselves faimilar with these prior to the workshop.

  1. ollama
  2. sqlglot
  3. Model Quantisation
  4. streamlit

Intended Audience

This workshop is intended for data enginners, data scientists, and researchers with basic Python experience who are working on Generative AI use-cases and want to leverage enterprise data. This might also interest business analysts or business consumers who require data querying and analysis services regularly.

Overall, any professional with at least some experience with Python programming who is interested in getting started with Gen AI will stand to benefit from this workshop since it covers both the end-to-end data pipeline as well how to prepare a demo-worthy front-end user interface.


  1. How to run LLMs locally or within your organisation network using Ollama
  2. How to quickly develop interactive web applications using Streamlit
  3. How to analyse tabular data in CSV format using English language queries
  4. How to create “Chat with X” applications for other data formats

Additional Reading

Here are some links to open-source and proprietary products currently available which leverage LLMs to generate SQL and power database interactions.

  1. Vanna: an MIT-licensed open-source Python RAG (Retrieval-Augmented Generation) framework for SQL generation and related functionality.
  2. Dataherald: a natural language-to-SQL engine built for enterprise-level question answering over relational data.
  3. ChatDB: build dashboards for your database with AI.
  4. DB-GPT: an open source AI native data app development framework for building infrastructure in the field of large models.


{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Hybrid Access Ticket

Hosted by

All about data science and machine learning

Supported by

Gold Sponsor

Atlassian unleashes the potential of every team. Our agile & DevOps, IT service management and work management software helps teams organize, discuss, and compl

Silver Sponsor