The following tutorial is available on the Wallaroo Github Repository.
This notebook will walk through building a summarization text pipeline in Wallaroo, deploying it to the local cluster for testing, and then publishing it for edge deployment.
This demonstration will focus on deployment to the edge. The sample model is available at the following URL. This model should be downloaded and placed into the ./models
folder before beginning this demonstration.
model-auto-conversion_hugging-face_complex-pipelines_hf-summarisation-bart-large-samsun.zip (1.4 GB)
This demonstration performs the following:
The first step is to import the libraries used in this notebook.
import wallaroo
from wallaroo.object import EntityNotFoundError
import pyarrow as pa
import pandas as pd
import time
# used to display dataframe information without truncating
from IPython.display import display
pd.set_option('display.max_colwidth', None)
pd.set_option('display.max_columns', None)
The next step is to connect to Wallaroo through the Wallaroo client. The Python library is included in the Wallaroo install and available through the Jupyter Hub interface provided with your Wallaroo environment.
This is accomplished using the wallaroo.Client()
command, which provides a URL to grant the SDK permission to your specific Wallaroo environment. When displayed, enter the URL into a browser and confirm permissions. Store the connection into a variable that can be referenced later.
If logging into the Wallaroo instance through the internal JupyterHub service, use wl = wallaroo.Client()
. For more information on Wallaroo Client settings, see the Client Connection guide.
wl = wallaroo.Client(api_endpoint="https://autoscale-uat-gcp.wallaroo.dev",
auth_type="sso")
We’ll use the SDK below to create our workspace , assign as our current workspace, then display all of the workspaces we have at the moment. We’ll also set up variables for our models and pipelines down the road, so we have one spot to change names to whatever fits your organization’s standards best.
To allow this tutorial to be run by multiple users in the same Wallaroo instance, a random 4 character prefix will be added to the workspace, pipeline, and model. Feel free to set suffix=''
if this is not required.
workspace_name = f'edge-hf-summarization'
pipeline_name = 'edge-hf-summarization'
model_name = 'hf-summarization'
model_file_name = './models/model-auto-conversion_hugging-face_complex-pipelines_hf-summarisation-bart-large-samsun.zip'
workspace = wl.get_workspace(name=workspace_name, create_if_not_exist=True)
wl.set_current_workspace(workspace)
{'name': 'edge-hf-summarization', 'id': 1671, 'archived': False, 'created_by': 'john.hummel@wallaroo.ai', 'created_at': '2025-05-16T16:26:15.723378+00:00', 'models': [{'name': 'hf-summarization', 'versions': 2, 'owner_id': '""', 'last_update_time': datetime.datetime(2025, 7, 16, 17, 0, 14, 975922, tzinfo=tzutc()), 'created_at': datetime.datetime(2025, 5, 16, 16, 27, 12, 153290, tzinfo=tzutc())}], 'pipelines': [{'name': 'edge-hf-summarization', 'create_time': datetime.datetime(2025, 5, 16, 16, 30, 25, 959276, tzinfo=tzutc()), 'definition': '[]'}]}
This is required for non-native runtimes for models deployed to Wallaroo.
You can find more info on the available inputs under TextSummarizationInputs or under the official source code from 🤗 Hugging Face
.
input_schema = pa.schema([
pa.field('inputs', pa.string()),
pa.field('return_text', pa.bool_()),
pa.field('return_tensors', pa.bool_()),
pa.field('clean_up_tokenization_spaces', pa.bool_()),
# pa.field('generate_kwargs', pa.map_(pa.string(), pa.null())), # dictionaries are not currently supported by the engine
])
output_schema = pa.schema([
pa.field('summary_text', pa.string()),
])
When a model is uploaded to a Wallaroo cluster, it is optimized and packaged to make it ready to run as part of a pipeline. In many times, the Wallaroo Server can natively run a model without any Python overhead. In other cases, such as a Python script, a custom Python environment will be automatically generated. This is comparable to the process of “containerizing” a model by adding a small HTTP server and other wrapping around it.
Our pretrained model is in HuggingFace format, which is specified in the framework
parameter. The input and output schemas are included as part of the model upload. For more information, see Wallaroo SDK Essentials Guide: Model Uploads and Registrations: Hugging Face.
model = wl.upload_model(model_name,
model_file_name,
framework=wallaroo.framework.Framework.HUGGING_FACE_SUMMARIZATION,
input_schema=input_schema,
output_schema=output_schema,
convert_wait=False
)
model
Name | hf-summarization |
Version | 9bb33d9f-cdd8-4f8f-a588-314de0315230 |
File Name | model-auto-conversion_hugging-face_complex-pipelines_hf-summarisation-bart-large-samsun.zip |
SHA | ee71d066a83708e7ca4a3c07caf33fdc528bb000039b6ca2ef77fa2428dc6268 |
Status | pending_load_container |
Image Path | None |
Architecture | x86 |
Acceleration | none |
Updated At | 2025-16-Jul 19:38:36 |
Workspace id | 1671 |
Workspace name | edge-hf-summarization |
while model.status() != "ready" and model.status() != "error":
print(model.status())
time.sleep(10)
print(model.status())
attempting_load_container
ready
Before deploying an inference engine we need to tell wallaroo what resources it will need.
To do this we will use the wallaroo DeploymentConfigBuilder() and fill in the options listed below to determine what the properties of our inference engine will be.
We will be testing this deployment for an edge scenario, so the resource specifications are kept small – what’s the minimum needed to meet the expected load on the planned hardware.
deployment_config = wallaroo.DeploymentConfigBuilder() \
.cpus(0.25).memory('1Gi') \
.sidekick_cpus(model, 4) \
.sidekick_memory(model, "8Gi") \
.build()
We will now deploy our pipeline into the current Kubernetes environment using the specified resource constraints. This is a “simulated edge” deploy in that we try to mimic the edge hardware as closely as possible.
pipeline = wl.build_pipeline(pipeline_name)
pipeline.clear()
pipeline.add_model_step(model)
pipeline.deploy(deployment_config=deployment_config, wait_for_status=False)
Deployment initiated for edge-hf-summarization. Please check pipeline status.
name | edge-hf-summarization |
---|---|
created | 2025-05-16 16:30:25.959276+00:00 |
last_updated | 2025-07-16 19:41:40.758974+00:00 |
deployed | True |
workspace_id | 1671 |
workspace_name | edge-hf-summarization |
arch | x86 |
accel | none |
tags | |
versions | 26506e33-8ed1-439b-8622-9f1b41f1a0f9, ec5e41cb-aab0-4e80-b4cb-e8852e05b72f, 35b4ff87-a0ae-4c63-8766-7c20f9123cd0, 05364bc4-3ed1-4234-9db1-f988822b1ad5, 00a6ba29-09e5-4a47-be7c-fe4b5fd49de3, b04113e5-8d48-4163-a815-5160256885b3, f4ba80ab-778a-4970-bdce-8f1d39310416, fb13126a-02a9-4b4d-8976-6b675c070e8f |
steps | hf-summarization |
published | True |
# check the pipeline status before performing an inference
while pipeline.status()['status'] != 'Running':
time.sleep(15)
display(pipeline.status()['status'])
pipeline.status()
A single inference using sample input data is prepared below. We’ll run through it to verify the pipeline inference is working.
input_data = {
"inputs": ["LinkedIn (/lɪŋktˈɪn/) is a business and employment-focused social media platform that works through websites and mobile apps. It launched on May 5, 2003. It is now owned by Microsoft. The platform is primarily used for professional networking and career development, and allows jobseekers to post their CVs and employers to post jobs. From 2015 most of the company's revenue came from selling access to information about its members to recruiters and sales professionals. Since December 2016, it has been a wholly owned subsidiary of Microsoft. As of March 2023, LinkedIn has more than 900 million registered members from over 200 countries and territories. LinkedIn allows members (both workers and employers) to create profiles and connect with each other in an online social network which may represent real-world professional relationships. Members can invite anyone (whether an existing member or not) to become a connection. LinkedIn can also be used to organize offline events, join groups, write articles, publish job postings, post photos and videos, and more"], # required
"return_text": [True], # optional: using the defaults, similar to not passing this parameter
"return_tensors": [False], # optional: using the defaults, similar to not passing this parameter
"clean_up_tokenization_spaces": [False], # optional: using the defaults, similar to not passing this parameter
}
dataframe = pd.DataFrame(input_data)
dataframe
inputs | return_text | return_tensors | clean_up_tokenization_spaces | |
---|---|---|---|---|
0 | LinkedIn (/lɪŋktˈɪn/) is a business and employment-focused social media platform that works through websites and mobile apps. It launched on May 5, 2003. It is now owned by Microsoft. The platform is primarily used for professional networking and career development, and allows jobseekers to post their CVs and employers to post jobs. From 2015 most of the company's revenue came from selling access to information about its members to recruiters and sales professionals. Since December 2016, it has been a wholly owned subsidiary of Microsoft. As of March 2023, LinkedIn has more than 900 million registered members from over 200 countries and territories. LinkedIn allows members (both workers and employers) to create profiles and connect with each other in an online social network which may represent real-world professional relationships. Members can invite anyone (whether an existing member or not) to become a connection. LinkedIn can also be used to organize offline events, join groups, write articles, publish job postings, post photos and videos, and more | True | False | False |
deploy_url = pipeline._deployment._url()
headers = wl.auth.auth_header()
headers['Content-Type']='application/json; format=pandas-records'
# headers['Content-Type']='application/json; format=pandas-records'
headers['Accept']='application/json; format=pandas-records'
dataFile = './data/test_summarization.df.json'
!curl -X POST {deploy_url} \
-H "Authorization:{headers['Authorization']}" \
-H "Content-Type:{headers['Content-Type']}" \
-H "Accept:{headers['Accept']}" \
--data-binary @{dataFile}
[{"time":1752695212199,"in":{"clean_up_tokenization_spaces":false,"inputs":"LinkedIn (/lɪŋktˈɪn/) is a business and employment-focused social media platform that works through websites and mobile apps. It launched on May 5, 2003. It is now owned by Microsoft. The platform is primarily used for professional networking and career development, and allows jobseekers to post their CVs and employers to post jobs. From 2015 most of the company's revenue came from selling access to information about its members to recruiters and sales professionals. Since December 2016, it has been a wholly owned subsidiary of Microsoft. As of March 2023, LinkedIn has more than 900 million registered members from over 200 countries and territories. LinkedIn allows members (both workers and employers) to create profiles and connect with each other in an online social network which may represent real-world professional relationships. Members can invite anyone (whether an existing member or not) to become a connection. LinkedIn can also be used to organize offline events, join groups, write articles, publish job postings, post photos and videos, and more","return_tensors":false,"return_text":true},"out":{"summary_text":"LinkedIn is a business and employment-focused social media platform that works through websites and mobile apps. It launched on May 5, 2003. LinkedIn allows members (both workers and employers) to create profiles and connect with each other in an online social network which may represent real-world professional relationships."},"anomaly":{"count":0},"metadata":{"last_model":"{\"model_name\":\"hf-summarization\",\"model_sha\":\"ee71d066a83708e7ca4a3c07caf33fdc528bb000039b6ca2ef77fa2428dc6268\"}","pipeline_version":"26506e33-8ed1-439b-8622-9f1b41f1a0f9","elapsed":[225569,4996946836],"dropped":[],"partition":"engine-b96d97cd4-pt4gf"}}]
Just to clear up resources, we’ll undeploy the pipeline.
pipeline.undeploy()
name | edge-hf-summarization |
---|---|
created | 2025-05-16 16:30:25.959276+00:00 |
last_updated | 2025-07-16 19:41:40.758974+00:00 |
deployed | False |
workspace_id | 1671 |
workspace_name | edge-hf-summarization |
arch | x86 |
accel | none |
tags | |
versions | 26506e33-8ed1-439b-8622-9f1b41f1a0f9, ec5e41cb-aab0-4e80-b4cb-e8852e05b72f, 35b4ff87-a0ae-4c63-8766-7c20f9123cd0, 05364bc4-3ed1-4234-9db1-f988822b1ad5, 00a6ba29-09e5-4a47-be7c-fe4b5fd49de3, b04113e5-8d48-4163-a815-5160256885b3, f4ba80ab-778a-4970-bdce-8f1d39310416, fb13126a-02a9-4b4d-8976-6b675c070e8f |
steps | hf-summarization |
published | True |
It worked! For a demo, we’ll take working once as “tested”. So now that we’ve tested our pipeline, we are ready to publish it for edge deployment.
Publishing it means assembling all of the configuration files and model assets and pushing them to an Open Container Initiative (OCI) repository set in the Wallaroo instance as the Edge Registry service. DevOps engineers then retrieve that image and deploy it through Docker, Kubernetes, or similar deployments.
See Edge Deployment Registry Guide for details on adding an OCI Registry Service to Wallaroo as the Edge Deployment Registry.
This is done through the SDK command wallaroo.pipeline.publish(deployment_config)
.
We will now publish the pipeline to our Edge Deployment Registry with the pipeline.publish(deployment_config)
command. deployment_config
is an optional field that specifies the pipeline deployment. This can be overridden by the DevOps engineer during deployment.
## This may still show an error status despite but if both containers show running it should be good to go
pipeline.publish(deployment_config)
Waiting for pipeline publish... It may take up to 600 sec.
Pipeline is publishing......................... Published.
ID | 111 | |
Pipeline Name | edge-hf-summarization | |
Pipeline Version | 8465d084-f325-4f14-9d42-46545ba58ec0 | |
Status | Published | |
Workspace Id | 1671 | |
Workspace Name | edge-hf-summarization | |
Edges | ||
Engine URL | sample.registry.example.com/uat/engines/proxy/wallaroo/ghcr.io/wallaroolabs/fitzroy-mini:v2025.1.0-6245 | |
Pipeline URL | sample.registry.example.com/uat/pipelines/edge-hf-summarization:8465d084-f325-4f14-9d42-46545ba58ec0 | |
Helm Chart URL | oci://sample.registry.example.com/uat/charts/edge-hf-summarization | |
Helm Chart Reference | sample.registry.example.com/uat/charts@sha256:dc785143d0d943fa97c4aeda9c888202aec57250d01f968cba73eff8e19e0d63 | |
Helm Chart Version | 0.0.1-8465d084-f325-4f14-9d42-46545ba58ec0 | |
Engine Config | {'engine': {'resources': {'limits': {'cpu': 0.25, 'memory': '1Gi'}, 'requests': {'cpu': 0.25, 'memory': '1Gi'}, 'accel': 'none', 'arch': 'x86', 'gpu': False}}, 'engineAux': {'autoscale': {'type': 'none', 'cpu_utilization': 50.0}, 'images': {'hf-summarization-853': {'resources': {'limits': {'cpu': 4.0, 'memory': '8Gi'}, 'requests': {'cpu': 4.0, 'memory': '8Gi'}, 'accel': 'none', 'arch': 'x86', 'gpu': False}}}}} | |
User Images | [] | |
Created By | john.hummel@wallaroo.ai | |
Created At | 2025-07-16 19:51:27.422747+00:00 | |
Updated At | 2025-07-16 19:51:27.422747+00:00 | |
Replaces | ||
Docker Run Command |
Note: Please set the EDGE_PORT , OCI_USERNAME , and OCI_PASSWORD environment variables. | |
Podman Run Command |
Note: Please set the EDGE_PORT , OCI_USERNAME , and OCI_PASSWORD environment variables. | |
Helm Install Command |
Note: Please set the HELM_INSTALL_NAME , HELM_INSTALL_NAMESPACE ,
OCI_USERNAME , and OCI_PASSWORD environment variables. |
The method wallaroo.client.list_pipelines()
shows a list of all pipelines in the Wallaroo instance, and includes the published
field that indicates whether the pipeline was published to the registry (True
), or has not yet been published (False
).
wl.list_pipelines(workspace_name=workspace_name)
name | created | last_updated | deployed | workspace_id | workspace_name | arch | accel | tags | versions | steps | published |
---|---|---|---|---|---|---|---|---|---|---|---|
edge-hf-summarization | 2025-16-May 16:30:25 | 2025-16-Jul 19:51:25 | False | 1671 | edge-hf-summarization | x86 | none | 8465d084-f325-4f14-9d42-46545ba58ec0, 26506e33-8ed1-439b-8622-9f1b41f1a0f9, ec5e41cb-aab0-4e80-b4cb-e8852e05b72f, 35b4ff87-a0ae-4c63-8766-7c20f9123cd0, 05364bc4-3ed1-4234-9db1-f988822b1ad5, 00a6ba29-09e5-4a47-be7c-fe4b5fd49de3, b04113e5-8d48-4163-a815-5160256885b3, f4ba80ab-778a-4970-bdce-8f1d39310416, fb13126a-02a9-4b4d-8976-6b675c070e8f | hf-summarization | True |
All publishes created from a pipeline are displayed with the wallaroo.pipeline.publishes
method. The pipeline_version_id
is used to know what version of the pipeline was used in that specific publish. This allows for pipelines to be updated over time, and newer versions to be sent and tracked to the Edge Deployment Registry service.
N/A
A List of the following fields:
Field | Type | Description |
---|---|---|
id | integer | Numerical Wallaroo id of the published pipeline. |
pipeline_version_id | integer | Numerical Wallaroo id of the pipeline version published. |
engine_url | string | The URL of the published pipeline engine in the edge registry. |
pipeline_url | string | The URL of the published pipeline in the edge registry. |
created_by | string | The email address of the user that published the pipeline. |
Created At | DateTime | When the published pipeline was created. |
Updated At | DateTime | When the published pipeline was updated. |
pipeline.publishes()
Once a pipeline is deployed to the Edge Registry service, it can be deployed in environments such as Docker, Kubernetes, or similar container running services by a DevOps engineer. For our example, we will use the docker run
command output during the pipeline publish.
Once deployed, we can check the pipelines and models available. We’ll use a curl
command, but any HTTP based request will work the same way.
The endpoint /pipelines
returns:
Running
, or Error
if there are any issues.curl localhost:8080/pipelines
{"pipelines":[{"id":"edge-cv-retail","status":"Running"}]}
!curl testboy.local:8080/pipelines
{"pipelines":[{"id":"edge-hf-summarization","status":"Running"}]}
The endpoint /models
returns a List of models with the following fields:
curl localhost:8080/models
{"models":[{"name":"resnet-50","sha":"c6c8869645962e7711132a7e17aced2ac0f60dcdc2c7faa79b2de73847a87984","status":"Running","version":"693e19b5-0dc7-4afb-9922-e3f7feefe66d"}]}
!curl testboy.local:8080/models
{"models":[{"name":"hf-summarization","version":"add06bd2-054e-4562-b25e-ee692c6e472c","sha":"ee71d066a83708e7ca4a3c07caf33fdc528bb000039b6ca2ef77fa2428dc6268","status":"Running"}]}
The inference endpoint takes the following pattern:
/pipelines/infer
Wallaroo inference endpoint URLs accept the following data inputs through the Content-Type
header:
Content-Type: application/vnd.apache.arrow.file
: For Apache Arrow tables.Content-Type: application/json; format=pandas-records
: For pandas DataFrame in record format.Once deployed, we can perform an inference through the deployment URL.
The endpoint returns Content-Type: application/json; format=pandas-records
by default with the following fields:
null
if the input may be too long for a proper return.import json
import requests
import pandas as pd
# set the content type and accept headers
headers = {
'Content-Type': 'application/json; format=pandas-records'
}
# Submit arrow file
dataFile="./data/test_summarization.df.json"
data = json.load(open(dataFile))
host = 'http://testboy.local:8080'
deployurl = f'{host}/infer'
response = requests.post(
deployurl,
headers=headers,
json=data,
verify=True
)
# display(response)
display(pd.DataFrame(response.json()).loc[0, ['outputs']][0][0]['String']['data'][0])
'LinkedIn is a business and employment-focused social media platform that works through websites and mobile apps. It launched on May 5, 2003. LinkedIn allows members (both workers and employers) to create profiles and connect with each other in an online social network which may represent real-world professional relationships.'