from bud import BudClient
client = BudClient()
# Execute the Add Model → Deploy Model pipeline
execution = client.executions.run_ephemeral(
pipeline_definition={
"name": "Model Deployment Pipeline",
"steps": [
{
"id": "add_model",
"name": "Add Model",
"action": "model_add",
"params": {
"model_uri": "meta-llama/Llama-3.2-1B-Instruct",
"model_name": "Llama-3.2-1B-Instruct",
"model_source": "hugging_face"
},
"depends_on": []
},
{
"id": "deploy_model",
"name": "Deploy Model",
"action": "deployment_create",
"params": {
"model_id": "{{steps.add_model.output.model_id}}",
"cluster_id": "cluster_abc123",
"deployment_name": "llama-deployment"
},
"depends_on": ["add_model"]
}
],
"outputs": {
"endpoint_url": "{{steps.deploy_model.output.endpoint_url}}"
},
"description": "Add and deploy a model from HuggingFace"
},
wait=True
)
print(f"Status: {execution.status}")
print(f"Endpoint: {execution.outputs.get('endpoint_url')}")