GPT 3

Building my first GPT 3 App with Open AI Playground



Greg Raiz

I’m going to show you GPT3 playground and how I built my very first GPT3 based application. GPT3 is amazing and this tutorial will take you into the magic and give you the basics of prompt design and examples of how the tech can be applied in python.

I’ve made the Google Colab and Github repos available here:

Google Colab notebook example:
https://colab.research.google.com/drive/1TyuTvjs0hghYqRtUMZqUEp45AvlKWUxR?usp=sharing

Github Cbot command line example
https://github.com/graiz/cbot

Blog post with additional details:
https://gregraiz.com/building-a-command-line-application-using-gpt3/

How do you get an API key?
You have to apply for a key on OpenAI: https://beta.openai.com/
If you’re waiting you can play around with GPT2. I have a video on how that works here: https://www.youtube.com/watch?v=R6KoIp1ETpM

Follow me on twitter http://www.twitter.com/graiz
I also have a blog and discord channel if you want to connect with me:
https://www.gregraiz.com

– GPT 3 demo of how to use the Open AI playground
– GPT 3 demo of using Google Colab with OpenAI
– GPT 3 demo of exporting an app to Python
– GPT 3 demo some of the problems with Open AI
– GPT3 demo of command line auto-complete from English to shell commands

The entire experience of building a GPT3 application is incredibly easy. That being said there are a lot of limits on what GPT3 currently does.

The core of the GPT3 experience is a single screen called the playground, this is where you can send commands, adjust the sliders and settings and see responses. The rest of the interface is example prompts that fill-in data from the playground and documentation.

The core of GPT3 is that it’s a very sophisticated auto-complete. So when designing a prompt or playing with the playground, you want to give it as much context to complete your text in a meaningful way.

After playing around in the playground, I wanted to build an actual app that I could use on a regular basis. I’ve been trying to use the command line more to keep my hands on the keyboard and keep from dragging/dropping files around but I would often forget the more obscure commands.

I decided to build a bot that would help me find those commands based on simple english querries like.
– How do you install a program
– How do you change permissions on a file
– How do you copy files or pretty much anything else.

I started in the playground and got a very basic version working. OpenAi gives you tools to export the code and I did that into Google Collab. This is an interactive way to run/test and edit python. This was my first python program I’ve written so the interactive nature was helpful in playing around with basic concepts and getting the bare bones of the program running.

From there I was able to copy the code to my computer and get it working even better. I made this utility that I call cbot, I’ve made it open source and available to try. Unfortunately you do need an OpenAI API key to use it. This is unfortunate because it makes it difficult for developers to create and share open source tools that leverage OpenAI.

So far cbot has been really useful for looking up obscure commands and allows me to stay in the flow rather than jumping around the web trying to look up commands. My big takeaways from building my first GPT3 application:

1 – Getting started is incredibly easy and a lot of fun. I played around with how AI could be applied to ordering systems, explaining medicines in plain english to patients, grammar correction, and authoring Seinfeld fan-fiction scripts. I’m excited because there’s a lot of interesting applications and the technology is very accessible.
2 – It’s not magic and it’s not perfect. It would often go off on a tangent and occasionally get stuck in a loop. There are controls to adjust how it will perform, but tweeking these controls seems to be an art, not a science.
3 – Developers should think of OpenAI as infrastructure. Similar to AWS, or Azure, it’s providing pieces of functionality for your product/application. It’s also a dependency and a point of failure. If you’re starting a business using GPT3 you need to consider your long-term advantage and moat for your company because application of this technology will become common place.
4 – After playing with GPT3, I’m less concerned about the tech becoming self-aware and taking over the world. It’s really impressive but it still has a long way to go. As I said before, the PT in GPT stands for pre-training and in the current version you’re not yet able to upload large sets of data to fine tune the model. This is something that OpenAI is working on but it’s got a way to go.
5 – Lastly – We are at the very start of something really big. If someone with no prior python experience can whip together an app that harnesses the collective knowledge of the web, just imagine where the technology can go.