Naveen Krishnan

Naveen Krishnan

Introduction

The Phi-3 family of small language models (SLMs) offers powerful and cost-effective solutions for various AI applications. In this blog, we’ll walk you through the steps to deploy a Phi-3 model as a serverless API on Azure OpenAI and provide a sample Python code to invoke the model. We’ll also cover how to set up Python on your local laptop to run the code.

Prerequisites

  1. An Azure account.
  2. Access to Azure AI Studio.
  3. Basic knowledge of Python.

Step 1: Deploying Phi-3 Model on Azure OpenAI

  1. Sign in to Azure AI Studio: Go to the Azure AI Studio and sign in with your Azure account.
  2. Select Model Catalog: From the left sidebar, select “Model catalog”.
  3. Choose Phi-3 Model: Search for and select the Phi-3 model you want to deploy (e.g., Phi-3-mini-4k-Instruct).
  4. Deploy Model: Click on “Deploy” and choose the “Serverless API” option to open the deployment window.
  5. Configure Deployment: Follow the prompts to configure your deployment settings and complete the deployment process.

Step 2: Sample Python Code to Invoke the Phi-3 Model

Once the model is deployed, you can use the following Python code to invoke the model:

Read More: Visit Medium.com