Featured image of post Build your own simple ChatGPT

Build your own simple ChatGPT

Great video about how to use a LLM AI in code!

Build your own simple ChatGPT in very little time

There’s a real hype around the usage of AI, specifically LLM (Large Language Models) with ChatGPT. But at the same time, very few people actually dive into how these AI’s work. Here’s a solution that will take about half an hour and should give you a good idea of what actually goes on in this type of AI.

Ken from the Code to the Moon Youtube channel published a great short but sweet video on how to use a LLM in Python to generate a response to an input. It’s backed by Huggingface’s Transformers library, allowing you to easily download and use pretrained models. (which is good, because training models is the expensive part of LLM AI development).

Even in such a short video, he manages to illustrate the most important concepts (tokenization, vectors et cetera) well. I highly recommend watching this one if you haven’t used LLM’s in code before and need a good introduction.

All you need for this one are Python and a code editor. It requires 2 dependencies (pip install transformers & pip install torch) and the download of a pretrained model. The base model shown is pretty small and fast, but do note that the recommended Google Flan-T5 XL model is a 12GB download.

Built with Hugo
Theme Stack designed by Jimmy