1
00:00:00,000 --> 00:00:00,000
Hello guys.

2
00:00:00,000 --> 00:00:06,000
Now we are going to continue our new end to end project, uh, Gen AI project.

3
00:00:06,000 --> 00:00:11,000
And here we are going to specifically use grok AI inferencing engine.

4
00:00:11,000 --> 00:00:11,000
Okay.

5
00:00:11,000 --> 00:00:13,000
Now what exactly is grok.

6
00:00:13,000 --> 00:00:19,000
So it is an amazing platform which actually provides you open source models or LLM models like Gamma

7
00:00:19,000 --> 00:00:21,000
Llama three, Mistral.

8
00:00:21,000 --> 00:00:27,000
And you can use all these specific models to probably create an end to end generative AI application.

9
00:00:27,000 --> 00:00:30,000
Now, first of all, you need to understand why grok.

10
00:00:30,000 --> 00:00:36,000
So if I go ahead and click on this particular link and go over here, you need to understand that grok

11
00:00:36,000 --> 00:00:38,000
is a fast AI inferencing engine.

12
00:00:38,000 --> 00:00:42,000
It uses something called as language processing unit.

13
00:00:42,000 --> 00:00:42,000
Right.

14
00:00:43,000 --> 00:00:49,000
So guys, uh, in this entire world, right, specifically in the development of generative AI field,

15
00:00:49,000 --> 00:00:53,000
you'll be seeing many, many companies who are coming up with amazing LLM LM models.

16
00:00:53,000 --> 00:00:59,000
Let it be paid or open source, but that company is going to win, which will be able to provide an

17
00:00:59,000 --> 00:01:06,000
amazing inferencing in a small in, in, in, let's say in some seconds I should be in some milliseconds

18
00:01:06,000 --> 00:01:08,000
I should be able to get the response.

19
00:01:08,000 --> 00:01:13,000
And right now, the research that is specifically happening with respect to the LPO inferencing engine

20
00:01:13,000 --> 00:01:15,000
actually makes it possible.

21
00:01:15,000 --> 00:01:15,000
Okay.

22
00:01:15,000 --> 00:01:21,000
So, uh, an NLP inferencing engine with LPU standing for Language Processing Unit is a hardware and

23
00:01:21,000 --> 00:01:28,000
software platform that develops, uh, delivers exceptional compute speed, quality and energy and efficiency.

24
00:01:28,000 --> 00:01:31,000
Let me just zoom in so that you'll be able to see it much more in a better way.

25
00:01:31,000 --> 00:01:37,000
This new type of end to end processing unit system provides the fastest inference for computational

26
00:01:37,000 --> 00:01:42,000
intensive application, such as AI applications like large language model okay.

27
00:01:42,000 --> 00:01:46,000
And over here it is also given why it is so much faster than GPUs, right?

28
00:01:46,000 --> 00:01:49,000
So LP is designed to overcome the two bottlenecks.

29
00:01:49,000 --> 00:01:51,000
One is compute density and memory bandwidth.

30
00:01:51,000 --> 00:01:53,000
So you can read more about grok over here.

31
00:01:53,000 --> 00:01:54,000
Okay.

32
00:01:54,000 --> 00:01:59,000
And I feel that yes, this is the company that can actually provide an amazing inferencing because I've

33
00:01:59,000 --> 00:02:00,000
been using this.

34
00:02:00,000 --> 00:02:01,000
Okay.

35
00:02:01,000 --> 00:02:07,000
So in this video I will talk about how you can go ahead and create your API in Glock Cloud and how you

36
00:02:07,000 --> 00:02:10,000
can use all these LM models and start creating your project.

37
00:02:10,000 --> 00:02:16,000
So first of all, I will just go to the Glock cloud, and the first thing that I am actually going to

38
00:02:16,000 --> 00:02:18,000
do is that go ahead and create your API key.

39
00:02:18,000 --> 00:02:25,000
So here you also have a playground where you can probably play with all this, uh llama three models

40
00:02:25,000 --> 00:02:25,000
and all.

41
00:02:25,000 --> 00:02:30,000
So if I go ahead and just say hi, I should be able to get the response very much quickly.

42
00:02:30,000 --> 00:02:33,000
And we'll also be measuring the time like how quick it is.

43
00:02:33,000 --> 00:02:37,000
So first thing first we will go ahead and create our API key.

44
00:02:37,000 --> 00:02:44,000
Just click on the API key over here I've created multiple times, but let's say any of the API key that

45
00:02:44,000 --> 00:02:46,000
I want to use, I can go ahead and use it.

46
00:02:46,000 --> 00:02:46,000
Right.

47
00:02:46,000 --> 00:02:49,000
So in order to create it just click on create API key.

48
00:02:49,000 --> 00:02:53,000
I will say this is for my project over here.

49
00:02:53,000 --> 00:02:56,000
So I'll just go ahead and click on project and click on submit.

50
00:02:56,000 --> 00:02:59,000
So please make sure that you copy this API key.

51
00:02:59,000 --> 00:03:00,000
It starts with GSK underscore.

52
00:03:01,000 --> 00:03:02,000
So I'll copy this.

53
00:03:02,000 --> 00:03:05,000
Go to my project over here okay.

54
00:03:05,000 --> 00:03:11,000
And here you can see I've created my fourth folder which is my fourth project right now rag document

55
00:03:11,000 --> 00:03:11,000
Q&A.

56
00:03:11,000 --> 00:03:18,000
I'll go to my dot env file and make sure that I have this key pasted somewhere.

57
00:03:18,000 --> 00:03:18,000
Okay.

58
00:03:18,000 --> 00:03:26,000
Now, if I'm using this particular key, what should be my environment variable that also we need to

59
00:03:26,000 --> 00:03:26,000
know, right?

60
00:03:26,000 --> 00:03:32,000
So I will just go ahead and write grok underscore API underscore key.

61
00:03:32,000 --> 00:03:33,000
Right.

62
00:03:33,000 --> 00:03:36,000
So this is my environment variable over here.

63
00:03:36,000 --> 00:03:41,000
And now it's time that we will go ahead and start writing our code okay.

64
00:03:41,000 --> 00:03:47,000
Now understand, one thing is that we will be using the specific key to access all the LM models that

65
00:03:47,000 --> 00:03:50,000
is available over there as an open source.

66
00:03:50,000 --> 00:03:50,000
Okay.

67
00:03:51,000 --> 00:03:54,000
So let's go ahead and let's start our coding okay.

68
00:03:54,000 --> 00:03:59,000
Now before I go ahead, uh, we need to also make sure that we need to install some of the libraries

69
00:03:59,000 --> 00:04:03,000
that is required uh, required in requirement dot txt.

70
00:04:03,000 --> 00:04:06,000
And if I really want to work with both lang chain and grok.

71
00:04:06,000 --> 00:04:10,000
So like how we have this lang and underscore hugging face lang and dash OpenAI.

72
00:04:10,000 --> 00:04:15,000
Similarly, I will also be using one more library which is called as lang in grok.

73
00:04:15,000 --> 00:04:18,000
Okay, so once I do this, I will go ahead and save this.

74
00:04:18,000 --> 00:04:21,000
And now I'll go back to my app Dot Pi.

75
00:04:21,000 --> 00:04:24,000
First of all let's go ahead and install this entirely.

76
00:04:24,000 --> 00:04:27,000
So I'll go ahead and write CD dot dot.

77
00:04:27,000 --> 00:04:33,000
I'll go back to my parent folder and go ahead and write pip install minus r requirements.txt.

78
00:04:33,000 --> 00:04:34,000
Okay.

79
00:04:34,000 --> 00:04:38,000
So now the installation will entirely happen over here.

80
00:04:38,000 --> 00:04:43,000
So here you can see this particular library of grok will also get installed.

81
00:04:43,000 --> 00:04:43,000
Right.

82
00:04:43,000 --> 00:04:45,000
So we are perfect to go ahead.

83
00:04:45,000 --> 00:04:47,000
And we are getting started with grok okay.

84
00:04:47,000 --> 00:04:52,000
Now uh quickly let's go ahead and import all the important libraries.

85
00:04:52,000 --> 00:04:55,000
And then we are good to go okay.

86
00:04:55,000 --> 00:04:58,000
Okay, now these are some of the libraries that I'm actually going to use.

87
00:04:58,000 --> 00:05:02,000
So first of all I'm going to use uh Streamlit okay.

88
00:05:03,000 --> 00:05:05,000
Then I'm going to use Chad Grok.

89
00:05:05,000 --> 00:05:07,000
So this is what I'm actually want.

90
00:05:07,000 --> 00:05:11,000
So I have go ahead and say from lecture underscore grok import Chad Grok.

91
00:05:12,000 --> 00:05:14,000
And then I'll be using OpenAI embedding.

92
00:05:14,000 --> 00:05:19,000
See uh it is not compulsory that you need to use OpenAI embedding because I know that this will be paid

93
00:05:19,000 --> 00:05:20,000
with respect to an APIs.

94
00:05:20,000 --> 00:05:24,000
So what you can actually do, like how we did it in Olama.

95
00:05:24,000 --> 00:05:24,000
Right.

96
00:05:24,000 --> 00:05:27,000
You can actually use this Olama embeddings.

97
00:05:27,000 --> 00:05:34,000
So if you remember with respect to Olama, when we were discussing over here some or the other way,

98
00:05:34,000 --> 00:05:41,000
or if you go back to your code over here in the, uh, let me just have a look over here in the embedding

99
00:05:41,000 --> 00:05:45,000
techniques, I can just go ahead and use this embedding.

100
00:05:45,000 --> 00:05:45,000
Right.

101
00:05:45,000 --> 00:05:47,000
We can also go ahead and use this.

102
00:05:47,000 --> 00:05:48,000
I'll copy this entirely.

103
00:05:48,000 --> 00:05:54,000
And, you know, try to save some bucks of yours and try to paste it over here.

104
00:05:54,000 --> 00:05:55,000
So I will go ahead and use this.

105
00:05:55,000 --> 00:05:56,000
All of my embedding okay.

106
00:05:56,000 --> 00:05:58,000
For my application.

107
00:05:58,000 --> 00:06:04,000
Now the next thing is that from Langston dot text splitter I'm importing text recursive character text

108
00:06:04,000 --> 00:06:04,000
splitter.

109
00:06:04,000 --> 00:06:11,000
Then from Langston dot change dot combine documents, we are going to import create stuff document chain.

110
00:06:11,000 --> 00:06:13,000
Now this is where it is very much important.

111
00:06:13,000 --> 00:06:15,000
And this is specifically used in drag application.

112
00:06:15,000 --> 00:06:18,000
We'll be discussing more about it why we'll be using it.

113
00:06:18,000 --> 00:06:22,000
Along with this I will go ahead and write from lang chain underscore code dot prompts.

114
00:06:22,000 --> 00:06:26,000
I'm going to import chat prompt template because we need to define our chat prompt template.

115
00:06:26,000 --> 00:06:29,000
And then finally we'll also be using from lang chain or chains.

116
00:06:29,000 --> 00:06:32,000
We'll be using this creative create retrieval chain.

117
00:06:32,000 --> 00:06:40,000
Now, this two, uh, libraries that we have imported, this is really important for any, any, any

118
00:06:40,000 --> 00:06:43,000
rag document, Q&A applications or any Q&A application.

119
00:06:43,000 --> 00:06:48,000
In short, like let's say if there is an external data source and we really need to want to interact

120
00:06:48,000 --> 00:06:48,000
with it, right?

121
00:06:48,000 --> 00:06:54,000
So we will definitely be using this along with this, uh, we are also going to use this vector store.

122
00:06:54,000 --> 00:06:59,000
And then we'll also be using this document loader which is called as py pdf directory loader.

123
00:06:59,000 --> 00:07:03,000
So uh yes this was the basic import that we have done.

124
00:07:03,000 --> 00:07:06,000
Now we are going to probably create an end to end application.

125
00:07:06,000 --> 00:07:11,000
And we'll continue in the next video so that uh, we'll go ahead and do the further discussion.

126
00:07:11,000 --> 00:07:17,000
Like what all things how to import this libraries and all and how to uh, load the environment variable

127
00:07:17,000 --> 00:07:18,000
of grok API.

128
00:07:18,000 --> 00:07:20,000
So yes, uh, this was it.

129
00:07:20,000 --> 00:07:21,000
I'll see you all in the next video.

130
00:07:21,000 --> 00:07:21,000
Thank you.

