If you prefer video, there is a YouTube version of this blog-post.
Since the release of LLMs, I have been extremely enthusiastic about exploring such a fun tool to play with. I won’t delve into discussions about how transformative it is or will be, but rather focus on the enjoyable aspect of using this technology.
In the broader context of ML/AI and data science, Python stands out as the most commonly used programming language. Despite my open-source enthusiasm, I have always found C# to be remarkable. With the introduction of Mono.NET and later dotnet core, I have happily used it in Linux environments. It’s no surprise that when working on projects related to ML/AI, C# and .NET are my preferred choices.
Over the past few months, I’ve transitioned from being a mere user to someone who shares what I’ve learned. I find the topics of evaluating models and Responsible AI particularly fascinating. I’ve created some code samples that I’m excited to share.
However, in line with my approach to sharing knowledge in other topics, I prefer to establish a common ground or baseline understanding. Therefore, I’ve decided to start from the ground up, sharing and teaching how to build a small tool based on OpenAI or other LLMs. I’ll then progress to unit testing, evaluating models, and observability – all in C# and dotnet. I acknowledge that there are already numerous Python projects in this space, and it is my desire to include the dotnet community.
So, buckle up! This will be a 4-5 post series, and I may even record a couple of videos for the first time in my life.
Prerequisites
Knowledge
- Understanding of what OpenAI is and the concept of a LLM.
- Optional but highly recommended basic knowledge of Azure (primarily for deploying an Azure OpenAI model).
- Familiarity with C# and .NET (expertise is not necessary; basic understanding will suffice).
- Know how to Google/Bing/search the internet. If any section does not have detailed instructions is on purpose, there is maybe plenty of articles already out there of how to do that specific step.
Tech stuff
- A computer with Mac, Linux or Windows
- dotnet 8.0 installed, or, a docker enabled machine, or, a github account
- This tutorial will use VSCode, but any editor (vim, visual studio code, notepad++, wherever) should suffice.
The Idea Overview
I have decided we will build a short post content generator. Think of something to generate tweets/toots, mastodon posts, or LinkedIn posts, but very short (100-200 characters). Feel free to build something different, I actually encourage to try something different, this tutorial should be still helpful.
We will provide 3 inputs: style, topic, and persona field. The prompt would look like this:
You are a
expert. Generate a short tweet in a