Skip to content

Marlex31/ChatDB-gallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

ChatDB

A Text-to-SQL interface

Picture of the initial frontend

Description

Given an SQL database, ChatDB dynamically generates comprehensive prompts that contain information about your database schema and the meaning of each column.

This information is then used by an LLM to generate SQL to extract the relevant data, and return it in a interactive graphic or text summary.

Gallery

Query: "Graph a line chart of beer sales in the 2023-24 period."

Beer sales graph

Query: "At what hours do most beer sales usually occur?"

Beer sales by hour

Query: "Using 2023 beer sales, what do you forecast future sales will look like?"

Forecasting beer sales

How to run

Pre-requisites

A PostgreSQL connection is required.

You can instantiate the inference llm class with different services or LLMs which require (see docstring for more):

  • OpenAI API key in environment variable OPENAI_API_KEY (see docs)

  • path to local .gguf file

  • HuggingFace🤗 model link

With frontend

Dev environment

fastapi dev main_api.py

Production

fastapi run main_api.py

Open http://127.0.0.1:8000/

CLI interface

python main.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors