GPT-4 Makes Old ChatGPT Look Like a JOKE!

Nick Chapsas
15 Mar 202312:55

Summary

TLDRIn this video, Nick explores the newly released GPT-4 model by OpenAI, testing its capabilities in software engineering and solution architecture. As a Charge GBT Plus member, he dives into the model's advanced reasoning and conciseness, setting it a challenge to create a REST API for movies using C# and .NET 6, with PostgreSQL as the database. Impressed by its detailed and accurate responses, including handling DB update concurrency and suggesting secure practices for connection strings, Nick contemplates the potential impact on junior and mid-level developers' jobs, as GPT-4 demonstrates the ability to perform tasks traditionally requiring human expertise.

Takeaways

  • 🧑‍💻 The video introduces the new GPT-4 model by OpenAI, which is designed for chat and is available to the speaker as a Charge GBT Plus member.
  • 🔍 The speaker plans to test the GPT-4 model's capabilities in software engineering, solution architecture, and common questions that junior and senior developers would need to answer.
  • 📝 The GPT-4 model is tasked with creating a REST API in C# with .NET 6, using PostgreSQL for the database and Entity Framework for data access, demonstrating its ability to generate code and handle complex tasks.
  • 🛡️ The model correctly suggests using secret managers or environment variables for secure handling of connection strings, instead of storing them in plaintext.
  • 🔒 It provides detailed instructions for implementing secure practices with Azure Key Vault and suggests using environment variables for production settings.
  • 📚 The GPT-4 model offers comprehensive responses, including code examples and explanations, which are impressive for their depth and accuracy on the first attempt.
  • 📝 It also provides guidance on writing integration tests for the API using a web application factory, which could save developers significant time and effort.
  • 🔧 The model demonstrates knowledge of performance testing tools like k6 and provides a basic setup for load testing an API, showing adaptability to different testing scenarios.
  • 🏗️ It can generate Infrastructure as Code (IaC) scripts for deploying an API in AWS using Terraform, including services like RDS, ECR, and ECS with Fargate.
  • ⚠️ The model acknowledges the limitations of a single instance of Fargate tasks and suggests the need for scaling groups and an Application Load Balancer (ALB) to handle high traffic.
  • 🤖 The video concludes with the speaker expressing both excitement and concern about the capabilities of GPT-4, as it could potentially replace the work of junior and mid-level developers with proper oversight.

Q & A

  • What is the main topic of the video by Nick?

    -The main topic of the video is to explore and evaluate the capabilities of the newly released GPT-4 model by OpenAI, specifically in the context of software development tasks such as creating a REST API with C# and .NET 6.

  • What does Nick mention about his previous experience with the older model of GPT?

    -Nick mentions that his previous experience with the older model of GPT was impressive but not without its challenges. He had to try many times until it provided answers that made sense, indicating it wasn't perfect.

  • What is the significance of the GPT-4 model's ability to handle DB update concurrency exceptions?

    -The ability to handle DB update concurrency exceptions is significant because it shows the model's advanced understanding of common software development issues and its capacity to provide solutions that are robust and considerate of real-world scenarios.

  • What is the role of REST API in the context of the video?

    -In the context of the video, a REST API is used as a test case for the GPT-4 model to demonstrate its capability to generate code for creating, retrieving, updating, and deleting movie data, similar to platforms like Rotten Tomatoes or IMDb.

  • Why does Nick consider the GPT-4 model's response to be impressive?

    -Nick considers the GPT-4 model's response impressive because it provided a complete and correct code solution for creating a REST API on the first try, including handling of concurrency exceptions and proper RESTful route naming conventions.

  • What security issue does Nick identify with the GPT-4 model's initial code example?

    -Nick identifies a security issue with the GPT-4 model's initial code example where the connection string is stored as plain text in the app settings, which is considered a bad practice.

  • What is the GPT-4 model's suggestion to improve the security of the connection string?

    -The GPT-4 model suggests using secret managers like Azure Key Vault or AWS Secrets Manager, and loading sensitive information as environment variables to improve security.

  • How does Nick feel about the potential impact of AI tools like GPT-4 on software developers' jobs?

    -Nick expresses a mix of skepticism and fear about the potential impact of AI tools like GPT-4 on software developers' jobs, as he believes the tool could replace many tasks that junior and even mid-level developers perform, making the process more efficient.

  • What is the role of integration tests in the context of the video?

    -In the context of the video, integration tests are used to validate the functionality of the REST API created by the GPT-4 model, ensuring that the API works as expected when all components are combined.

  • What does Nick explore beyond .NET specific tasks in the video?

    -Beyond .NET specific tasks, Nick explores the use of the GPT-4 model for infrastructure as code (IaC) scripting, performance testing with k6, and scaling solutions to handle high loads, demonstrating the model's versatility.

Outlines

00:00

😲 Exploring GPT-4's Capabilities in Software Development

In this paragraph, Nick introduces his experiment with OpenAI's newly released GPT-4 model, emphasizing his excitement and lack of prior experience with this version. As a GPT Plus member, he has immediate access to the model and plans to test its capabilities in software engineering and solution architecture. He intends to ask the AI a series of questions that a junior or senior developer might encounter in their daily tasks. The paragraph highlights Nick's anticipation and the potential efficiency of GPT-4 compared to human developers.

05:02

🔒 Addressing Security Concerns with Connection Strings

The second paragraph delves into the issue of security when handling connection strings in application settings. Nick acknowledges the advice from a friend and seeks GPT-4's suggestions for more secure practices. The AI recommends using secret managers like Azure Key Vault for local and production environments, providing code examples for implementing these solutions. It also covers platform-specific settings and the importance of scoping the secret management tools to the service in use.

10:02

🚀 Scaling Infrastructure for High-Demand Applications

In the third paragraph, Nick discusses the need for infrastructure that can handle a high volume of requests, specifically 10,000 requests per second. He asks GPT-4 to provide Infrastructure as Code (IAC) scripts for deploying an API in AWS using Terraform. The AI suggests using RDS for the database, ECR for Docker image registry, and ECS with Fargate for running the service. It also addresses the need for scaling by recommending the use of an ECS service with an Application Load Balancer (ALB) to manage the load.

Mindmap

Keywords

💡GPT4

GPT4 refers to the fourth generation of the GPT (Generative Pre-trained Transformer) model developed by OpenAI. It is designed to have advanced capabilities in reasoning and conciseness, though it may not be as fast as previous models. In the video, the host tests GPT4's ability to create a REST API and handle various programming-related tasks, showcasing its potential to assist or even replace certain developer roles.

💡REST API

A REST API (Representational State Transfer Application Programming Interface) is a set of rules for structuring and interacting with web services. It allows for the creation, retrieval, updating, and deletion of data, typically used for web applications. In the video, the host asks GPT4 to create a REST API for managing movies, which would be similar to functionalities found on platforms like Rotten Tomatoes or IMDb.

💡C# and .NET 6

C# is a programming language developed by Microsoft, and .NET 6 is a cross-platform, open-source framework for building various types of applications. The video discusses using C# and .NET 6 to create a REST API, highlighting the technical stack that the host is working with and the capabilities of these technologies in developing web services.

💡Postgres

Postgres, often referring to PostgreSQL, is a powerful, open-source object-relational database system. It is known for its stability and feature-richness. In the context of the video, Postgres is suggested as the database for the REST API, indicating the need for a robust database solution to handle data storage and retrieval.

💡Entity Framework

Entity Framework is an object-relational mapper (ORM) for .NET that enables developers to work with relational data using domain-specific objects. It is used for data access in the video's scenario, where GPT4 is instructed to generate code that includes a 'MovieDBContext' for interacting with the database.

💡Startup.cs

In the context of .NET applications, Startup.cs is a file that contains configuration and setup code for the application. It is mentioned in the video where GPT4's generated code includes the use of Startup.cs, which was relevant at the time of the model's training, to configure services and the request pipeline.

💡Concurrency

Concurrency in programming refers to the ability of different parts of a program to execute independently, potentially at the same time. In the script, GPT4's generated code handles database update concurrency exceptions, which is crucial for maintaining data integrity when multiple users are interacting with the system simultaneously.

💡Infrastructure as Code (IaC)

Infrastructure as Code (IaC) is a methodology for managing and provisioning computer data centers through machine-readable definition files, rather than interactive configuration techniques. In the video, the host asks GPT4 to write IaC scripts for deploying an API in AWS using Terraform, demonstrating the application of IaC in cloud environments for automation and consistency.

💡Terraform

Terraform is an IaC tool developed by HashiCorp that allows for the creation, modification, and versioning of infrastructure through code. It is mentioned in the video as the tool the host wants to use for scripting the deployment of the API in AWS, emphasizing the shift towards automation in infrastructure management.

💡ECS and Fargate

ECS (Elastic Container Service) and Fargate are services provided by AWS that enable the deployment of containerized applications. ECS manages the container orchestration, while Fargate is a serverless compute engine for containers. In the video, GPT4's generated IaC scripts include the use of ECS and Fargate for deploying the API, showcasing the use of these services for scalable and efficient deployment.

💡Load Testing

Load testing is the process of putting demands on a system to measure its performance under both normal and peak conditions. It is crucial for understanding how an application behaves under stress. In the video, the host asks GPT4 to write a performance test for the API using k6, a load testing tool, to ensure that the system can handle expected traffic and usage.

Highlights

Introduction of the new GPT-4 model by OpenAI and its potential to outperform human developers in certain tasks.

The presenter, Nick, is a charge GBT plus member and has access to the GPT-4 model for testing.

Comparison of the GPT-4 model with the default and Legacy models, highlighting its advanced reasoning and conciseness.

Rate limiting of the GPT-4 model to 100 messages every four hours due to computational intensity.

Creation of a REST API using C# and .NET 6 for managing movies and ratings, demonstrating GPT-4's coding capabilities.

Inclusion of proper async programming and handling of DB update concurrency exceptions in the API code.

Correct naming conventions for REST API routes and proper use of location headers for resource creation.

Provision of a comprehensive explanation and documentation alongside the generated code.

Discussion on the security implications of storing connection strings in plaintext and suggestions for improvement.

Recommendation to use Azure Key Vault or other secret managers for securing connection strings.

The model's ability to generate detailed code for AWS integration, including the use of AWS Secret Manager.

Generation of integration tests for the API using the Web Application Factory, saving developers time.

Performance testing of the API using k6, with the model providing a valid and detailed test script.

Infrastructure as Code (IAC) scripts for deploying the API in AWS using Terraform, showcasing the model's versatility.

Discussion on scaling the API to handle 10,000 requests per second with ECS and ALB configurations.

Reflection on the potential impact of GPT-4 on the job market for developers and the efficiency it could bring.

The presenter's mixed feelings of skepticism, fear, and excitement about the capabilities of GPT-4.

Transcripts

play00:00

this basically eliminates the need of

play00:02

having some major or Junior developer

play00:04

doing the work for you and in many cases

play00:07

this might actually be faster and more

play00:09

efficient than that developer hello

play00:11

everybody I'm Nick and in this video I'm

play00:13

going to try the brand new gpt4 model

play00:15

that was just released by openai in chat

play00:18

GPT now I am a charge gbt plus member so

play00:22

I can already use it as you can see it

play00:24

is an option in this drop down however I

play00:26

haven't tried it at all I just woke up

play00:29

to the announcement and I'm walking into

play00:30

this blind the previous video I made on

play00:33

chart gbt with the old model was

play00:35

impressive but at the time of recording

play00:37

I had already tried the model and knew

play00:39

what it could it could not do and I had

play00:41

to tried many many times until it

play00:44

eventually got to the right answers that

play00:47

made sense needless to say it wasn't

play00:49

great in this video I will only give it

play00:51

a single chance and I have a set of

play00:54

questions I want to ask it both in

play00:56

software engineering and solution

play00:58

architecture and scrubby questions about

play00:59

Junior made and Senior developers would

play01:02

need to answer as part of the day job if

play01:04

you like to have content and you want to

play01:06

see more make sure you subscribe bring

play01:07

this notification Bell and for more

play01:09

training check out Nick chapsters.com

play01:10

alright so let's see what we have here

play01:12

so we have these three models right the

play01:14

default which is supposed to be fair and

play01:17

reasoning very fast and not really

play01:19

concise then you have the Legacy model

play01:21

which I don't know if it was the

play01:24

original GPT or not but it seems to be a

play01:27

previous charge GPT plus model which has

play01:29

different characteristics and then gbt4

play01:31

which supposed to be the most advanced

play01:33

where you have excellence in reasoning

play01:35

and conciseness but it's not as fast and

play01:38

we're gonna use that oh interesting so

play01:40

the first thing I see here is that

play01:41

there's a cap of 100 messages for every

play01:44

four hours so I guess they're rate

play01:47

limited because of how much

play01:48

computationally intense it is so what

play01:50

I'm going to ask it as the first

play01:52

question is please create a rest API

play01:54

with C sharp and Dot net 6 that allows

play01:56

users to create retrieve update and

play01:58

delete movies and also write write them

play02:00

think Rotten Tomatoes or IMDb an API for

play02:04

those things where you can list a movie

play02:05

and rate it and then use postgres for

play02:07

the database and empty framework for the

play02:09

data access and the framework is like an

play02:11

oramin.net so let's see what can do with

play02:13

that so straight away just like before

play02:16

we have the same stream response and I

play02:19

would say it's equally as slow so let's

play02:21

wait and see what it spits out profiles

play02:24

are good everything here is things I

play02:26

would do so we have the settings we get

play02:29

the whole file previously sometimes you

play02:30

would get it sometimes you would only

play02:32

get the line you need to add you have

play02:35

the model and it is using NT framework

play02:37

which allows you to have nested objects

play02:39

that point into other objects and

play02:41

generated database on demand then it

play02:44

knows to make a movie DB context as well

play02:46

movies and ratings great now it's going

play02:49

to use the startup.cs which we don't

play02:51

really use anymore in c-sharp but given

play02:54

when this was trained this was very much

play02:56

relevant now one of the things I

play02:58

wouldn't do in that startup.cs is run

play02:59

migrations there and would actually have

play03:01

them in the program.cs but that is not a

play03:04

huge mistake I'd say or go straight away

play03:06

into using a controller it injects the

play03:08

DB context and then it uses async

play03:10

programming properly oh that's

play03:12

impressive for update movie it also

play03:14

handles DB update concurrency exceptions

play03:17

which many people would actually forget

play03:18

to cover so that's pretty cool and then

play03:21

it knows to name things like the routes

play03:24

appropriately as a rest API should which

play03:27

is the plural of the entity you're

play03:29

trying to deal with or the resource

play03:30

you're trying to deal with and then it

play03:32

correctly points to the action that is

play03:34

supposed to give you the location header

play03:37

to indicate that on movie creation

play03:39

that's where you can find your movie so

play03:40

that's really really impressive oh and

play03:42

fantastic in the end we also get an

play03:44

explanation like a documentation of

play03:46

everything I'm gonna tell you what

play03:48

except for the thing where I had to

play03:50

explicitly say continue when the thing

play03:52

stopped this is a perfectly valid

play03:55

response that you can actually use and

play03:57

you wouldn't be in any way wrong can

play03:59

would this be done better sure but

play04:01

you're walking into more opinionated

play04:03

routes this is one of the most generics

play04:05

way you can do that and it's absolutely

play04:06

fine and it's the first try all right

play04:09

let's see how we can make it go further

play04:10

one of the biggest problems with this is

play04:12

that the connection string is a raw

play04:14

string with passwords and usernames as

play04:16

plain text in the app settings.json file

play04:19

usually what you would do is you would

play04:20

actually use a Secrets manager like

play04:22

Azure key Vault or AWS Secrets manager

play04:24

or you would load them as environment

play04:26

variables scope to that specific service

play04:28

so what I want to ask it is what every

play04:31

developer might ask hey so my mate said

play04:33

that having connection strings in the

play04:35

settings as a clear text is a bad

play04:37

practice any suggestions on how to make

play04:39

that more secure

play04:40

let's see what it says your mate is

play04:43

correct oh cheers mate interesting so it

play04:46

acknowledges that it is not secure and

play04:49

it suggests secret managers like Azure

play04:51

key Vault or other tools interesting

play04:54

that it is azure biased and I didn't get

play04:57

any other suggestion like

play04:58

um AWS ones oh that's so cool so for

play05:02

local development use secret manager

play05:04

tool and what am I supposed to use for

play05:05

production oh environment variables it

play05:08

is not wrong as long as there's a scope

play05:10

to the thing that's loading them that's

play05:12

absolutely fine and it also suggests

play05:14

Azure key Vault and it gives me the code

play05:16

that is nuts I'm wondering if the

play05:19

Microsoft money make it be more Azure

play05:21

biased than AWS biased okay I'm gonna go

play05:25

a bit off the scripted questions because

play05:26

I want to see if it can do this with AWS

play05:29

as well actually we are using AWS in my

play05:32

company and I'm just gonna tell you that

play05:34

in the previous oh my God straight away

play05:37

AWS secret manager in the previous video

play05:40

I had to really guide it and really put

play05:42

things into context for it to act

play05:45

actually give good results

play05:46

this just goes into hey here's the

play05:50

documentation read about Secrets manager

play05:51

add the nuget package oh my God and I've

play05:56

not said goes way more in depth into the

play05:59

thing it is talking about the previous

play06:00

method will just give you way less text

play06:03

and basically tell you for the rest just

play06:06

figure it out here we're getting

play06:08

everything actually nuts

play06:11

I I I have no words Jesus the detail it

play06:16

goes into even window specific and then

play06:19

I guess Linux or Mac specific settings

play06:22

like these are right things if I copy

play06:25

this it will take me to my credentials

play06:27

file for WS this is nuts okay what if I

play06:30

want integration tests write integration

play06:32

test for the API using the web

play06:34

application Factory let's just see some

play06:37

tests the reason why I'm so excited

play06:38

about this is this will save me so much

play06:41

time there is so much code I and many

play06:44

developers I'm sure have to write that

play06:46

is like this that to a degree is roughly

play06:49

the same but not exactly the same So

play06:51

based on how good this is It's Gonna

play06:54

Save Me so much time and it makes the

play06:56

money I pay for charge GPT plus were

play06:59

actually worth it and here's what I

play07:00

think about this up until now when

play07:02

people were asking me will this replace

play07:04

people's jobs I would say no I don't

play07:07

think so you still need someone who

play07:08

knows enough to babysit it and review

play07:11

things but thinking about this I can

play07:14

totally see someone making a tool that a

play07:17

developer an actual developer can go

play07:18

into a GitHub repo create an issue say

play07:22

that's what the issue is go fix it then

play07:25

a chart GPT bought using the API can go

play07:28

in read the issue act and then create a

play07:31

pull request and then it's just the

play07:34

developer reviewing the pull request and

play07:36

charge gbt fixing it automatically as

play07:38

you go this basically eliminates the

play07:40

need of having some mid or Junior

play07:43

developer doing the work for you and in

play07:46

many cases this might actually be faster

play07:48

and more efficient than that developer

play07:50

so

play07:51

I'm a bit skeptical and scared okay

play07:55

everything it said in principle here is

play07:57

correct I'm pretty sure I can ask you to

play07:59

say add more tests and it can do that

play08:02

for me now would I validate here for

play08:05

headers like this specific header I

play08:07

wouldn't I would check for the response

play08:09

and see that the object is what I want

play08:11

it to be so it is not awesome but it

play08:13

gives you a framework to work on okay

play08:15

fine now when I go a bit outside of dot

play08:17

net specific things and say okay right

play08:19

performance test for this API using k6

play08:21

k6 it's a performance testing tool that

play08:23

was actually bought by grafana straight

play08:25

away links to the documentation and

play08:27

actually is this a valid link

play08:29

it is a valid link that is so cool yeah

play08:33

that looks like exactly how a k6 project

play08:36

looks like how a file looks like it even

play08:39

ramps app to Virtual users slowly I

play08:41

didn't give it any instructions so this

play08:43

is more of a load test where you

play08:45

gradually go into your normal load

play08:48

maintain 20 virtual users then stay

play08:50

there for a minute and then go lower and

play08:52

then go all the way down and it knows

play08:54

how to call it because it has context on

play08:57

those API endpoints oh and like I said

play09:00

yeah it acknowledges that this is a load

play09:02

test scenario you can have other tests

play09:03

as well like soak tests Spike tests so

play09:06

many okay let's go beyond what a mid

play09:08

original developer would do and let's

play09:10

talk about some infrastructure as code

play09:12

where it is time to deploy the

play09:14

application and we need to script out

play09:16

our infrastructure because you wouldn't

play09:17

go into the Azure portal or the AWS

play09:20

console and do things manually you would

play09:22

use something like terraform to script

play09:24

out the Avi so I'm going to say it's

play09:26

time to deploy the API in AWS my company

play09:28

is using terraform can you write the IAC

play09:30

scripts necessary to deploy the API in

play09:33

AWS let's say that's something I've

play09:35

never asked in the past I've never asked

play09:37

in the previous video I go off rails now

play09:40

to see how far I can push it and it

play09:42

looks like it just does it it chooses

play09:44

RDS for postgres ECR for the registry

play09:47

for the docker image so it will actually

play09:49

build other Docker image and elastic

play09:51

container service which is the things I

play09:54

have used in the past to run such apis

play09:56

it even keeps the context allow inbound

play09:59

traffic for the movie API oh and it's

play10:02

also gonna use fargate which is an

play10:04

excellent option for something like this

play10:05

these are all valid environment

play10:07

variables that is nuts and it gets the

play10:10

connection string as an environmental

play10:12

variable for the container which is a

play10:15

decent approach and other better ones

play10:17

sure you can use other Secrets manager

play10:19

and then the value here would be the key

play10:21

of the secret in secret manager so we

play10:23

can actually ask it to improve on this

play10:25

but I'm not gonna do that because I'm

play10:27

sure it will do it and even this is not

play10:30

a bad approach especially if you use the

play10:32

right access policies but what I'm

play10:34

really curious to do is I'm gonna tell

play10:36

it here's the thing my manager said this

play10:39

needs to handle 10 000 requests per

play10:41

second

play10:42

is this good enough because I can see

play10:45

from desire account that this will only

play10:46

run one service one instance of the

play10:49

service in fargate and even though there

play10:51

is a load balancer there isn't some Auto

play10:53

scaling from what I can see here so

play10:55

let's wait for this to finish and let's

play10:58

ask it about scaling okay it is finished

play11:00

and I am so impressed let's ask it that

play11:03

question 10 000 requests per second can

play11:06

you handle it

play11:07

the provider from scripter likes of a

play11:09

single instance of fargate tasks which

play11:11

might not be able to handle no ten

play11:13

thousand requests per second to handle

play11:15

such load you need another scaling group

play11:17

for ECS service and configure an ALB

play11:22

look I'm having a bit of an existential

play11:25

crisis here because I cannot tell you

play11:29

how hard I had to try with the previous

play11:31

model to get it to give good results it

play11:34

would do great in small things but in

play11:37

the bigger picture we just lose it

play11:40

this is

play11:42

actually insane like truly what I'm

play11:46

seeing here is it can do everything a

play11:47

junior developer can do mid developer

play11:50

and to be honest with this more than

play11:52

what a senior developer would also do so

play11:55

as long as you have someone who's

play11:56

competent enough to review things this

play11:59

could replace a lot of people and it

play12:01

sucks to say but it is true and

play12:03

companies are opportunistic even if what

play12:07

I'm seeing here is not 100 right

play12:09

conceptually it is and I can take that

play12:12

and slightly modify it and be there so

play12:15

I'm skeptical I'm scared but I'm excited

play12:18

to see what's going on web3 never had

play12:21

the chance this does look I'm going to

play12:24

stop here because I'm sure that at this

play12:26

point anything I ask it will do I think

play12:29

it answered every single one of those

play12:31

questions at first try perfectly

play12:34

definitely way better than the previous

play12:36

model so I'm just gonna leave this here

play12:38

and ask you a question what do you think

play12:40

about this like

play12:43

was one thing but this is a whole

play12:46

different Beast well that's all I have

play12:48

for you for this video thank you very

play12:50

much for watching and as always keep

play12:52

coding Jesus

Rate This

5.0 / 5 (0 votes)

Étiquettes Connexes
AISoftware DevelopmentGPT-4REST APIC#.NET 6PostgresDockerECSInfrastructure as CodePerformance TestingWeb3Developer ToolsAutomationCode ReviewTech ReviewNick Chapman
Besoin d'un résumé en anglais ?