premsql  by premAI-io

Open-source library for local Text-to-SQL pipelines

created 1 year ago
372 stars

Top 77.3% on sourcepulse

GitHubView on GitHub
Project Summary

PremSQL provides a local-first, end-to-end framework for building secure Text-to-SQL pipelines. It empowers developers to create autonomous AI data analysis solutions by offering customizable components for database interaction, query generation, and evaluation, all while keeping data private.

How It Works

PremSQL employs a modular architecture, allowing users to integrate various components for different stages of the Text-to-SQL pipeline. It supports multiple connectors (PremAI, Ollama, HuggingFace, MLX, OpenAI) and offers customizable datasets, robust executors, and advanced generators. Key features include execution-guided decoding for SQL correction and fine-tuning capabilities (LoRA, QLoRA, full fine-tuning) to adapt models to specific databases. The framework also introduces agents for natural language database querying, analysis, and plotting, along with a self-hosted playground for interactive testing.

Quick Start & Requirements

  • Install via pip: pip install -U premsql
  • Requires Python 3.8+.
  • Supports SQLite, PostgreSQL, MySQL databases.
  • PremAI API key and Project ID are required for Text2SQLGeneratorPremAI.
  • Official Docs: https://github.com/premAI-io/premsql

Highlighted Details

  • Local-first approach ensures data privacy by avoiding third-party closed-source providers.
  • Supports multiple LLM connectors including Ollama and HuggingFace for local model deployment.
  • Includes a baseline agent capable of querying, analyzing, and plotting data from databases.
  • Offers a self-hosted playground for interactive testing and agent customization.

Maintenance & Community

  • Active development with recent releases including agents, playground, and Ollama support.
  • Prem-1B-SQL model has seen significant download growth on HuggingFace.
  • Community engagement encouraged via contributions and feedback.

Licensing & Compatibility

  • Licensed under the MIT License, permitting commercial use and closed-source linking.

Limitations & Caveats

  • The baseline agent's plotting capabilities are described as "simple charts."
  • Some components, like Text2SQLGeneratorPremAI, require specific API keys and project IDs.
  • The README mentions "more implementation variants will come in later versions" for agents, suggesting current agent functionality might be basic.
Health Check
Last commit

5 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
44 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.