Deploy Phi-4-mini model with ONNX Runtime on Azure Cobalt 100
Introduction
Demo
Build ONNX Runtime and set up the Phi-4-mini Model
Run the Chatbot Server
Interact with the Phi-4-mini Chatbot
Next Steps
Deploy Phi-4-mini model with ONNX Runtime on Azure Cobalt 100
Who is this for?
This is an advanced topic for developers, ML engineers, and cloud practitioners looking to deploy Microsoft's Phi Models on Arm-based servers using ONNX Runtime.
What will you learn?
Upon completion of this Learning Path, you will be able to:
- Quantize and run the Phi-4-mini model with ONNX Runtime on Azure.
- Analyze performance on Arm Neoverse N2-based Azure VMs powered by Cobalt 100.
Prerequisites
Before starting, you will need the following:
- A Microsoft Azure Arm-based instance
- Basic understanding of Python and machine learning concepts
- Familiarity with ONNX Runtime and Azure cloud services
- Knowledge of large language model (LLM) fundamentals
Summary
This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
onnxruntime_genai. You’ll then send text prompts and inspect the terminal metrics, including tokens per second and time to first token, to validate inference and assess basic performance on the Arm CPU.Frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
genai_config.json and model.onnx for the downloaded INT4-quantized Phi-4-mini model. With the provided download command, pass cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4 as the model path.follow_config, so that the script uses providers defined in the model config. Override only if you need to explicitly set a different provider, as the script clears providers when you do.--timings or -g, you’ll also see tokens per second and time to first token after sending a prompt.Dpls_v6 Cobalt 100 VM with 32 cores, 64 GB of RAM, and 32 GB of disk space.--max_length (or -l) when you run phi4.py. This limit includes both the prompt and generated tokens, so it isn’t a limit on the response alone. If you omit the option, the script uses a maximum length of 2048 tokens.