feat: Enable static artifacts for feature server that can be used in Feature Transformations by franciscojavierarceo · Pull Request #5787 · feast-dev/feast · GitHub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**Warning**: This is an experimental feature. To our knowledge, this is stable, but there are still rough edges in the experience. Contributions are welcome!
## Overview
Static Artifacts Loading allows you to load models, lookup tables, and other static resources once during feature server startup instead of loading them on each request. These artifacts are cached in memory and accessible to on-demand feature views for real-time inference.
This feature optimizes the performance of on-demand feature views that require external resources by eliminating the overhead of repeatedly loading the same artifacts during request processing.
### Why Use Static Artifacts Loading?
Static artifacts loading enables data scientists and ML engineers to:
1. **Improve performance**: Eliminate model loading overhead from each feature request
2. **Enable complex transformations**: Use pre-trained models in on-demand feature views without performance penalties
3. **Share resources**: Multiple feature views can access the same loaded artifacts
4. **Simplify deployment**: Package models and lookup tables with your feature repository
Common use cases include:
- Sentiment analysis using pre-trained transformers models
- Text classification with small neural networks
- Lookup-based transformations using static dictionaries
- Embedding generation with pre-computed vectors
## How It Works
1. **Feature Repository Setup**: Create a `static_artifacts.py` file in your feature repository root
2. **Server Startup**: When `feast serve` starts, it automatically looks for and loads the artifacts
3. **Memory Storage**: Artifacts are stored in the FastAPI application state and accessible via global references
4. **Request Processing**: On-demand feature views access pre-loaded artifacts for fast transformations
## Example 1: Basic Model Loading
Create a `static_artifacts.py` file in your feature repository:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**Warning**: This is an experimental feature. To our knowledge, this is stable, but there are still rough edges in the experience.
Static artifacts loading allows you to load models, lookup tables, and other static resources once during feature server startup instead of loading them on each request. This improves performance for on-demand feature views that require external resources.
## Quick Example
Create a `static_artifacts.py` file in your feature repository:
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Enable static artifacts for feature server that can be used in Feature Transformations #5787
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
feat: Enable static artifacts for feature server that can be used in Feature Transformations #5787
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.