|
| 1 | +# Accelerating Text-to-SQL Inference with Vanna and NVIDIA AI Endpoints |
| 2 | + |
| 3 | +This repository demonstrates how to optimize Vanna's open-source text-to-SQL pipeline using NVIDIA NIM and NeMo Retriever for faster and more efficient analytics. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +This project showcases how to leverage NVIDIA's AI endpoints to significantly accelerate text-to-SQL generation with Vanna, enabling faster natural language queries on databases. |
| 10 | + |
| 11 | +## Features |
| 12 | + |
| 13 | +- Integration with NVIDIA NIM for LLM-based SQL generation |
| 14 | +- NeMo Retriever for efficient semantic search |
| 15 | +- Training Vanna on domain specific data |
| 16 | + |
| 17 | +## Requirements |
| 18 | + |
| 19 | +- Python 3.10+ |
| 20 | +- NVIDIA API key (get yours at [https://build.nvidia.com/](https://build.nvidia.com/)) |
| 21 | +- Required Python packages: |
| 22 | + - vanna |
| 23 | + - langchain |
| 24 | + - langchain-nvidia-ai-endpoints |
| 25 | + - pymilvus[model] |
| 26 | + - pandas |
| 27 | + - numpy |
| 28 | + - sqlite3 |
| 29 | + - openai |
| 30 | + - kagglehub |
| 31 | + |
| 32 | +## Getting Started |
| 33 | + |
| 34 | +1. Clone this repository |
| 35 | +2. Install the required packages |
| 36 | +3. Set your NVIDIA API key |
| 37 | +4. Run the Jupyter notebook `vanna_with_NVIDIA.ipynb` |
| 38 | + |
| 39 | +## Dataset |
| 40 | + |
| 41 | +The notebook uses Steam game datasets from Kaggle: |
| 42 | +- [Steam Games Dataset](https://www.kaggle.com/datasets/fronkongames/steam-games-dataset/data) |
| 43 | +- [Games on Steam](https://www.kaggle.com/datasets/sujaykapadnis/games-on-steam/) |
| 44 | + |
| 45 | +After preprocessing, the data is organized into three tables: |
| 46 | +- `games`: Game information including name, price, reviews, etc. |
| 47 | +- `categories`: Game categories |
| 48 | +- `tags`: User-defined tags and their frequencies |
| 49 | + |
| 50 | +## Pipeline |
| 51 | + |
| 52 | +The NVIDIA-accelerated Vanna pipeline consists of: |
| 53 | +1. Data preparation and ingestion |
| 54 | +2. Vector DB setup with Milvus |
| 55 | +3. Integration with NVIDIA LLM (Llama 3.1) and embedding models |
| 56 | +4. SQL database setup and training |
| 57 | +5. Natural language query to SQL conversion |
| 58 | + |
| 59 | +## Example Queries |
| 60 | + |
| 61 | +The notebook demonstrates several example queries: |
| 62 | +- "Which 5 games have the most positive reviews and how many?" |
| 63 | +- "Which indie game has the biggest player base?" |
| 64 | +- "Which category has the maximum number of gamers and how many?" |
| 65 | + |
| 66 | +## License |
| 67 | + |
| 68 | +This project is licensed under the MIT License - see the LICENSE file for details. |
0 commit comments