---
title: "database.build v2: Bring-your-own-LLM"
description: "database.build, Supabase's in-browser Postgres sandbox built on PGlite, now lets users bring any OpenAI-compatible LLM, with no login and no rate limits."
url: "https://swe.quest/articles/database-build-v2-bring-your-own-llm-b2a3b83eee7ef5a0"
canonical: "https://supabase.com/blog/database-build-v2"
source: "Supabase"
published: "2024-12-06"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 11
tags: ["postgres","llms","browsers","webassembly"]
---

# database.build v2: Bring-your-own-LLM

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2024-12-06, 11 min read, Announcement. Original: [https://supabase.com/blog/database-build-v2](https://supabase.com/blog/database-build-v2)

## Summary

database.build, Supabase's in-browser Postgres sandbox built on PGlite, now lets users bring any OpenAI-compatible LLM, with no login and no rate limits. Requests go straight from the browser to the provider. This works because most LLM APIs send CORS headers, and a service worker intercepts the Vercel AI SDK's /api/chat route, reading its BYO-LLM config from IndexedDB. Models need reliable tool calling, SQL knowledge and Chart.js knowledge, so gpt-4o is recommended; local Ollama models still struggle with tool calls, and Ollama buffers tool-call streams. The release also adds one-click deploys to Supabase by piping server-side pg\_dump over Live Share into pg\_restore, and replaces the tar.gz export with a WASM pg\_dump. Serverless PGlite was shelved because of its memory use and single-connection limit in multi-tenant setups and unreliable s3fs storage.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [WebAssembly](https://swe.quest/tags/webassembly.md) (Languages)

## Prerequisites

- PostgreSQL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- browser CORS
- service workers

## Keywords

database.build, PGlite, Vercel AI SDK, Ollama, pg\_dump, Supabase, service workers, OpenAI API

## Related posts

- [postgres.new: In-browser Postgres with an AI interface](https://swe.quest/articles/postgres-new-in-browser-postgres-with-an-ai-interface-55583d716a34d5b8.md): Supabase · 2024-08-12 · Medium · 11 min read · PostgreSQL, WebAssembly, LLMs, AI agents, Browsers
  database.build (formerly postgres.new) runs unlimited Postgres databases entirely in the browser via PGlite, a WASM build of Postgres, paired with GPT-4o that has full autonomy over the disposable database.
- [Web-based AI SQL Playground and connecting to Postgres from the browser](https://swe.quest/articles/web-based-ai-sql-playground-and-connecting-to-postgres-from-the-browser-fa7f4eccd9643a37.md): Neon · 2023-05-19 · Medium · 5 min read · PostgreSQL, LLMs, Serverless, JavaScript
  Neon's Postgres AI Playground connects to a Postgres database directly from the browser and uses OpenAI's gpt-3.5-turbo to turn natural-language prompts into SQL.
- [ChatGPT plugins now support Postgres & Supabase](https://swe.quest/articles/chatgpt-plugins-now-support-postgres-supabase-db9d10a95a8d96b9.md): Supabase · 2023-05-25 · Medium · 7 min read · RAG & retrieval, Vector search, PostgreSQL, LLMs
  Supabase contributed Postgres and Supabase datastore providers to OpenAI's ChatGPT Retrieval Plugin, storing text-embedding-ada-002 embeddings in pgvector.
- [Building an AI-powered ChatBot using Vercel, OpenAI, and Postgres](https://swe.quest/articles/building-an-ai-powered-chatbot-using-vercel-openai-and-postgres-4fd423473384581f.md): Neon · 2023-03-09 · Medium · 13 min read · RAG & retrieval, PostgreSQL, Vector search, LLMs, Serverless
  A ChatGPT-style documentation assistant (Ask Neon) is built by storing OpenAI text-embedding-ada-002 vectors in Postgres with pgvector, retrieving context by cosine distance, and feeding it to text-davinci-003 from a Vercel Edge Function.
- [AI Inference now available in Supabase Edge Functions](https://swe.quest/articles/ai-inference-now-available-in-supabase-edge-functions-9d09d3bcda534938.md): Supabase · 2024-04-16 · Medium · 5 min read · Serverless, Inference & serving, Vector search, LLMs
  Supabase Edge Functions gain a built-in Supabase.ai.Session API for running AI inference in a few lines of code, starting with gte-small embeddings for storage in pgvector and experimental, invite-only Llama and Mistral LLMs with streaming responses.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
