Blog Post

Azure Arc Blog
7 MIN READ

Your first model deployment on Foundry Local on Azure Local: from catalog to inference in 10 minutes

JonathanSchtechel's avatar
Jun 02, 2026

Foundry Local on Azure Local lets you run open-source models directly on your own Azure Local cluster, behind an OpenAI-compatible AP. It's the same experience you've gotten used to in the cloud, but the inference runs on hardware you own.

Foundry Local on Azure Local is in public preview at the time of this writing.

You've installed Foundry Local on your Azure Local cluster. The operator's pods are running, the CRDs are registered, you've checked it twice with kubectl get pods. Now what?

This blog covers the part that comes right before all of that - the lifecycle pattern you'll use to deploy any model on Foundry Local on Azure Local. Our recent announcement covers the bigger picture: multi-node inference, vLLM as a first-class runtime alongside ONNX-GenAI, and an expanded catalog. We'll keep this walkthrough single-node for clarity, but the same ModelDeployment pattern scales without changes to your client code or workflow.

By the end of this walkthrough, you'll have gone from an empty kubectl prompt to a working, OpenAI-compatible inference endpoint serving Phi-4. All in about ten minutes, using nothing but kubectl, Python, and a small sample script. We'll also show you how to switch that same flow to the new vLLM runtime by changing roughly five lines of YAML.

All the code lives in Azure-Samples/foundry-local-model-catalog. Clone it and follow along.

What you'll build

The sample walks through five steps, each driven by the same Python script with different flags:

  1. Query the model catalog - read the ConfigMap the operator syncs from the Microsoft Foundry catalog API.
  2. Deploy a model - create a ModelDeployment custom resource pointing at one catalog entry.
  3. Wait for ready - the operator pulls the model image, schedules pods, and reports state.
  4. Run inference - call the OpenAI-compatible /v1/chat/completions endpoint with an API key the operator generates for you.
  5. Clean up - delete the deployment.

The same five steps apply whether you're serving an ONNX model on a CPU node or a vLLM model on a GPU node. We'll start with the simpler path: Phi-4 on CPU on the ONNX runtime, then show you the vLLM variant at the end.

Before you start

You'll need:

  • An Azure Local cluster (or any Arc-enabled Kubernetes cluster) with the Foundry Local extension installed. If you haven't set this up yet, the Foundry Local on Azure Local install guide walks through the cluster, extension, and resource requirements.
  • kubectl configured against that cluster, with permissions to read ConfigMaps and Secrets and to create ModelDeployment resources in the foundry-local-operator namespace.
  • Python 3.9 or later.

Verify the operator is alive before you go further:

kubectl get pods -n foundry-local-operator kubectl get crd | grep foundry

You should see operator pods in Running state and at least one CRD named modeldeployments.foundrylocal.azure.com. If you don't, the install docs are the right place to back up to.

Then clone and install:

git clone https://github.com/Azure-Samples/foundry-local-model-catalog.git && cd foundry-local-model-catalog && python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt

 

Step 1 - See what's in your catalog

Start with the lowest-risk command in the sample, it talks to the cluster but changes nothing:

python catalog_sample.py --catalog-only

A few things to notice in that table:

  • Most models appear more than once. The same model gets packaged for different runtime/hardware combinations, and the operator picks the right container image based on which entry you reference.
  • There's a RUNTIME column. We'll come back to vLLM at the end of this post; for now, the default Phi-4-generic-cpu ONNX entry is what we'll deploy.
  • The catalog itself is just a ConfigMap. No magic, no hidden registry. The operator syncs it from the Microsoft Foundry catalog API on a CronJob, and the sample reads it the same way you would:
kubectl get configmap foundry-local-catalog -n foundry-local-operator -o yaml

If you ever wonder what's actually available on your cluster, that's the source of truth.

Step 2 - Deploy a model

Now the side-effecting part. We're going to ask the operator to deploy Phi-4 on CPU:

python catalog_sample.py --deploy-only

Under the hood, the sample builds and applies a ModelDeployment manifest that looks like this:

apiVersion: foundrylocal.azure.com/v1 kind: ModelDeployment metadata: name: phi-4-generic-cpu namespace: foundry-local-operator spec: model: catalog: name: Phi-4-generic-cpu workloadType: generative compute: cpu replicas: 1 port: 5000

The operator takes it from there. It pulls the model container image, schedules a pod, generates an API-key Secret named phi-4-generic-cpu-api-keys, and walks the deployment through Pending → Creating → Running states. The sample polls until both status.state == Running and status.deploymentReady == true.

Heads up!

the first deployment of a given model pulls the model image, which can take a few minutes depending on model size and network speed. The image is cached on a PersistentVolume, so the second deploy of the same model is much faster.

Step 3 - Run inference

The endpoint is up. Time to actually use it.

If you're running this script from inside the cluster (say, from a debug pod), the endpoint lives at the in-cluster service DNS and the sample picks that up automatically. Most readers will be running from a laptop, though, so we'll cover that path explicitly.

In one terminal, port-forward the deployment's service:

kubectl port-forward svc/phi-4-generic-cpu 5000:5000 -n foundry-local-operator

In another, run the sample's inference-only mode against the forwarded endpoint:

python catalog_sample.py --infer-only --endpoint https://localhost:5000 --insecure

The sample reads the API key from the auto-generated Secret and sends it as Authorization: Bearer <key>. same pattern as cloud OpenAI.

Heads up!

The --insecure flag bypasses self-signed TLS. Together with kubectl port-forward, this is a smoke-test setup. for real traffic, expose the deployment via Ingress or LoadBalancer.

The request body is the standard OpenAI chat-completions shape:

{ "model": "Phi-4-generic-cpu:1.0.0", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the capital of France? Reply in one sentence."} ], "max_tokens": 256 }

That response just traveled from your terminal, through kubectl port-forward, into a model serving inside your Azure Local cluster, and back.

Step 4 - Clean up

The sample's default flow deletes the deployment on its way out, so if you ran the full python catalog_sample.py (no flags) you're already clean. If you used --deploy-only or --skip-cleanup, drop it explicitly:

kubectl delete modeldeployment phi-4-generic-cpu -n foundry-local-operator

The operator garbage-collects the pod, service, and API-key Secret. The cached model image stays on its PersistentVolume, so your next deploy of the same model skips the image pull.

Going beyond CPU: vLLM in 5 lines

Now for the variant we've been pointing at. The same ModelDeployment CR, the same OpenAI-compatible endpoint, switched to a runtime built for concurrent users, demonstrated on a popular open-source model.

The diff against the manifest from Step 2:

spec: - compute: cpu + compute: gpu + runtime: vllm model: catalog: - name: Phi-4-generic-cpu + name: Mistral-7B-v0.2

The same sample script handles it:

python catalog_sample.py \ --model Mistral-7B-v0.2 \ --compute gpu \ --runtime vllm

What you get back is the same OpenAI-compatible endpoint your client code already knows,  but now backed by vLLM's PagedAttention, continuous batching, and automatic planner-tuned configuration. Your application code doesn't need to know any of that; it's still POST /v1/chat/completions with a Bearer token.

That's the point of the lifecycle pattern: ONNX or vLLM, CPU or GPU, the platform engineer's deployment loop looks the same. For the architectural "why" behind multi-node, vLLM, and the expanded catalog, read the announcement.

What you've built

Ten minutes ago you had an installed-but-empty Foundry Local cluster. You now have:

  • A working OpenAI-compatible chat endpoint serving Phi-4.
  • A clear sense of what the operator manages for you (ModelDeployment CR, model image cache, API-key Secret) and what stays in your hands (which model, which runtime, which compute target).
  • A small, modular script you can wire into three things:
    • A smoke test for every new cluster you stand up (--catalog-only → --deploy-only → --infer-only is a one-line CI step).
    • An internal demo when you need to show a team that Foundry Local on Azure Local is real and reachable.
    • The foundation for your team's own deployment automation - copy the manifest builder, drop the CLI, and wire it into your existing GitOps or platform tooling.

From endpoint to chat surface

The model deployment above exposes a standard OpenAI-compatible API - enough for any existing chat client to point at. If you'd like to see exactly that, Azure-Samples/local-chat-with-foundry-local picks up where this walkthrough ends: it wires the running endpoint into the Sovereign Chat Experience starter UI. About ten more minutes from working endpoint to working chat in the browser.

Where to go from here

  • Try the rest of the sample:  --catalog-only, --deploy-only, --infer-only, and --skip-cleanup compose into whichever workflow you're testing.
  • Read the announcement for the architectural why behind multi-node, vLLM, and the expanded catalog.
  • Read the docs for the full operator and CRD reference.
  • Feel free to share your feedback with us at FoundryLocalOnAzure@microsoft.com. The product is in public preview, so your feedback shapes what ships next.
Updated Jun 03, 2026
Version 3.0
No CommentsBe the first to comment