{"repo":"InterfazeAI/postgres-llm","free":true,"listed":false,"github":"https://github.com/InterfazeAI/postgres-llm","clone":"git clone https://github.com/InterfazeAI/postgres-llm.git","description":"A dynamic Postgres trigger function that runs an LLM request directly in your database for use cases like translation, classification, summarization and more","language":"PLpgSQL","stars":56,"topics":["ai","llms","postgresql","sql","supabase"],"license":null,"category":"databases-storage","readme_excerpt":"Postgres LLM Read the full tutorial: https://interfaze.ai/blog/run-llms-inside-postgres A dynamic Postgres trigger function that runs an LLM request directly in your database for use cases like translation, classification, summarization and more. Features - Async execution - non-blocking, model runs async - Use any Chat completion API compatible LLM - Reference context from any column within the same row - Automatically update multiple target columns - Built-in retry logic with configurable max attempts Postgres requirements: - http extension - hstore extension - pg cron extension Quick Start 1. Run init.sql - Copy the Postgres setup code from init.sql - Replace the API KEY , BASE URL and MODEL NAME with your provider of choice. Defaults to Interfaze. - Execute it in your database. 2. Add a trigger Example table schema: Example trigger for sentiment analysis: 3. Insert a new row: The INSERT returns immediately. The sentiment column will be populated asynchronously by the pg cron worker within seconds. Call LLM function parameters Parameter Description Required ---------------- ---------------------------------------------------------------------------------------------------------------- -------- prompt The prompt to use for the LLM. Supports {column name} placeholders that get replaced with values from the row. Yes target column(s) One or more columns to update with the LLM result. Pass additional column names as extra arguments. Yes The function uses JSON schema structured ","default_branch":null,"files":null,"tree":[],"storefront":"/r/InterfazeAI","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/InterfazeAI/postgres-llm/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}