This release is a pre-release and may not be stable for production use.
Hyped Serve Extension
Serve hyped data flows as REST APIs
Installation
You can install the add-on directly from PyPI using pip:
pip install hyped-extensions-serve
Getting Started
Hyped serve leverages the power of FastAPI to create a robust serving environment.
To get started, simply define your data pipeline and its expected input features in a Python script, and then serve it using hyped-extensions-serve.
Here's a basic example:
# app.py
from hyped import DataFlow
from hyped.typing import Mapping, Int
from hyped.extensions.serve import HypedAPI
# Define your input schema
class Inputs(Mapping):
x: Int
# Define your data flow
flow = DataFlow[Inputs]()
flow = flow.build(collect={"y": flow.source["x"] * 2})
# Create the app to be served
app = HypedAPI().serve_flow(flow, prefix="/")
Once you've defined your app, you can serve it using uvicorn:
uvicorn app:app --host 0.0.0.0 --port 80
This will start the server, allowing you to interact with your data pipeline via HTTP requests.
Endpoints
The Hyped Serve API provides the following endpoints for interacting with your data pipeline:
| Endpoint | Method | Description |
|---|---|---|
| /health | GET | Simple health check always returns "ok" and code 200. |
| /readiness | GET | Simple readiness check always returns "ok" and code 200. |
| <prefix>/readiness | GET | Readiness check to determine if the flow is ready to receive requests. |
| <prefix>/apply | POST | Apply the data flow to a single example. Expects a single example in JSON format. |
| <prefix>/batch | POST | Apply the data flow to a batch of data. Expects a list of examples. |
Additionally, a Swagger UI API documentation is available at /docs.
Serving multiple Data Pipes
The serving environment also supports serving multiple data pipes simultaneously. You can configure this by providing multiple data pipes and their respective features.
# app.py
app = (
HypedAPI()
.serve_flow(flowA, prefix="/A")
.serve_flow(flowB, prefix="/B")
)
This example demonstrates serving two different data pipes (pipe_one and pipe_two) with their corresponding features, each accessible via different prefixes (/one and /two).
Running Tests
Hyped Serve includes a suite of tests to ensure its functionality. You can run these tests using pytest:
pytest tests
Ensure that you have pytest installed in your environment. You can install it via pip:
pip install pytest
Running the tests will execute various test cases to validate the behavior of Hyped Serve.
License
tbd
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hyped_extensions_serve-0.1.0a0.tar.gz.
File metadata
- Download URL: hyped_extensions_serve-0.1.0a0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d24a0e019a383d738d970fbfa9b3e6a30e2bcf7662b8b8222eed4208de6afe57
|
|
| MD5 |
73d1f9d7c2e042aab0cca536b6c4f57b
|
|
| BLAKE2b-256 |
d386f076b74d9d3b1973c0603bdb753260467b81a760a244a611e41c1a60d094
|
Provenance
The following attestation bundles were made for hyped_extensions_serve-0.1.0a0.tar.gz:
Publisher:
publish.yml on open-hyped/hyped-extensions-serve
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyped_extensions_serve-0.1.0a0.tar.gz -
Subject digest:
d24a0e019a383d738d970fbfa9b3e6a30e2bcf7662b8b8222eed4208de6afe57 - Sigstore transparency entry: 2233537615
- Sigstore integration time:
-
Permalink:
open-hyped/hyped-extensions-serve@35a3f7e0aef47b6e881cd6717e1725eaa029091d -
Branch / Tag:
refs/tags/v0.1.0-alpha - Owner: https://github.com/open-hyped
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@35a3f7e0aef47b6e881cd6717e1725eaa029091d -
Trigger Event:
create
-
Statement type:
File details
Details for the file hyped_extensions_serve-0.1.0a0-py3-none-any.whl.
File metadata
- Download URL: hyped_extensions_serve-0.1.0a0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90b6f4a95065f5fcbd2d26f65dae4ceb58842bde624adc0cd113dd509cc47ef2
|
|
| MD5 |
245997c6c85960ae3e471e70412cf426
|
|
| BLAKE2b-256 |
440237f189eaf9896de0ef23eef8a3562fb4971d30b742d771738ea8b85d5a36
|
Provenance
The following attestation bundles were made for hyped_extensions_serve-0.1.0a0-py3-none-any.whl:
Publisher:
publish.yml on open-hyped/hyped-extensions-serve
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyped_extensions_serve-0.1.0a0-py3-none-any.whl -
Subject digest:
90b6f4a95065f5fcbd2d26f65dae4ceb58842bde624adc0cd113dd509cc47ef2 - Sigstore transparency entry: 2233538281
- Sigstore integration time:
-
Permalink:
open-hyped/hyped-extensions-serve@35a3f7e0aef47b6e881cd6717e1725eaa029091d -
Branch / Tag:
refs/tags/v0.1.0-alpha - Owner: https://github.com/open-hyped
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@35a3f7e0aef47b6e881cd6717e1725eaa029091d -
Trigger Event:
create
-
Statement type: