postllm
postllm · postllm: PostgreSQL-native access to OpenAI-compatible and local LLM runtimes
Overview
PostgreSQL · 13, 14, 15, 16, 17, 18
Usage
Sources:
- Official extension control file
- Official upstream documentation
- Official API reference
- Official configuration guide
postllm 0.1.0 makes hosted and local LLM workflows callable from PostgreSQL SQL. It covers chat and completion, embeddings, chunking, retrieval and reranking, plus profiles, secrets, role permissions, model aliases, and outbound-host policy. Inference runs synchronously inside database backends.
Core Workflow
Use postllm.runtime_discover() and postllm.runtime_ready() before serving traffic. postllm.settings() and postllm.capabilities() describe the active environment. The API reference groups message builders, generation functions, structured outputs and tools, embeddings, postllm.ingest_document, reranking, hybrid ranking, and RAG helpers.
Governance and Operations
Use the postllm.profile*, postllm.secret*, postllm.permission*, and postllm.model_alias* families instead of scattering configuration through application SQL. Restrict http_allowed_hosts and http_allowed_providers. Model calls can send prompts, rows, documents, and images outside PostgreSQL and can hold a backend while waiting for network or local inference; account for privacy, authorization, timeouts, retries, cost, provider retention, and transaction duration before production use.