Deploy from W&B Registry with Webhook
Hands-on tutorial for launching and deploying LLMs using Friendli Dedicated Endpoints with Weights & Biases artifacts through webhook automation.
Introduction
This tutorial is designed to guide you through the process of easily deploying your models from the W&B Registry to Friendli Dedicated Endpoints in the W&B UI. Through a series of step-by-step instructions and hands-on examples, you’ll learn how to:
- Configure a webhook in W&B to trigger deployments to Friendli Dedicated Endpoints.
- Create a webhook automation to automatically deploy model artifacts when adding new versions.
- Deploy a model artifact to Friendli Dedicated Endpoints by adding an alias in the W&B Registry.
- Understand how adding and removing aliases affects deployments on Friendli Dedicated Endpoints.
Why use W&B webhook automation with Friendli Dedicated Endpoints?
W&B users often rely on W&B Registry to manage the lifecycle of models – from tracking experiment artifacts to promoting the best-performing models for production use. As a W&B user, integrating Friendli Dedicated Endpoints directly into this workflow allows you to:
- Streamline deployment: Transition your models from experimentation to production with minimal effort. By leveraging W&B’s aliasing system and FriendliAI’s automated infrastructure, you eliminate the need for custom scripts or manual configurations.
- Ensure deployment consistency: Friendli Dedicated Endpoints include support for
idempotencyKey
to ensure the reliability of automated workflows. Each deployment trigger via webhook automation is tracked with a uniqueidempotencyKey
, ensuring that operations like endpoint creation or updates are processed exactly once. It prevents duplicate or conflicting operations, giving you confidence in the consistency of your deployment.
By the end of this tutorial, you’ll be equipped with the knowledge and skills necessary to seamlessly transfer your models from W&B Registry to Friendli Dedicated Endpoints for efficient deployment. So, let’s get started and explore the possibilities of Friendli Dedicated Endpoints!
Prerequisites
- A Friendli Suite account with access to Friendli Dedicated Endpoints.
- A personal access token generated through Friendli Suite.
Step 1: Create a secret
- Navigate to the team’s page on W&B and click on Team settings.
- Scroll down to the Team secrets section and click New secret.
- Go to Friendli Suite and navigate to Personal settings > Tokens and click Create new token.
- Copy your personal access token.
- Return to W&B and fill in the Secret with the personal access token generated through Friendli Suite.
Step 2: Configure a webhook
- From the same W&B team settings page, click on New webhook in the Webhooks section.
- Fill in the URL field with Friendli Suite Rest API URL (see more details here) and Access token field with the secret already created through Friendli Suite.
Step 3: Create a webhook automation
- Go to your W&B Registry Model and click on View details of the model you want to deploy.
- Click on Create automation in the Automations section.
- Select An artifact alias is added for the Event.
- Enter an alias you want to use to trigger the deployment for the Alias regex.
- Select the Webhooks for Action type.
- Select the webhook configured with Friendli Dedicated Endpoints for Webhook.
- Fill out the box by referring to the following example for Payload.
Example: Configuration for payload
Field | Description |
---|---|
wandbArtifactVersionName | Specific model artifact version from W&B. |
Field | Description |
---|---|
wandbArtifactVersionName | Specific model artifact version from W&B. |
Field | Description |
---|---|
wandbArtifactVersionName | Specific model artifact version from W&B. |
name | Name of the endpoint. |
projectId | Specific project ID of where the endpoint will be created. |
idempotencyKey | Unique value to track which webhook automation triggered an endpoint roll out. Use any unique value, but using the example value provided is recommended. |
accelerator | Hardware for the endpoint. |
autoscalingPolicy | Autoscaling settings for the endpoint. |
To gain more control over GPU resources for an endpoint, configure the accelerator
field by specifying the desired type and count. This is particularly useful for serving large models that require model or data parallelism.
Field | Description |
---|---|
accelerator.type | Specifies the instance type. |
accelerator.count | Specifies the number of instances. |
View more details about each field here.
Step 4: Deploy a model artifact
Deploy your model artifact to Friendli Dedicated Endpoints by simply adding the alias set in Step 3 to a model artifact version!
After adding the alias, you can see the endpoint created in Friendli Dedicated Endpoints.
Step 5: Roll out a model artifact (Advanced)
To roll out an endpoint to a new model artifact version, simply add the same alias to the new version you want to deploy. This updates the endpoint to use the new model artifact version. After assigning the alias, the endpoint will update to reflect the new version in Friendli Dedicated Endpoints.
Change model artifact from Version 0 to Version 1
idempotencyKey
is required to roll out an endpoint between different model artifact versions.Step 6: Track the history of deployment versions
Use the Friendli Dedicated Endpoints versioning feature to track the history of your model deployments and maintain a clear record of every update. By adding an alias to a model artifact version, you can deploy models and roll out updates across versions efficiently, without needing to create a new endpoint from scratch.
- When an alias is reassigned to a different version, the existing endpoint will automatically roll out to the new version.
Versions
In the diagram,
v0
represents the first deployed version of the model when the endpoint was created.v1
is a newer model artifact version that the alias was reassigned to, triggering a rollout to update the endpoint accordingly.
View more details about the versioning feature here.
Frequently Asked Questions
Feedback or issue
If you have any feedback or issues about the integration with Friendli Dedicated Endpoints, please ask for support by sending an email to Support.