top | item 47218215

ai.embed() and ai.classify() as IMMUTABLE Postgres functions. AI-coded for $127

2 points| dmonroy | 23 hours ago |insert.dev

1 comment

order

dmonroy|23 hours ago

TLDR: PostgreSQL extension that adds ai.embed() and ai.classify() as IMMUTABLE functions. Local ONNX inference, no API calls. Works in generated columns out of the box. ~117 MiB per backend ( connection pooler recommended). The design and constraints are human-driven; the implementation was AI-assisted under supervision. ~$127 in tokens spent.

GitHub: https://github.com/dmonroy/ai-native-pg

Post: https://insert.dev/immutable-ai-functions-in-postgres/

Try it:

docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=postgres ghcr.io/dmonroy/ai-native-pg:dev

Happy to discuss the IMMUTABLE decision, the ONNX stack, or the AI workflow.