postgresml

postgresml/postgresml

Postgres with GPUs for ML/AI applications.

6.8k
Stars
365
Forks
155
Open issues
56
Watchers
Rust MITLast pushed Jul 1, 2025

Overview

PostgresML is a powerful PostgreSQL extension that allows machine learning operations to be run directly within the database, combining data storage and inference. It supports GPU acceleration, integration of large language models from Hugging Face, and includes RAG pipeline functions for text processing.

Categories

Tags

Similar tools

Install

cargo add postgresml

README

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.

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 Postgre