Create Deployment
There are 3 components to setup a deployment in Zerve - API Controller, API Route and the code blocks to execute as part of the deployment.
API Controller
An API controller is a central component within the API layer that manages key functions and information related to its APIs.


API Address: The controllers provide endpoints through which clients can access the managed APIs.
API Key: They handle API key management, enabling developers to generate, distribute, and revoke API keys for authentication and access control.
Files: API controllers manage files associated with API requests and responses.
Customizable Options Offered by API Controller:
Compute Type: Choose between Lambda or Fargate for your computing needs.
Compute Memory: Configure the memory allocation for optimized performance.
API Route
API routes correspond to HTTP methods such as GET, POST, PUT, and DELETE. Developers typically define these routes within the API's configuration or routing system.

Route Configuration:
Setup route name and method of the route.

Data Validation:
Data validation involves checking incoming data for correctness, completeness through payload validation and response filtering, guarding against potential security vulnerabilities.

Test: Add test payload - sample data to test the deployment code.

Setting up Deployment:
Once model training is completed users can connect the trained model to deployment layer as shown below.
Add an API Controller block in API layer and setup required configurations - DNS name and API Key.

Connect API controller to Route block and edit the configuration with Route Name to predict and Method to POST for predictions.

Setup data validation to specify the expected data input format.

Add example test data to run test predictions and validate deployment code. This should contain all the necessary variables required for the model to generate predictions.

Here you can get either cURL or Python code for post-deployement

Add the prediction code that is required to run deployment predictions. In this layer users can reference the model variable from the development layer.


Deploy the model to zerve hosted API layer.
This can be accessed via the configured API address - https://zerveai.zerve.cloud/predict
Redeployment:
Since the API Layer is connected to the development layer any changes to the model can be easily pushed to the APIs. Once the retraining is completed users can simply redeploy the API as shown above and the latest model version will be used for predictions. This is made possible by the variable attachment process from Step 5 above.
Logs:
For all the deployments users have access to both deployment logs and runtime logs to track errors and deployment usage.
Last updated