# Featureform

> A virtual feature store that turns your existing data infrastructure into a feature store

- Category: Data & Labeling / Data Wrangling
- Language: Go
- Licence: MPL-2.0
- Repository: https://github.com/featureform/featureform
- Website: https://www.featureform.com
- Canonical page: https://ai-tldr.dev/tools/featureform/

## In short

Featureform is an open-source virtual feature store. It lets data scientists define, manage and serve the features their machine-learning models consume — values such as "a user's average purchase price" — without adopting a new storage system. It sits in the Data Wrangling category of the Data & Labeling tools and is open-source, written in Go and licensed MPL-2.0.

## Overview

Featureform is an open-source virtual feature store. It lets data scientists define, manage and serve the features their machine-learning models consume — values such as "a user's average purchase price" — without adopting a new storage system. Instead of holding the data itself, Featureform sits on top of the infrastructure a team already runs and orchestrates it to behave like a traditional feature store.

The core idea is that a feature's definition is normally scattered across a data source, transformation code, an inference store and a training store. Featureform lets you declare the feature once in its logical form, as Python resources — providers, sources, transformations, features, labels and training sets — and then drives the underlying systems to reach that desired state. The computation itself is offloaded to your existing engines, such as SQL in Postgres or PySpark, so the project describes itself as closer to a framework and workflow than an extra piece of data infrastructure.

Every registered resource is immutable and versioned through named variants, with metadata such as owner and lineage, so a team can share and reuse definitions without logic changing underneath them. Featureform also adds role-based access control, audit logs and dynamic serving rules for compliance, and it was built with embeddings in mind: vector databases can act as inference and training stores, and transformer models can be used as transformations so embedding tables are versioned and reproducible. It runs locally in Docker or on Kubernetes, the server is written in Go, and it is licensed under MPL-2.0.

## What it does

- Virtual feature store: orchestrates the databases, warehouses and compute you already run instead of replacing them
- Python definitions for providers, sources, SQL and DataFrame transformations, features, labels and training sets, applied with one CLI command
- Immutable, versioned resources with named variants, lineage and owner metadata for safe reuse across a team
- Serves features for inference from an online store such as Redis and streams training sets in batches for model training
- Built-in role-based access control, audit logs and dynamic serving rules for governance
- Native embeddings support: vector databases as inference and training stores, transformer models as transformations
- Runs from a single Docker container on a laptop to a Kubernetes deployment over heterogeneous cloud infrastructure

## Getting started

The Featureform docker quickstart starts the server plus demo Postgres and Redis containers, registers a fraud-detection example and serves it. These steps follow docs.featureform.com/deployment/quickstart-docker.

1. Install the Featureform CLI

   The CLI and Python client ship as one package on PyPI.

```bash
pip install featureform
```

2. Start Featureform in Docker

   The quickstart flag launches Featureform alongside example Postgres and Redis containers, then point the CLI at the local server.

```bash
featureform deploy docker --quickstart
export FEATUREFORM_HOST=localhost:7878
```

3. Define providers, sources and a transformation

   In `definitions.py`, register Postgres as the offline store and Redis as the inference store, register a source table and a SQL transformation over it.

```python
import featureform as ff

postgres = ff.register_postgres(
    name="postgres-quickstart",
    host="host.docker.internal",
    port="5432",
    user="postgres",
    password="password",
    database="postgres",
)

redis = ff.register_redis(
    name="redis-quickstart",
    host="host.docker.internal",
    port=6379,
)

transactions = postgres.register_table(
    name="transactions",
    table="transactions",
)

@postgres.sql_transformation()
def average_user_transaction():
    return "SELECT CustomerID as user_id, avg(TransactionAmount) " \
           "as avg_transaction_amt from {{transactions.default}} GROUP BY user_id"
```

4. Declare the feature, label and training set

   An entity class ties a feature and a label to a user; the training set joins them.

```python
@ff.entity
class User:
    avg_transactions = ff.Feature(
        average_user_transaction[["user_id", "avg_transaction_amt"]],
        type=ff.Float32,
        inference_store=redis,
    )
    fraudulent = ff.Label(
        transactions[["customerid", "isfraud"]], variant="quickstart", type=ff.Bool
    )

ff.register_training_set(
    "fraud_training",
    label=("fraudulent", "quickstart"),
    features=["avg_transactions"],
)
```

5. Apply the definitions

   Featureform orchestrates Postgres and Redis to materialise the resources; check the training set until it reports READY.

```bash
featureform apply quickstart/definitions.py --insecure
featureform get training-set fraud_training quickstart --insecure
```

6. Serve features and stream the training set

   The Python client fetches a feature for one entity at inference time and iterates over the training set in batches.

```python
from featureform import Client

client = Client(insecure=True)

user_feat = client.features([("avg_transactions", "quickstart")], {"user": "C1214240"})
print(user_feat)

dataset = client.training_set("fraud_training", "quickstart")
for i, batch in enumerate(dataset):
    print(batch)
    if i > 25:
        break
```

7. Tear down

   Stop the quickstart containers when you are done.

```bash
featureform stop docker
```

## When to use it

- Give a data-science team one shared, versioned catalogue of features and training sets instead of copies scattered across notebooks
- Serve the same feature definitions to an online model from Redis and to training jobs from the offline store, so training and inference stay consistent
- Add a feature-store layer on top of an existing Postgres, Spark or warehouse stack without migrating data into a new system
- Version and regenerate embedding tables by registering a transformer model as a transformation with a vector database as the store
- Enforce access rules, audit logs and region-specific serving rules on features for compliance
