premsql  by premAI-io

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

Created 2 years ago
455 stars

Top 65.5% 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

1 year ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by John Resig John Resig(Author of jQuery; Chief Software Architect at Khan Academy), Gabriel Almeida Gabriel Almeida(Cofounder of Langflow), and
10 more.

directus by directus

0.2%
36k
Database-powered backend for apps and AI agents
Created 13 years ago
Updated 22 hours ago
Feedback? Help us improve.