Let's get started with OpenAI playground and Chatgpt

chatgpt

In this article, we'll be using ChatGPT, remember, ChatGPT is the web-based application built on top of GPT-3.5 and GPT-4. ChatGPT is a chatbot that was released by OpenAI, the company. Now, OpenAI also makes available developer APIs that you can use to integrate your application with ChatGPT. You can use these APIs to build applications, integrate natural language conversation into any product that you offer your consumers, and do a whole host of other things. These APIs are available to all developers who sign up for the payment of a fee, and we'll talk about the pricing structure in just a bit.

But what if you want to explore and research the different models that are available from OpenAI, but you don't want to write code? Well, in that case, you won't use the APIs directly. Instead, you'll use the OpenAI Playground. And that's what we're going to explore next. The OpenAI Playground is a web interface that allows users to interact with OpenAI's GPT models, not just the latest one GPT-3.5 and GPT-4, but also older models that OpenAI has to offer. The OpenAI Playground is where developers, researchers, and anyone else who's interested can test the capabilities of these models and use them in research and development.

OpenAI playground:

The Playground is primarily meant for exploratory testing, application development, so you can use the different models and notice which one suits your use case and further research. Now you need to create an account and log in to the OpenAI Playground.  The OpenAI Platform is open in the browser. There are two options on the screen: Log in and Sign up.  The same login that you use for ChatGPT will work. So when I click on Log in, you can notice that it logs in with my Loony Test account. This is the same account that I used to sign up to ChatGPT. This same account I can use with the OpenAI Playground.

Now, before we actually explore the user interface of this web app, let's take a look at some of the links that we notice here on top. The first link here is the Overview link, which is the overview for the entire OpenAI platform. This will guide you through how you can build an app using ChatGPT APIs, how you can integrate conversational AI as a part of your products and solutions, how you can build a ChatGPT plugin, and a whole host of other things.

Now, of course, if you want to use OpenAI's developer platform, you need documentation. And that's what this next link is about. It'll tell you how you can generate an API key, how you can access the different models, how you can fine-tune the models, and all of the other cool details.

The API reference link here will give you a complete reference of all of the APIs that you can access on OpenAI, and all of the different programing languages and packages that you use to access OpenAI libraries. And here under this link, you'll find a number of different examples of prompts that you can use with ChatGPT: generating interview questions; a sarcastic chat bot; a memo writer; a turn-by-turn directions lesson plan writer. You can notice there are so many options here. These are all different use cases for using ChatGPT, and we'll study some of these in more detail in just a bit.


Meanwhile, you can also filter based on your use case. So these are some basic operations that you can have your chatbot perform: Extract, Generate, Transform, Code, Structured data. Let's select Transform. And here are all of the Transform examples. Let's click on one of these examples here, Improve code efficiency and you'll be presented with an example. You can notice what the input example is. There is some code that you give ChatGPT, and you ask it to improve the efficiency of your code. And you can notice what the API request for this looks like.

Now notice something about this API. When you send a request to the chat completion API, you can notice that we pass a model, a message, some temperature, some max_tokens. You can notice that we can really configure the parameters of the model and then generate a response.

We won't be writing any kind of code using OpenAI's APIs, but we'll be using its API via the Playground, which allows us to control the various parameters of the model using just a web interface. Here we are back in OpenAI Playground's web interface, and let's get ourselves oriented with this. On the left of your screen you can notice some instructions to get started. Just a couple of things I want to point out to you that requests submitted to the API via Playground will not be used to train or improve future models, since this is primarily for research purposes. Also, training cuts off in 2021, just like with ChatGPT. Let's close this so we have more room for our chats and responses, and let's explore further before we start using the Playground.

Now, the Playground gives you access to a variety of different models. Each model has different features, different capabilities, and they all have different prices. A token is just a unit that OpenAI uses to measure usage. A token does not correspond to a single word, but can be thought of as pieces of words. So their rough approximation is that a 1,000 tokens make up 750 words.

OpenAI also offers models for other purposes. Fine-tuning models are those that you can fine-tune on your own data and then use within your apps. You can notice there are different models here. There is the GPT-3.5, the davinci model, the babbage model, all of these refer to model names. There are Embedding models that allow you to do advanced search, clustering, and topic modeling. And there are less powerful Base models that are not great for conversational dialog, but better for very narrow tasks.

OpenAI also provides a tool for image generation using natural language, and that's called DALL·E. And Image models are essentially the ways you can use DALL·E to generate images from text. Now let's skip over all of these and go straight down to how you actually pay for these OpenAI APIs. If you have a brand new account with OpenAI linked to a new phone number, you get $5 worth of free credit that you can use for your first 3 months. Now, if your phone number has been used with another ChatGPT OpenAI account before, well, you won't get these free credits. You'll have to actually pay to use the APIs and thus the Playground.

The OpenAI Playground and OpenAI APIs offer a number of different models that you can use. How do you choose the right model? Well, GPT-4 or GPT-3.5 turbo are the most powerful models, and those are the models you'll likely pick by default. But there are other older models that you can evaluate on the Playground and then pick the right one for your use case.

Comments

Popular posts from this blog

Introduction to the fine tuning in Large Language Models

What are the impacts of data size and its quality on LLMs?

What are some ethical implications of Large Language models?