Video yükleniyor...
Video Yüklenemedi
We open sourced Postgres LLM many developer AI work flows look like this: upsert row -> api call -> process with ai -> update row so we thought what if you can run LLMs right in your database with all the primitives and auth - fully async, doesn't block... show more
60,425 görüntüleme • 5 ay önce •via X (Twitter)
25 Yorum

Full blog:

This is 🔥

this is clean. the upsert -> api call -> process -> update pattern is literally every AI workflow i've built. putting the LLM call inside the db layer removes so much plumbing. no more orchestrating between supabase and an external service. async + any model is the right call too

uhh finally someone built it And it's yoeven

Interesting architecture. Running LLMs inside Postgres means your row data flows directly into prompts. Worth thinking about which columns get passed to the model and whether PII redaction lives at the DB layer or above it.

@AISGateway Great point. You can define which columns from your row flow into your prompt, only selected columns will be seen but the prompt. So you can architect it accordingly

Moving LLM calls into the DB layer is a clever inversion. Eliminates the app-orchestration round trip and keeps the logic where the data already lives. How does it handle provider rate limits at query scale?

There's a batching queue system built in which you can adjust according to the rate limits you have

@MekongWhisper

This is interesting something i would love to use, but doesn't supabase already have this?

Now it does ;)

dope!

Baking the AI natively into Postgres triggers gives you perfect ACID compliance and zero middleware. Postgres isn't an async HTTP client. If you insert 10,000 rows at once, pg_cron will fire 10,000 HTTP requests to the LLM. You'll exhaust the database worker pool waiting for inference. Edge workers should poll the DB.

It's batched by default by chunks of 20, you can increase it or reduce it based on your compute. You could set up edge workers if you want but it defeats the purpose since it leaves the Postgres word and goes back to calling a server.

Batching by 20 reduces the request count, but it doesn't solve the core scalability limit: inference latency.

YES finally ... super excited! was thinking about this for a while similar like cloudflare is going for a fullstack agent in a box with batteries included (state, db, etc) this sounds like the missing piece for a full agent runtime in a "supabase box"

yikes

Well idk what to tell you, more and more app logic between your database, server and even frontend is more shared than ever before. Authorisation used to be server logic, now we have RLS. The implementation does matters, give it a try, you might like it :)

add rls is an antipattern to my list

Ok boomer

ah, Slop Combinator invested in you? That explains it good luck kid

@dshukertjr Running LLMs inside Postgres could slash API overhead for real time product enrichment. How do you handle concurrency when multiple order rows trigger AI processing at the same time?

@supabase Yoooo very cool 👀

"Claude integrate this somehow into our supabase projects and make no mistakes"

oh this is exactly the piece i've been wanting. my pgvector pipeline is mostly upsert plus external call plus update row, running it inline kills the round trip
