DEV Community

El Bruno for Microsoft Azure

Posted on • Originally published at elbruno.com on

Powering Up #NET Apps with #Phi-3 and #SemanticKernel

Hi!

Introducing the Phi-3 Small Language Model

Phi-3 is an amazing Small Language Model. And hey, it’s also an easy one to use in C#. I already wrote how to use it with ollama, now it’s time to hit the ONNX version.

Introduction to Phi-3 Small Language Model

The Phi-3 Small Language Model (SLM) represents a significant leap forward in the field of artificial intelligence. Developed by Microsoft, the Phi-3 family of models is a collection of the most capable and cost-effective SLMs available today. These models have been meticulously crafted to outperform other models of similar or even larger sizes across various benchmarks, including language understanding, reasoning, coding, and mathematical tasks.

Phi-3 models are not only remarkable for their performance but also for their efficiency and adaptability. They are designed to operate across a wide range of hardware, from traditional computing devices to edge devices like mobile phones and IoT devices. This makes Phi-3 particularly suitable for developers looking to integrate advanced AI capabilities into applications that require strong reasoning, limited compute resources, and low latency.

C# Phi3-Labs GitHub Repository

The GitHub repository in question serves as a practical guide for developers looking to harness the power of the Phi-3 SLM within their applications. It provides a set of sample projects to demonstrate how to use Phi-3 and C#.

  • LabsPhi301. This is a sample project that uses a local phi3 model to ask a question. The project loads a local ONNX Phi-3 model using the Microsoft.ML.OnnxRuntime libraries.
  • LabsPhi302. This is a sample project that implements a Console chat using Semantic Kernel.
  • LabsPhi303 (Comming soon!). This is a sample project that uses Phi-3 Vision to analyze images.

The repository contains detailed instructions for setting up the development environment, cloning the necessary models from Hugging Face, and installing the Phi-3 model.

You can learn more about Phi-3 in Hugging Face.

A final running application will look like this.

(

Chat demo
)

Happy coding!

Greetings

El Bruno

More posts in my blog ElBruno.com.


Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay