1
00:00:00,000 --> 00:00:01,000
Hello guys!

2
00:00:01,000 --> 00:00:02,000
So welcome to the Langshan series.

3
00:00:02,000 --> 00:00:06,000
And in this video we are going to get started with Langshan and OpenAI.

4
00:00:06,000 --> 00:00:08,000
Uh, here.

5
00:00:08,000 --> 00:00:12,000
This video is super important because some of the important modules that are available in Langshan will

6
00:00:12,000 --> 00:00:15,000
be setting it up like Lang, Smith and Lang serve.

7
00:00:15,000 --> 00:00:21,000
Along with that, uh, you'll be seeing in series of videos, we will be building a sample application,

8
00:00:21,000 --> 00:00:24,000
uh, simple sample application with the help of Lang Jin.

9
00:00:24,000 --> 00:00:27,000
Uh, there we are going to use OpenAI models.

10
00:00:27,000 --> 00:00:33,000
Uh, along with that, if you do not have OpenAI API key, then you can also go ahead and use open source

11
00:00:33,000 --> 00:00:36,000
models that also I'll show you with the help of llama.

12
00:00:36,000 --> 00:00:42,000
Uh, again, the main aim over here is to make sure that what all tools we are going to use in this

13
00:00:42,000 --> 00:00:48,000
entire course, I'm going to probably do that entire setup right now, so that you will be able to follow

14
00:00:48,000 --> 00:00:50,000
all the lectures as we go ahead.

15
00:00:50,000 --> 00:00:52,000
So let me just go ahead and share my screen.

16
00:00:52,000 --> 00:00:56,000
So here, uh, in this video what all things we are going to do.

17
00:00:56,000 --> 00:00:58,000
So first of all we are going to get started with Lang Chain.

18
00:00:58,000 --> 00:01:02,000
And let me just go ahead and right and open I okay.

19
00:01:03,000 --> 00:01:08,000
Uh, in this quick start we'll show how to get uh like we'll see how to get set up with Lang Chain,

20
00:01:08,000 --> 00:01:10,000
Lang Smith and Lang serve.

21
00:01:10,000 --> 00:01:14,000
So we'll be discussing about all these three, uh, modules, important modules that are present in

22
00:01:14,000 --> 00:01:15,000
Lang chain.

23
00:01:15,000 --> 00:01:21,000
Then, uh, use the most basic and common component of lang chain like prompt templates model and output

24
00:01:21,000 --> 00:01:22,000
parser.

25
00:01:22,000 --> 00:01:27,000
Then we are going to build a sample app, a simple application sorry with Lang chain.

26
00:01:27,000 --> 00:01:31,000
And then we are going to trace our entire application with the help of Lang Smith.

27
00:01:31,000 --> 00:01:31,000
Right.

28
00:01:31,000 --> 00:01:36,000
If you really want to do debugging monitoring everything, we will be specifically using Lang Smith.

29
00:01:36,000 --> 00:01:42,000
And then finally, uh, if I want to probably make this entire application in the form of APIs so that

30
00:01:42,000 --> 00:01:45,000
it is production ready, I will be using Lang serve.

31
00:01:45,000 --> 00:01:50,000
So all these things not only in this single video, but in the series of video I'll be doing once we

32
00:01:50,000 --> 00:01:51,000
do it with OpenAI.

33
00:01:51,000 --> 00:01:56,000
I know, like everybody knows that OpenAI provides you API key, and obviously you need to put at least

34
00:01:56,000 --> 00:01:59,000
$5 credits to check out all these things.

35
00:01:59,000 --> 00:02:03,000
The reason why I'm considering OpenAI, because it is important in most of the companies, people are

36
00:02:03,000 --> 00:02:05,000
using it in the form of APIs and all.

37
00:02:05,000 --> 00:02:11,000
So first of all, initially I'll go ahead with OpenAI API And then um, we will also go ahead with open

38
00:02:11,000 --> 00:02:12,000
source models through llama.

39
00:02:12,000 --> 00:02:13,000
Okay.

40
00:02:13,000 --> 00:02:18,000
So uh, initially the first step is getting set up with Lang Chain.

41
00:02:18,000 --> 00:02:20,000
Lang, Smith and Lang serve so quickly.

42
00:02:20,000 --> 00:02:21,000
Uh, let me do one thing.

43
00:02:21,000 --> 00:02:23,000
Let me go back to my browser.

44
00:02:23,000 --> 00:02:25,000
So here is my entire Lang chain page.

45
00:02:25,000 --> 00:02:32,000
So, uh, over here, you'll be able to see in Lang Chain, we have, uh, a library or module which

46
00:02:32,000 --> 00:02:33,000
is called as Lang Langsamt.

47
00:02:33,000 --> 00:02:36,000
Along with this we also have something called as Lang serve.

48
00:02:36,000 --> 00:02:36,000
Okay.

49
00:02:36,000 --> 00:02:41,000
So Lang Chain is a open source framework where you'll be finding lot of modules, lot of libraries,

50
00:02:41,000 --> 00:02:45,000
which will actually help you to develop the JNI application.

51
00:02:45,000 --> 00:02:48,000
So first of all I'll just go ahead and click on Sign up okay.

52
00:02:48,000 --> 00:02:53,000
And once I sign up, you'll be able to see that we will be able to log in into the uh, Lang chain.

53
00:02:53,000 --> 00:02:56,000
Smith, Lang Smith basically like say this Lang Smith why it is used.

54
00:02:56,000 --> 00:02:58,000
So we can just go ahead and understand.

55
00:02:58,000 --> 00:03:03,000
It will be like if you want to make your LM app from prototype to production, we will specifically

56
00:03:03,000 --> 00:03:06,000
use this entire Lang Smith uh, module itself.

57
00:03:06,000 --> 00:03:12,000
So by default, whenever I do the sign up, uh, you have to go ahead and insert your user ID or whatever.

58
00:03:12,000 --> 00:03:16,000
Uh, like name all the details and probably go ahead and sign up with your email ID, uh, in the Lang

59
00:03:16,000 --> 00:03:17,000
Smith.

60
00:03:17,000 --> 00:03:21,000
Also, if I go ahead and sign up, it will probably give me the same, uh, page that I had actually

61
00:03:21,000 --> 00:03:21,000
got.

62
00:03:21,000 --> 00:03:22,000
Okay.

63
00:03:22,000 --> 00:03:26,000
now here you can actually see I've created so many different projects, you know, tutorial one test

64
00:03:26,000 --> 00:03:27,000
lamp.

65
00:03:27,000 --> 00:03:32,000
So over here we'll be able to do the entire monitoring everything as such along with this, uh, if

66
00:03:32,000 --> 00:03:37,000
you go over here and say that I can also upload my own data sets, there is something called as annotation

67
00:03:37,000 --> 00:03:38,000
Q prompts.

68
00:03:38,000 --> 00:03:43,000
You know, uh, if you want to probably do the deployment, I can go ahead and click this and, uh,

69
00:03:43,000 --> 00:03:48,000
you know, land graph API deployment is also there And right now, hosted land serve is coming soon.

70
00:03:48,000 --> 00:03:50,000
If you're interested, you can sign up for the early access.

71
00:03:50,000 --> 00:03:54,000
Let's see till the recording of this particular entire course gets over.

72
00:03:54,000 --> 00:04:00,000
Uh, whether, uh, if I get this particular access, I'll also make the tutorial for them for the same.

73
00:04:00,000 --> 00:04:02,000
Okay, so this is the first step.

74
00:04:02,000 --> 00:04:04,000
Please go ahead and create an account in long chain.

75
00:04:04,000 --> 00:04:08,000
And automatically you will be able to create an account with respect to land.

76
00:04:08,000 --> 00:04:08,000
Smith.

77
00:04:08,000 --> 00:04:08,000
Okay.

78
00:04:09,000 --> 00:04:10,000
Uh, so this is the first step.

79
00:04:10,000 --> 00:04:12,000
Everybody needs to have this.

80
00:04:12,000 --> 00:04:12,000
Okay?

81
00:04:12,000 --> 00:04:15,000
And I will show you that how I will be using this.

82
00:04:15,000 --> 00:04:18,000
I will be monitoring my entire application and everything as such.

83
00:04:18,000 --> 00:04:22,000
Now, the second thing that you really need to add is an API API key.

84
00:04:22,000 --> 00:04:25,000
So just go into the Google search for api, API key.

85
00:04:25,000 --> 00:04:29,000
And uh over here you'll be able to see platform dot Openai.com.

86
00:04:29,000 --> 00:04:31,000
Just click on this okay.

87
00:04:32,000 --> 00:04:33,000
Um, it will tell me to log in.

88
00:04:33,000 --> 00:04:34,000
So I'll just go ahead and log in.

89
00:04:34,000 --> 00:04:36,000
I'll continue with Google.

90
00:04:36,000 --> 00:04:39,000
I hope everybody may have an account in OpenAI.

91
00:04:39,000 --> 00:04:40,000
Right?

92
00:04:40,000 --> 00:04:43,000
Uh, I hope everybody has used ChatGPT at least.

93
00:04:43,000 --> 00:04:43,000
Right.

94
00:04:43,000 --> 00:04:46,000
So here is your entire, uh, API, uh, chat.

95
00:04:46,000 --> 00:04:49,000
Uh, you can probably see this OpenAI, uh, platform.

96
00:04:49,000 --> 00:04:50,000
Okay.

97
00:04:50,000 --> 00:04:53,000
And here you'll be able to see there is something called as API keys.

98
00:04:53,000 --> 00:04:56,000
Uh, you can go ahead and create your API key over here.

99
00:04:56,000 --> 00:04:57,000
Okay.

100
00:04:57,000 --> 00:05:03,000
Uh, but for this, uh, it will not be completely for free because you at least have to put 500 or

101
00:05:03,000 --> 00:05:07,000
$5, not $500, at least $5 to probably check it out.

102
00:05:07,000 --> 00:05:10,000
So here you can see some of the usage that I've actually done in June.

103
00:05:10,000 --> 00:05:11,000
Right.

104
00:05:11,000 --> 00:05:14,000
And right now, uh, the date is 18th June.

105
00:05:14,000 --> 00:05:17,000
I've not used it, but from today I'll be probably using it.

106
00:05:17,000 --> 00:05:20,000
You can also see that I've used for GPT four or GPT four.

107
00:05:20,000 --> 00:05:24,000
So I'll be using this models when I will be developing an end to end application.

108
00:05:24,000 --> 00:05:24,000
Okay.

109
00:05:25,000 --> 00:05:30,000
Uh, if you want to probably go ahead and, uh, upload, uh, put some amount again, you have to go

110
00:05:30,000 --> 00:05:31,000
to the payments.

111
00:05:31,000 --> 00:05:34,000
And uh, here you can see cost, activity.

112
00:05:34,000 --> 00:05:35,000
Everything is basically there.

113
00:05:35,000 --> 00:05:39,000
If I go ahead and click on increase Limit, you'll be able to see that I will also be able to set my

114
00:05:39,000 --> 00:05:42,000
limit based on the requirement that I have.

115
00:05:42,000 --> 00:05:47,000
So if you go to click on Billings, uh, so here you can upload your payment methods.

116
00:05:47,000 --> 00:05:49,000
My right now my credit balance is 2.85.

117
00:05:49,000 --> 00:05:55,000
But uh, if I require more, I will be inserting more 5 to $10 and probably showing you how you can

118
00:05:55,000 --> 00:05:57,000
actually use this OpenAI API key.

119
00:05:57,000 --> 00:06:02,000
Okay, but at the end of the day, you really need to use this because many of the companies are using

120
00:06:02,000 --> 00:06:02,000
it, right.

121
00:06:02,000 --> 00:06:05,000
So there are options of putting up payment methods.

122
00:06:05,000 --> 00:06:06,000
And all right.

123
00:06:06,000 --> 00:06:08,000
So based on that you can actually do it.

124
00:06:08,000 --> 00:06:12,000
But at the end of the day I will be using one API key which I will try to create it over here.

125
00:06:12,000 --> 00:06:17,000
I'll also show you, uh, how to create it and where I'll be creating the entire environment.

126
00:06:17,000 --> 00:06:19,000
Okay, now let me just go back to my project.

127
00:06:19,000 --> 00:06:22,000
So I have actually created each and every thing over here.

128
00:06:22,000 --> 00:06:27,000
Uh, the first thing, uh, that I'm actually going to do is that over here, you'll be able to see

129
00:06:27,000 --> 00:06:31,000
that I've created a lot of folders which you'll be able to understand in requirement dot txt.

130
00:06:31,000 --> 00:06:33,000
I have, uh, put up lang chain.

131
00:06:33,000 --> 00:06:36,000
So lang chain is one of the library that I'm actually going to use.

132
00:06:36,000 --> 00:06:39,000
And since we are going to work with, uh, Jupyter notebook.

133
00:06:39,000 --> 00:06:42,000
So what I have actually done is that I've used Ipykernel.

134
00:06:42,000 --> 00:06:42,000
Okay.

135
00:06:42,000 --> 00:06:47,000
Ipykernel, uh, just enables to attach a kernel to the Jupyter notebook itself.

136
00:06:47,000 --> 00:06:50,000
So this is the first thing that I really need to install along with this.

137
00:06:50,000 --> 00:06:55,000
Uh, there are some more installation that I will be doing, which I will be showing you.

138
00:06:55,000 --> 00:06:56,000
Right.

139
00:06:56,000 --> 00:06:59,000
Uh, the first thing is that, uh, you'll be able to see that.

140
00:06:59,000 --> 00:07:01,000
I'll go ahead and create my dot env file.

141
00:07:01,000 --> 00:07:08,000
Now, this dot env file is super important because with the help of this dot env file, what I am actually

142
00:07:08,000 --> 00:07:11,000
going to do, I'm going to go ahead and create my open API key over here.

143
00:07:12,000 --> 00:07:12,000
Okay.

144
00:07:12,000 --> 00:07:15,000
And I will be assigning the values over here.

145
00:07:15,000 --> 00:07:15,000
Right.

146
00:07:15,000 --> 00:07:17,000
So this will be one key that I'll be using.

147
00:07:17,000 --> 00:07:21,000
The next key will be my Lang chain API key.

148
00:07:21,000 --> 00:07:21,000
Right.

149
00:07:21,000 --> 00:07:25,000
So if I go ahead and do this and probably go ahead and put my Lang chain API key.

150
00:07:25,000 --> 00:07:28,000
Now why the why do we require lang chain API key?

151
00:07:28,000 --> 00:07:29,000
It is very much simple.

152
00:07:29,000 --> 00:07:31,000
Uh, if you probably go to the browser.

153
00:07:31,000 --> 00:07:32,000
Right.

154
00:07:32,000 --> 00:07:34,000
Uh, so let me just show you over here.

155
00:07:34,000 --> 00:07:40,000
So if I go to my, uh, Lang Smith right over here, you'll be able to see if I go ahead and click on

156
00:07:40,000 --> 00:07:41,000
settings.

157
00:07:41,000 --> 00:07:41,000
Right.

158
00:07:41,000 --> 00:07:46,000
I will be requiring one API key because at the end of the day, entire monitoring will be specifically

159
00:07:46,000 --> 00:07:47,000
happening over here.

160
00:07:47,000 --> 00:07:47,000
Right.

161
00:07:47,000 --> 00:07:52,000
Uh, see if I go ahead and see in this election series, you'll be able to see right now there is no

162
00:07:52,000 --> 00:07:52,000
request.

163
00:07:52,000 --> 00:07:55,000
But if I go ahead and see in some tutorial one.

164
00:07:55,000 --> 00:07:56,000
Right.

165
00:07:56,000 --> 00:08:02,000
Okay, let me just go ahead and see from the past last seven days.

166
00:08:02,000 --> 00:08:04,000
Last 30 days okay.

167
00:08:04,000 --> 00:08:05,000
So nothing is here.

168
00:08:05,000 --> 00:08:06,000
So let me do one thing.

169
00:08:06,000 --> 00:08:09,000
Let me just go ahead and test some more.

170
00:08:09,000 --> 00:08:12,000
Right now everything looks blank okay.

171
00:08:12,000 --> 00:08:14,000
But it's okay.

172
00:08:14,000 --> 00:08:15,000
We will see this all time if I go ahead and see.

173
00:08:16,000 --> 00:08:21,000
See over here I had created some request from open AI, and here you'll be able to see.

174
00:08:21,000 --> 00:08:24,000
I'll be able to monitor each and every request and all.

175
00:08:24,000 --> 00:08:29,000
I'll be talking more about it, but just I'm giving you an idea why we specifically require a long chain

176
00:08:29,000 --> 00:08:29,000
API key.

177
00:08:29,000 --> 00:08:37,000
Because, uh, in this in this portal, I am going to record all my, all my monitoring things, debugging

178
00:08:37,000 --> 00:08:40,000
things with respect to the Genie app that I'm actually going to create.

179
00:08:40,000 --> 00:08:47,000
So in order to create the API key just go to the settings over here, click on API key and uh select

180
00:08:47,000 --> 00:08:48,000
or create this API key.

181
00:08:48,000 --> 00:08:50,000
Right now I have already created it.

182
00:08:50,000 --> 00:08:55,000
So if you go ahead and create it you can give any kind of description over here.

183
00:08:55,000 --> 00:08:55,000
Okay.

184
00:08:55,000 --> 00:09:00,000
Let's say that I'm giving here, this will be my test key that I'm actually going to create personal

185
00:09:00,000 --> 00:09:01,000
access token.

186
00:09:01,000 --> 00:09:02,000
I will go ahead and create this API key.

187
00:09:03,000 --> 00:09:06,000
I'll copy this okay I have saved it to a safe place.

188
00:09:06,000 --> 00:09:10,000
Now what I'm actually going to do over here is that I'm going to paste the API key.

189
00:09:10,000 --> 00:09:11,000
Right.

190
00:09:11,000 --> 00:09:14,000
And this API key I'm going to specifically use it over here.

191
00:09:15,000 --> 00:09:16,000
Uh, again uh, I'll not say that.

192
00:09:16,000 --> 00:09:18,000
Please don't please use my API key.

193
00:09:18,000 --> 00:09:19,000
Don't do that.

194
00:09:19,000 --> 00:09:20,000
It will be of no use.

195
00:09:20,000 --> 00:09:23,000
Uh, you can create your API key because it is completely for free.

196
00:09:23,000 --> 00:09:23,000
Okay.

197
00:09:23,000 --> 00:09:26,000
Then coming to the next part.

198
00:09:26,000 --> 00:09:26,000
Right.

199
00:09:26,000 --> 00:09:28,000
So since we are in the dot env file.

200
00:09:28,000 --> 00:09:32,000
So first of all I kept my open I underscore API key as a key.

201
00:09:32,000 --> 00:09:34,000
Then my API key.

202
00:09:34,000 --> 00:09:37,000
Then I will also go ahead and create my Lang chain.

203
00:09:38,000 --> 00:09:44,000
Lang chain project okay, so I will just go ahead and write lang chain project okay.

204
00:09:44,000 --> 00:09:46,000
So this will basically be my Lang chain project.

205
00:09:46,000 --> 00:09:56,000
And let's say this is my Gen I app with with OpenAI.

206
00:09:56,000 --> 00:09:59,000
So this will be my project name that I'm actually going to create it.

207
00:09:59,000 --> 00:09:59,000
Okay.

208
00:09:59,000 --> 00:10:02,000
So I will be requiring this three information to start with.

209
00:10:02,000 --> 00:10:02,000
Okay.

210
00:10:02,000 --> 00:10:08,000
Now you may be thinking, Krish, why I have not yet put up this OpenAI API key.

211
00:10:08,000 --> 00:10:11,000
I would suggest please go ahead and put your own API key.

212
00:10:11,000 --> 00:10:11,000
Okay.

213
00:10:11,000 --> 00:10:14,000
Do not be dependent on mine because I'll keep this hidden.

214
00:10:14,000 --> 00:10:17,000
Otherwise lot of charges will happen on my end.

215
00:10:17,000 --> 00:10:21,000
Okay, so this will be the three API keys that I will be requiring.

216
00:10:21,000 --> 00:10:21,000
Langton.

217
00:10:21,000 --> 00:10:26,000
Underscore API, key Langton project and open AI and uh, open AI underscore API key.

218
00:10:26,000 --> 00:10:27,000
Perfect.

219
00:10:27,000 --> 00:10:30,000
Once this is done now I will go to my requirement dot txt.

220
00:10:30,000 --> 00:10:30,000
Okay.

221
00:10:31,000 --> 00:10:36,000
Now here uh, I'll not go ahead and install Ipykernel because Ipykernel I'll do it only for the Jupyter

222
00:10:36,000 --> 00:10:36,000
notebook.

223
00:10:36,000 --> 00:10:39,000
So I don't have to put that entire thing in the requirement.

224
00:10:39,000 --> 00:10:43,000
Dot txt I will go ahead and write python dot env.

225
00:10:43,000 --> 00:10:46,000
Now why this library is actually required.

226
00:10:46,000 --> 00:10:47,000
It is very much simple.

227
00:10:47,000 --> 00:10:54,000
Whatever things I have written in my dot env file to import all this key value pairs in my Jupyter notebook

228
00:10:54,000 --> 00:10:57,000
or in my.py file, I will be have.

229
00:10:57,000 --> 00:11:00,000
I will have to use this python dot env okay.

230
00:11:00,000 --> 00:11:02,000
Now my requirement dot txt is updated.

231
00:11:02,000 --> 00:11:05,000
So let me just go ahead and open my terminal.

232
00:11:05,000 --> 00:11:07,000
So this is my terminal over here.

233
00:11:07,000 --> 00:11:08,000
Now quickly.

234
00:11:08,000 --> 00:11:13,000
Uh I'm in my V and V environment so quickly let me just go ahead and install all this requirement dot

235
00:11:13,000 --> 00:11:14,000
txt.

236
00:11:14,000 --> 00:11:15,000
Okay.

237
00:11:15,000 --> 00:11:18,000
So lang chain and python dot env.

238
00:11:18,000 --> 00:11:20,000
So here you can see it is successfully installed.

239
00:11:20,000 --> 00:11:21,000
Perfect.

240
00:11:21,000 --> 00:11:22,000
So this is good.

241
00:11:22,000 --> 00:11:24,000
Uh we are ready with it.

242
00:11:24,000 --> 00:11:27,000
And uh you can see that I've also created my API key itself.

243
00:11:27,000 --> 00:11:32,000
Now what I'm actually going to do is that, uh, in the next video, we are going to get started.

244
00:11:32,000 --> 00:11:35,000
And uh, now, uh, the first step is done.

245
00:11:35,000 --> 00:11:37,000
Lang, Chen, Lang, Smith and Lang serve.

246
00:11:37,000 --> 00:11:38,000
Lang serve.

247
00:11:38,000 --> 00:11:39,000
Also, I'll be talking more about it.

248
00:11:39,000 --> 00:11:41,000
Like what kind of code will be writing for this?

249
00:11:41,000 --> 00:11:46,000
You don't require any portal sign up as us only Lang Chen and Lang Smith you basically require.

250
00:11:46,000 --> 00:11:50,000
Okay, now in the next step, we will use the most basic and common components of Lang Chen like prompt

251
00:11:50,000 --> 00:11:52,000
templates, models, and output parser.

252
00:11:52,000 --> 00:11:57,000
So, uh, I hope, uh, you were able to understand this video.

253
00:11:57,000 --> 00:11:58,000
This was it from my side.

254
00:11:58,000 --> 00:12:00,000
I will see you all in the next video.

255
00:12:00,000 --> 00:12:01,000
Thank you.

