VetiverAPI
VetiverAPI(self,
model,=True,
show_prototype=True,
check_prototype=FastAPI,
app_factory**kwargs,
)
Create model aware API
Parameters
Name | Type | Description | Default |
---|---|---|---|
model | VetiverModel | Model to be deployed in API | required |
show_prototype | bool | True |
|
check_prototype | bool | Determine if data prototype should be enforced | True |
app_factory | Type of API to be deployed | FastAPI |
|
**kwargs | Deprecated parameters. | {} |
Examples
>>> import vetiver as vt
>>> X, y = vt.get_mock_data()
>>> model = vt.get_mock_model().fit(X, y)
>>> v = vt.VetiverModel(model = model, model_name = "my_model", prototype_data = X)
>>> v_api = vt.VetiverAPI(model = v, check_prototype = True)
Notes
This generates an API with either 3 or 4 GET endpoints and 1 POST endpoint.
├──/ping (GET)
├──/metadata (GET)
├──/prototype (GET)
├──/pin-url (GET, if VetiverModel metadata `url` field is not None)
└──/predict (POST)
Parameter check_ptype
was changed to check_prototype
. Handling of check_ptype
will be removed in a future version.
Methods
Name | Description |
---|---|
run | Start API |
vetiver_post | Create new POST endpoint that is aware of model input data |