16

I have a SQL database, and a schema document that goes with it, is there any kind of AI I can self host and train it on this data?

The goal would be to ask it simple questions like “from which table in [dbname] can I find a list of products I’ve sold in the last x days”

Would be even better if I could ask it to write some queries to find exactly what I’m after.

What kind of hardware would I need to run something like this, if it exists?

all 3 comments
sorted by: hot top controversial new old
[-] 1stTime4MeInMCU@mander.xyz 4 points 1 year ago

Vector embeddings with ChromaDB. Basically you pre compute the word embeddings of every row / table / whatever granularity you want and then stick that into a vector DB. Then you do an embedding computation of your query and compare similarity. You can either return the table / row / whatever you want that’s most similar (“semantic search”) or you use that as context for an LLM (“RAG”)

[-] sinokon@feddit.de 2 points 1 year ago* (last edited 1 year ago)

You could use something like https://huggingface.co/defog/sqlcoder-34b-alpha / https://github.com/defog-ai/sqlcoder however I haven’t used this one myself but it builds up on CodeLlama model so the quality should be good. I haven’t seen other models specifically for SQL queries yet.

Edit: it includes all the hardware requirements and some demo examples in the links

this post was submitted on 01 Dec 2023
16 points (94.4% liked)

Selfhosted

40359 readers
295 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS