Skip to content

PremSQL v0.1 | End-to-End Local-First Text-to-SQL Pipelines

Latest
Compare
Choose a tag to compare
@Anindyadeep Anindyadeep released this 10 Sep 09:20
· 3 commits to main since this release
065454a

We are excited to release the very first stable release of PremSQL. You can install PremSQL using PyPI

Check out our documentation to checkout details.

image

pip install -U premsql

PremSQL is an open-source library designed to help developers create secure, fully local Text-to-SQL solutions using small language models. It provides all the essential tools to build and deploy end-to-end Text-to-SQL pipelines with customizable components, making it ideal for secure, autonomous AI-powered data analysis.

Quick Start

from premsql.pipelines import SimpleText2SQLAgent
from premsql.generators import Text2SQLGeneratorHF
from premsql.executors import SQLiteExecutor

# Provide a SQLite file here or see documentation for more customization
dsn_or_db_path = "./data/db/california_schools.sqlite"

agent = SimpleText2SQLAgent(
    dsn_or_db_path=dsn_or_db_path,
    generator=Text2SQLGeneratorHF(
        model_or_name_or_path="premai-io/prem-1B-SQL",
        experiment_name="simple_pipeline",
        device="cuda:0",
        type="test"
    ),
)

question = "please list the phone numbers of the direct charter-funded schools that are opened after 2000/1/1"

response = agent.query(question)
response["table"]

Check out our documentation to checkout details.