Microsoft recently introduced Phi-3, a family of open AI models.

Building a custom Copilot powered by Microsoft’s Phi-3 SLM is a powerful way to create a personalized AI assistant. By using Copilot Studio and Azure AI Studio, you can test, and deploy your own Copilot with ease. Whether you’re creating a chatbot, a virtual assistant, or any other kind of AI-powered application, these tools make it easy to bring your ideas to life.

Phi-3 models are the latest addition to the growing portfolio of small language models (SLMs) offered by Microsoft. These models are notable for being both highly capable and cost-effective, outperforming other models of the same size and next size up across various benchmarks.

The introduction of Phi-3 models expands the selection of high-quality models available to customers. This addition offers more practical choices for developers as they compose and build generative AI applications.

With Phi-3, developers now have a wider range of models to choose from, allowing them to tailor their AI applications to specific requirements and tasks.

In this post, we are going to explore the Phi-3.

Overview:

Login to Azure AI Studio to see the availability of Phi-3:

The purpose of this post is to introduce Phi-3 and to expand upon its features and capabilities by demonstrating them through a DEMO.

To know more about Phi3 features, refer this link: Introducing Phi-3: Redefining what’s possible with SLMs | Microsoft Azure Blog

If you are new to Gen AI, and have not explored my recent blogs, please refer below posts.

Getting started with Azure AI Studio

Create your own Copilot that uses your own data with an Azure OpenAI Service Model

Prerequisites

Demo:

Let’s follow the step-by-step process:

Summary of steps:

  • Login into Azure AI Studio and Create a new project.
  • Deploying the Phi-3-mini-4k-instruct Model with Azure AI Studio.
  • Test the Phi-3 model in Playground.
  • Building the Copilot with Copilot Studio
  • Configure your Copilot Topics (System -> Fallback <on Unknown Intent>)
  • Test the copilot and publish and choose the channel to deploy.
  • Add your website to this Assistant Chatbot.
  • Validate your own Custom Copilot (that uses Phi-3-mini-4k-instruct Model)

Let’s start the step-by-step process.

Login into Azure AI Studio and Create a new project.

Once created, you will see the page below.

  • Open the Phi-3-mini-4k-instruct model from the Model Catalog

Deploying the Phi-3-mini-4k-instruct Model with Azure AI Studio

See the progress:

Note down the REST endpoint and Authentication key for future use.

Once provisioned, you will see below screen, but wait until you see Provisioning state is complete (shows green)

Test the Phi-3 model in Playground.

Building the Copilot with Copilot Studio

Login into Copilot Studio and create a copilot.

Configure your Copilot Topics (System -> Fallback <on Unknown Intent>)

Navigate to Topics

Below is the default Trigger and workflow.

Delete the activities except the Trigger.

  • Add Send HTTP request activity from Advanced and pass the request body, endpoint, API key for the Phi-3 model.
  • Edit headers and body and enter the required parameters as below.
Prefix will be { "input_data": { "input_string": [ { "role": "user", "content": "
Suffix will be" } ], "parameters": { "top_p": 0.9, "do_sample": true, "temperature": 0.7, "max_new_tokens": 900 } } }
Request body variable will be Concatenate(Topic.prefix,System.LastMessage.Text,Topic.suffix)

Add Prefix:

Add Formula:

Add for Suffix and ReqBody

Now, let’s add for Http Request:

https://rajeevkumar-customcopilot-lhxdg.eastus2.inference.ml.azure.com/score

note: this HTTP request is deleted as part of the Resource clean up process

Add below settings:

Check/Click Edit

Http Post:

  • Send the response from SLM model via Send message activity

Finally, it will appear as below:

Complete Workflow:

Publish and choose the channel to deploy.

Select Goto Channels and Publish

Add your website to this Assistant Chatbot.

Test your custom copilot

I updated the below option:

Update Generative answers.

See the changes:

Conclusion:

Building a custom Copilot powered by Microsoft’s Phi-3 SLM is a powerful way to create a personalized AI assistant. By using Copilot Studio and Azure AI Studio, you can test, and deploy your own Copilot with ease. Whether you’re creating a chatbot, a virtual assistant, or any other kind of AI-powered application, these tools make it easy to bring your ideas to life.

With Microsoft Copilot Studio, you can publish bots to engage with your customers on multiple platforms or channels. These include live websites, mobile apps, and messaging platforms like Microsoft Teams and Facebook.

After you’ve published at least once, you can connect your bot to more channels.

We will explore this topic in an upcoming post.

Stay tuned for future posts on AI as we continue to explore this exciting field.

Happy learning!

References:

Introducing Phi-3: Redefining what’s possible with SLMs | Microsoft Azure Blog

Leave a Reply

Discover more from Rajeev Singh | Coder, Blogger, YouTuber

Subscribe now to keep reading and get access to the full archive.

Continue reading