This document provides a practical guide to installing Feast, initializing feature repositories, and using the feast command-line interface (CLI) for common operations. It covers the basic workflow from installation through feature registration and materialization.
For detailed conceptual explanations of Feast's architecture, see System Architecture. For configuration details, see FeatureStore and Configuration. For production deployment guidance, see Running Feast in production.
Feast is distributed as a Python package and can be installed using pip:
The installation includes:
feast CLI toolfeast module)System Requirements:
Sources: README.md48-50 docs/getting-started/quickstart.md18-25
feast init CommandA feature repository is a directory containing feature definitions and configuration. Initialize a new repository using:
This creates the following structure:
my_project/
└── feature_repo/
├── feature_store.yaml # Configuration file
├── feature_definitions.py # Feature definitions
├── data/ # Sample data
│ ├── driver_stats.parquet
│ └── ...
└── test_workflow.py # Example workflow
Sources: sdk/python/feast/repo_operations.py491-568
| Component | Purpose |
|---|---|
feature_store.yaml | Configuration for registry, online store, offline store, and provider |
*.py files | Python modules containing Feast object definitions (Entities, FeatureViews, etc.) |
data/ | Local data sources (Parquet files for demo/development) |
.feastignore | Files/directories to exclude from parsing (similar to .gitignore) |
Sources: sdk/python/feast/repo_operations.py88-112 docs/getting-started/quickstart.md97-103
feature_store.yaml FileThe feature_store.yaml file is the central configuration file for a Feast deployment. A minimal configuration looks like:
| Parameter | Description | Example Values |
|---|---|---|
project | Unique identifier for the feature store | my_project |
registry | Registry configuration (path or dict) | data/registry.db or {type: "sql", path: "postgresql://..."} |
provider | Infrastructure provider | local, gcp, aws, azure |
online_store | Online store configuration | {type: "sqlite", path: "data/online.db"} |
offline_store | Offline store configuration | {type: "dask"} or {type: "bigquery"} |
entity_key_serialization_version | Entity key encoding version | 3 (recommended) |
Sources: sdk/python/feast/repo_config.py253-317 docs/getting-started/quickstart.md106-118
Sources: README.md45-164 sdk/python/feast/repo_operations.py
feast applyRegisters feature definitions with the registry and provisions infrastructure (online store tables).
Usage:
What it does:
.feastignore patterns)Apply Workflow Diagram:
Key Functions:
parse_repo(): Discovers Feast objectsapply_total_with_repo_instance(): Main apply logicFeatureStore.plan(): Computes diffsFeatureStore._apply_diffs(): Applies changesSources: sdk/python/feast/repo_operations.py223-247 sdk/python/feast/feature_store.py944-1080
feast materializeLoads feature values from the offline store into the online store for serving.
Usage:
Examples:
Materialization Process:
Key Components:
| Component | File Path | Description |
|---|---|---|
materialize() | sdk/python/feast/feature_store.py1362-1481 | Main materialization method |
materialize_incremental() | sdk/python/feast/feature_store.py1483-1552 | Incremental materialization |
_get_feature_views_to_materialize() | sdk/python/feast/feature_store.py728-793 | Filters views for materialization |
materialize_single_feature_view() | sdk/python/feast/infra/provider.py222-246 | Provider interface for materialization |
Sources: README.md111-134 sdk/python/feast/feature_store.py1362-1552
feast serveStarts a feature server for serving online features via HTTP/gRPC.
Usage:
Feature Server Architecture:
Key Endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/get-online-features | POST | Retrieve features for inference |
/push | POST | Push streaming feature values |
/materialize | POST | Trigger materialization |
/materialize-incremental | POST | Trigger incremental materialization |
Sources: sdk/python/feast/feature_server.py docs/reference/feature-servers/python-feature-server.md
feast uiLaunches the web UI for browsing the feature registry (experimental).
Usage:
Web UI Components:
Features:
Sources: README.md63-68 docs/SUMMARY.md161
| Command | Purpose |
|---|---|
feast teardown | Removes all infrastructure (tables, etc.) |
feast registry-dump | Outputs registry contents as JSON |
feast plan | Dry-run of feast apply (shows what would change) |
feast --help | Shows all available commands |
Sources: sdk/python/feast/repo_operations.py461-479
While the CLI is convenient for common operations, the Python SDK provides programmatic access to all Feast functionality.
Key Methods:
| Method | Purpose | Reference |
|---|---|---|
apply() | Register feature definitions | sdk/python/feast/feature_store.py944-1080 |
materialize() | Load features to online store | sdk/python/feast/feature_store.py1362-1481 |
get_historical_features() | Get training data | sdk/python/feast/feature_store.py1835-2011 |
get_online_features() | Get online features | sdk/python/feast/feature_store.py2013-2189 |
list_feature_views() | List feature views | sdk/python/feast/feature_store.py366-381 |
get_feature_view() | Get specific feature view | sdk/python/feast/feature_store.py515-531 |
Sources: sdk/python/feast/feature_store.py105-220 sdk/python/feast/feature_store.py124-169
When you run feast apply, Feast scans your repository for Python objects:
Discovered Object Types:
Entity - Entity definitionsFeatureView - Batch feature viewsStreamFeatureView - Streaming feature viewsOnDemandFeatureView - On-demand transformationsDataSource - Data source definitionsFeatureService - Feature service definitionsPermission - Permission definitionsSources: sdk/python/feast/repo_operations.py114-220 sdk/python/feast/repo_operations.py88-112
Key CLI Functions:
| Function | Location | Purpose |
|---|---|---|
create_feature_store() | sdk/python/feast/repo_operations.py412-429 | Creates FeatureStore instance for CLI |
cli_check_repo() | sdk/python/feast/repo_operations.py481-488 | Validates repository structure |
apply_total() | sdk/python/feast/repo_operations.py432-459 | Executes apply operation |
init_repo() | sdk/python/feast/repo_operations.py491-568 | Initializes new repository |
is_valid_name() | sdk/python/feast/repo_operations.py570-574 | Validates project names |
Sources: sdk/python/feast/repo_operations.py412-580
Configuration Precedence:
config parameter to FeatureStore()fs_yaml_file parameterfeature_store.yaml in repo_pathFEATURE_STORE_YAML_ENV_NAMEDefault Values:
| Parameter | Default Value |
|---|---|
provider | "local" |
offline_store | "dask" |
online_store | "sqlite" |
batch_engine | "local" |
entity_key_serialization_version | 3 |
Sources: sdk/python/feast/repo_config.py318-364 sdk/python/feast/feature_store.py124-161
This document covered the essential workflow for getting started with Feast:
pip install feastfeast initfeast applyfeast materialize or feast materialize-incrementalfeast serve or the Python SDKThe Feast CLI provides a convenient interface for common operations, while the Python SDK (FeatureStore class) offers programmatic access for integration into ML pipelines and applications.
Sources: README.md45-164 docs/getting-started/quickstart.md sdk/python/feast/feature_store.py105-289
Refresh this wiki
This wiki was recently refreshed. Please wait 3 days to refresh again.