postgresml
App Listed Dormant
Postgres with GPUs for ML/AI apps.
- Downloads
- 915
- Dependents
- Not applicable
- Stars
- 6,830
- Forks
- 363
- Contributors
- 45
- Commits
- 1,814
- Latest release
- 1.1.1 ·
About
Postgres + GPUs for ML/AI applications.
| Documentation | Blog | Discord |
Why do ML/AI in Postgres?
Data for ML & AI systems is inherently larger and more dynamic than the models. It's more efficient, manageable and reliable to move models to the database, rather than constantly moving data to the models.
- Getting started
- PostgresML Cloud
- Self-hosted
- Ecosystem
- Large Language Models
- Hugging Face
- OpenAI and Other Providers
- RAG
- Chunk
- Embed
- Rank
- Transform
- Machine Learning
Architecture
PostgresML is a powerful Postgres extension that seamlessly combines data storage and machine learning inference within your database. By integrating these functionalities, PostgresML eliminates the need for separate systems and data transfers, enabling you to perform ML operations directly on your data where it resides.
Read the full README
Features at a glance
- In-Database ML/AI: Run machine learning and AI operations directly within PostgreSQL
- GPU Acceleration: Leverage GPU power for faster computations and model inference
- Large Language Models: Integrate and use state-of-the-art LLMs from Hugging Face
- RAG Pipeline: Built-in functions for chunking, embedding, ranking, and transforming text
- Vector Search: Efficient similarity search using pgvector integration
- Diverse ML Algorithms: 47+ classification and regression algorithms available
- High Performance: 8-40X faster inference compared to HTTP-based model serving
- Scalability: Support for millions of transactions per second and horizontal scaling
- NLP Tasks: Wide range of natural language processing capabilities
- Security: Enhanced data privacy by keeping models and data together
- Seamless Integration: Works with existing PostgreSQL tools and client libraries
Getting started
The only prerequisites for using PostgresML is a Postgres database with our open-source pgml extension installed.
PostgresML Cloud
Our serverless cloud is the easiest and recommend way to get started.
Sign up for a free PostgresML account. You'll get a free database in seconds, with access to GPUs and state of the art LLMs.
Self-hosted
If you don't want to use our cloud you can self host it.
docker run \
-it \
-v postgresml_data:/var/lib/postgresql \
-p 5433:5432 \
-p 8000:8000 \
ghcr.io/postgresml/postgresml:2.10.0 \
sudo -u postgresml psql -d postgresml
For more details, take a look at our Quick Start with Docker documentation.
Ecosystem
We have a number of other tools and libraries that are specifically designed to work with PostgreML. Remeber PostgresML is a postgres extension running inside of Postgres so you can connect with psql and use any of your favorite tooling and client libraries like psycopg to connect and run queries.
PostgresML Specific Client Libraries:
- Korvus - Korvus is a Python, JavaScript, Rust and C search SDK that unifies the entire RAG pipeline in a single database query.
- postgresml-django - postgresml-django is a Python module that integrates PostgresML with Django ORM.
Recommended Postgres Poolers:
- pgcat - pgcat is a PostgreSQL pooler with sharding, load balancing and failover support.
Large language models
PostgresML brings models directly to your data, eliminating the need for costly and time-consuming data transfers. This approach significantly enhances performance, security, and scalability for AI-driven applications.
By running models within the database, PostgresML enables:
- Reduced latency and improved query performance
- Enhanced data privacy and security
- Simplified infrastructure management
- Seamless integration with existing database operations
Hugging Face
PostgresML supports a wide range of state-of-the-art deep learning architectures available on the Hugging Face model hub. This integration allows you to:
- Access thousands of pre-trained models
- Utilize cutting-edge NLP, computer vision, and other AI models
- Easily experiment with different architectures
OpenAI and other providers
While cloud-based LLM providers offer powerful capabilities, making API calls from within the database can introduce latency, security risks, and potential compliance issues. Currently, PostgresML does not directly support integration with remote LLM providers like OpenAI.
RAG
PostgresML transforms your PostgreSQL database into a powerful vector database for Retrieval-Augmented Generation (RAG) applications. It leverages pgvector for efficient storage and retrieval of embeddings.
Our RAG implementation is built on four key SQL functions:
- Chunk: Splits text into manageable segments
- Embed: Generates vector embeddings from text using pre-trained models
- Rank: Performs similarity search on embeddings
- Transform: Applies language models for text generation or transformation
For more information on using RAG with PostgresML see our guide on Unified RAG.
Chunk
The pgml.chunk function chunks documents using the specified splitter. This is typically done before embedding.
pgml.chunk(
splitter TEXT, -- splitter name
text TEXT, -- text to embed
kwargs JSON -- optional arguments (see below)
)
See pgml.chunk docs for more information.
Embed
The pgml.embed function generates embeddings from text using in-database models.
pgml.embed(
transformer TEXT,
"text" TEXT,
kwargs JSONB
)
See pgml.embed docs for more information.
Rank
The pgml.rank function uses Cross-Encoders to score sentence pairs.
This is typically used as a re-ranking step when performing search.
pgml.rank(
transformer TEXT,
query TEXT,
documents TEXT[],
kwargs JSONB
)
Docs coming soon.
Transform
The pgml.transform function can be used to generate text.
SELECT pgml.transform(
task => TEXT OR JSONB, -- Pipeline initializer arguments
inputs => TEXT[] OR BYTEA[], -- inputs for inference
args => JSONB -- (optional) arguments to the pipeline.
)
See pgml.transform docs for more information.
See our Text Generation guide for a guide on generating text.
Machine learning
Some highlights:
- 47+ classification and regression algorithms
- 8 - 40X faster inference than HTTP based model serving
- Millions of transactions per second
- Horizontal scalability
Training a classification model
Training
SELECT * FROM pgml.train(
'Handwritten Digit Image Classifier',
algorithm => 'xgboost',
'classification',
'pgml.digits',
'target'
);
Inference
SELECT pgml.predict(
'My Classification Project',
ARRAY[0.1, 2.0, 5.0]
) AS prediction;
NLP
The pgml.transform function exposes a number of available NLP tasks.
Available tasks are:
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- Has Python bindings
- pgml needs Python only with feature python
- License
- MIT
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
Postgres with GPUs for ML/AI apps. Python bindings |
915 downloads over 30 days | Not applicable | 6,830 | 1.1.1 | GPU support unknown | No native code found | MIT |
|
tch-rs Featured
Rust wrappers for the PyTorch C++ api (libtorch). Python bindings Also in Run and serve models. |
1,190,464 downloads over 30 days | 124 | 5,518 | 0.26.0 | CUDA | Binds native code: tch, torch-sys. Build uses a native toolchain: cc | Apache-2.0 OR MIT |
|
mlx-rs Featured
Unofficial rust wrapper for Apple's mlx machine learning library. Also in Run and serve models. |
33,398 downloads over 30 days | 36 | 389 | 0.34.0 | Metal | Binds native code: mach-sys, mlx, mlx-sys. Build uses a native toolchain: bindgen, cc, cmake | Apache-2.0 OR MIT |
|
aprender Listed
Next-generation ML framework in pure Rust — `cargo install aprender` for the `apr` CLI Also in Train models. |
15,442 downloads over 30 days | 31 | 140 | 0.72.3 | CUDA, WebGPU | Binds native code: libsqlite3-sys, zstd-sys, tree-sitter (feature full), alsa-sys (feature audio-alsa), nvml-wrapper-sys (feature nvml) and 1 more. Build uses a native toolchain: bindgen (feature bindgen) | MIT |
|
Ergonomic auto differentiation in Rust, with pytorch like apis. Also in Train models. |
2,369 downloads over 30 days | 4 | 1,944 | 0.13.0 | CUDA | No native code found | Apache-2.0 OR MIT |
|
boostr Listed
ML framework on numr for training and inference on CPU, CUDA and WebGPU: attention, quantization, inference scheduling and distributed execution. Models include LLaMA, Mamba2, Qwen3.5, Whisper, Kokoro, VITS, VoxCPM2, Silero VAD, CLAP and super-resolution. Loads SafeTensors and GGUF. Also in Run and serve models. |
1,265 downloads over 30 days | 7 | 20 | 0.11.2 | CUDA, WebGPU | Binds native code: ring (feature distributed) | Apache-2.0 |
All projects in Run and serve modelsAll projects in Text, embeddings and searchAll projects in Train models
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- The project is dormant and not finished. Dormancy rule
What else the check found
- The last activity is on 1 Jul 2025, 496 days ago. That reaches the 365 days the rules expect, so the project is dormant. Dormancy rule
- The oldest outside issue waits 881 days for a reply, past the limit of 270. No maintainer replied in 365 days. Rot signals rule
Not measured: Unpatched vulnerabilities past the grace window.
Exact rules: Listed, Featured app. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: app: E = 365 daysdormancy: last activity 2025-07-01, 496 days ago, E = 365: dormantrot: oldest unanswered issue 881 days (limit 270), no maintainer reply in 365 daysfeatured: not featured: dormant and not stablelisted: listed: no archive, new or featured rule applies
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the GitHub repository description
- crates.io database dump, fetched
- GitHub releases, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption0 binary downloads per release4 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | Not measured | Yes | ||
| New dependents (365 days) | Not measured | Yes | ||
| Peak active dependents | Not measured | Yes | ||
| Active dependents as a share of the peak | Not measured | Yes | ||
| Binary downloads per release | 0 | GitHub releases | Yes |
MaintenanceLatest human commit: 16 months ago4 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2025-07-01 | GitHub repository | Yes | |
| Latest release | 2025-01-16 | GitHub releases | Yes | |
| First release | 2024-06-03 | crates.io database dump | Yes | |
| Latest version | 1.1.1 | crates.io database dump | No | |
| Days the oldest outside issue waits for a reply | 881 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 0 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | No | |
| Published docs | Not measured | Yes | ||
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityNot measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | Not measured | Yes | ||
| RustSec unmaintained advisory | Not measured | Yes | ||
| Deprecation notice | Not measured | Yes | ||
| Deprecated requirement | Not measured | Yes |
Distribution2 releases, 915 downloads over 30 days6 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 2 | crates.io database dump | No | |
| Downloads over 30 days | 915 | crates.io database dump | No | |
| Binary downloads over the last 3 releases | 0 | GitHub releases | Yes | |
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | Not measured | Yes | ||
| Crate deleted from crates.io | Not measured | Yes |
Repository6,830 stars, 363 forks, 45 contributors, 1,814 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 6830 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 363 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 45 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 1814 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | MIT | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | Has Python bindings: pgml needs Python only with feature python | crates.io database dump | No | |
| Crates that depend on a listed crate directly | Not measured | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.