---
title: "postgresml"
type: "tool"
slug: "postgresml-postgresml"
canonical_url: "https://www.graphcanon.com/tools/postgresml-postgresml"
github_url: "https://github.com/postgresml/postgresml"
homepage_url: "https://postgresml.org"
stars: 6808
forks: 365
primary_language: "Rust"
license: "MIT"
categories: ["inference-serving", "model-training", "llm-frameworks"]
tags: ["clustering", "embeddings", "ai", "artificial-intelligence", "forecasting", "approximate-nearest-neighbor-search", "classification", "ann"]
updated_at: "2026-07-07T19:51:16.943932+00:00"
---

# postgresml

> Postgres with GPUs for ML/AI applications.

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.

## Facts

- Repository: https://github.com/postgresml/postgresml
- Homepage: https://postgresml.org
- Stars: 6,808 · Forks: 365 · Open issues: 155 · Watchers: 56
- Primary language: Rust
- License: MIT
- Last pushed: 2025-07-01T12:26:02+00:00

## Categories

- [Inference & Serving](/categories/inference-serving.md)
- [Model Training](/categories/model-training.md)
- [LLM Frameworks](/categories/llm-frameworks.md)

## Tags

clustering, embeddings, ai, artificial-intelligence, forecasting, approximate nearest neighbor search, classification, ann

## Related tools

- [ollama](/tools/ollama-ollama.md) - Get up and running with Kimi-K2.6, GLM-5.1, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models. (★ 175,664)
- [prompts.chat](/tools/f-prompts-chat.md) - The world's largest open-source prompt library for AI (★ 165,025)
- [transformers](/tools/huggingface-transformers.md) - 🤗 Transformers: the model-definition framework for state-of-the-art machine learning models (★ 162,350)
- [open-webui](/tools/open-webui-open-webui.md) - User-friendly AI Interface (Supports Ollama, OpenAI API, ...) (★ 144,582)
- [awesome-llm-apps](/tools/shubhamsaboo-awesome-llm-apps.md) - 100+ AI Agent & RAG apps you can actually run — clone, customize, ship. (★ 116,702)
- [LLMs-from-scratch](/tools/rasbt-llms-from-scratch.md) - Implement a ChatGPT-like LLM in PyTorch from scratch (★ 98,715)
- [TradingAgents](/tools/tauricresearch-tradingagents.md) - TradingAgents: Multi-Agents LLM Financial Trading Framework (★ 91,619)
- [caveman](/tools/juliusbrussee-caveman.md) - Cuts 65% of tokens in AI coding agent responses. (★ 86,189)

## README (excerpt)

```text
<div align="center">
   <picture>
     <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/5d5510da-6014-4cf3-849f-566050e053da">
     <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/aea1c38a-15bf-4270-8365-3d5e6311f5fc">
     <img alt="Logo" src="" width="520">
   </picture>
</div>

<p align="center">
   <p align="center"><b>Postgres + GPUs for ML/AI applications.</b></p>
</p>

<p align="center">
| <a href="https://postgresml.org/docs/"><b>Documentation</b></a> | <a href="https://postgresml.org/blog"><b>Blog</b></a> | <a href="https://discord.gg/DmyJP3qJ7U"><b>Discord</b></a> |
</p>

---
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.</b></p>
</p>

- [Getting started](#getting-started)
    - [PostgresML Cloud](#postgresml-cloud)
    - [Self-hosted](#self-hosted)
    - [Ecosystem](#ecosystem)
- [Large Language Models](#large-language-models)
    - [Hugging Face](#hugging-face)
    - [OpenAI and Other Providers](#openai)
- [RAG](#rag)
    - [Chunk](#chunk)
    - [Embed](#embed)
    - [Rank](#rank)
    - [Transform](#transform)
- [Machine Learning](#machine-learning)

## Architecture

<div align="center">
   <picture>
     <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/e27f8bda-1fe6-49f8-b9d8-ef563e0150e5">
     <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/09bbed94-b73f-447b-95d9-2d4a7727c3aa">
     <img alt="Logo" src="" width="784">
   </picture>
</div>

<div align="center">
<b>PostgresML is a powerful Postgres extension that seamlessly combines data storage and machine learning inference within your database</b>. 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.
</div>

## 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](https://postgresml.org/signup). 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](https://postgresml.org/docs/open-source/pgml/developers/quick-start-with-docker) documentation.

## Ecosystem

We have a number of other tools and libraries that are specifically designed to work with Postgre
```

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/tools/postgresml-postgresml`](/api/graphcanon/tools/postgresml-postgresml)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
