Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
After you install the Foundry Local extension expansion pack, the phi-4-mini CPU is available as part of the base pack. This article shows you how to create your first deployment from the catalog.
Important
- Foundry Local is available in preview. Preview releases provide early access to features that are in active deployment.
- Features, approaches, and processes can change or have limited capabilities before general availability (GA).
Prerequisites
Make sure you followed the steps in Prepare to deploy Foundry Local on Azure Local in disconnected environments and Deploy Foundry Local on Azure Local in a disconnected environment to set up your environment and deploy the Foundry Local extension.
Generate access token and request headers
Run these commands to generate an access token and create the request headers that authenticate REST API calls to Foundry Local.
$DisplayName = "FoundryOnArc-Disconnected"
$app = az ad app list --display-name $DisplayName --query "[0]" -o json | ConvertFrom-Json
$appId = $app.AppId
$token = az account get-access-token --resource "$appId" --query accessToken -o tsv
$headers = @{ "Authorization" = "Bearer $token" }
# If using gateway api:
$baseUrl = "https://<FOUNDRY_API_BASE_PATH>/inference-api"
# If not using ingress, use the direct API endpoint instead:
# $baseUrl = "https://<FOUNDRY_API_BASE_PATH>"
Create your first deployment (phi-4-mini CPU)
Run this request to create a phi-4-mini CPU deployment from the model catalog in your Foundry Local environment.
$namespace = "foundry-local-operator"
$deploymentName = "phi4-cpu-demo"
# Use 'external' to expose model API outside the Kubernetes cluster. 'internal' is the default value.
$exposure = "external"
$body = @{
name = $deploymentName
spec = @{
displayName = "Phi 4 CPU Demo"
model = @{
catalog = @{
name = "phi-4-mini"
}
}
workloadType = "generative"
compute = "cpu"
runtime = "onnx-genai"
replicas = 1
port = 5000
authentication = @{
enabled = $true
}
endpoint = @{
exposure = $exposure
path = "/phi4-cpu-demo(/|$)(.*)"
pathType = "ImplementationSpecific"
}
}
} | ConvertTo-Json -Depth 20
Invoke-RestMethod `
-Uri "$baseUrl/api/v1/namespaces/$namespace/deployments" `
-Headers ($headers + @{ "Content-Type" = "application/json" }) `
-Method POST `
-Body $body
Verify deployment
Run the following command to confirm the deployment exists and check whether it's moving to a ready state.
Invoke-RestMethod `
-Uri "$baseUrl/api/v1/namespaces/$namespace/deployments/$deploymentName" `
-Headers $headers `
-Method GET
Expected result:
- Deployment exists and returns successfully from the GET request.
- Deployment status moves to ready state after model cache and pod startup complete.