WEBVTT

1
00:00:00.750 --> 00:00:03.510
<v Maximilian>One other interesting thing you can do</v>

2
00:00:03.510 --> 00:00:08.070
with Ollama is save chat sessions.

3
00:00:08.070 --> 00:00:13.070
And actually chat session is not entirely the correct term,

4
00:00:13.380 --> 00:00:17.040
even though Ollama itself calls it saving a session.

5
00:00:17.040 --> 00:00:18.480
But what you'll actually do,

6
00:00:18.480 --> 00:00:20.640
as you will see over the next minutes,

7
00:00:20.640 --> 00:00:24.120
is you can save a copy of a model

8
00:00:24.120 --> 00:00:28.500
that has certain settings and parameters baked in.

9
00:00:28.500 --> 00:00:32.190
For example, here I could say, "Hi, I am Max."

10
00:00:32.190 --> 00:00:35.130
So I'm sharing my name with Ollama,

11
00:00:35.130 --> 00:00:39.090
or I'm putting it into the chat history to be more precise.

12
00:00:39.090 --> 00:00:41.220
Now, as you see, if you type slash question mark,

13
00:00:41.220 --> 00:00:44.640
you can now save your current session.

14
00:00:44.640 --> 00:00:49.590
So here I'll say save s1 for session one.

15
00:00:49.590 --> 00:00:53.010
And it says "Created a new model s1," here.

16
00:00:53.010 --> 00:00:58.010
Now I'll quit here and if I now run this model again,

17
00:00:58.740 --> 00:01:00.730
I can say load s1

18
00:01:02.130 --> 00:01:05.880
and I loaded that other session or model,

19
00:01:05.880 --> 00:01:09.240
and I'll get back to why it's called a model in a second.

20
00:01:09.240 --> 00:01:10.920
But if I now ask what's my name,

21
00:01:10.920 --> 00:01:12.960
it remembers that my name is Max,

22
00:01:12.960 --> 00:01:16.350
even though I did not share that in this chat session here.

23
00:01:16.350 --> 00:01:20.133
But I did share it in that session I saved, the s1 session.

24
00:01:21.540 --> 00:01:23.760
Now what's important to understand though is

25
00:01:23.760 --> 00:01:27.090
that technically Ollama doesn't just save

26
00:01:27.090 --> 00:01:29.250
and load the chat session,

27
00:01:29.250 --> 00:01:33.660
instead, it created a copy of this model here

28
00:01:33.660 --> 00:01:38.100
where it basically saved the previous chat session

29
00:01:38.100 --> 00:01:43.100
in the model data or in the model initialization data,

30
00:01:43.320 --> 00:01:47.340
so that whenever you load or run that saved model,

31
00:01:47.340 --> 00:01:51.780
it would be initialized with the entire chat history it had

32
00:01:51.780 --> 00:01:55.890
when I saved that session, when I saved that model.

33
00:01:55.890 --> 00:01:58.830
So it's a copy of that Gemma model

34
00:01:58.830 --> 00:02:00.690
with the exact same configuration,

35
00:02:00.690 --> 00:02:05.010
but also with the chat history I had at the point of time

36
00:02:05.010 --> 00:02:06.510
where I saved it.

37
00:02:06.510 --> 00:02:09.000
That's important to understand.

38
00:02:09.000 --> 00:02:12.180
And therefore, of course you can use that save command,

39
00:02:12.180 --> 00:02:16.530
not just to save a chat history for future use,

40
00:02:16.530 --> 00:02:19.230
but also to save anything else you changed

41
00:02:19.230 --> 00:02:21.210
about this chat session.

42
00:02:21.210 --> 00:02:23.730
For example, if I set a system prompt here

43
00:02:23.730 --> 00:02:28.730
and I say, "You are friendly customer service agent.

44
00:02:30.690 --> 00:02:34.410
Don't grant any refunds."

45
00:02:34.410 --> 00:02:37.030
If I set this system message

46
00:02:37.980 --> 00:02:40.330
and I then saved this

47
00:02:41.340 --> 00:02:45.180
and I overwrote my old model, s1,

48
00:02:45.180 --> 00:02:46.593
if I now quit this,

49
00:02:47.970 --> 00:02:52.970
and again, I run my model here and I'd type load s1,

50
00:02:53.010 --> 00:02:54.660
and there would be a different way of loading

51
00:02:54.660 --> 00:02:57.540
that safe model, but for now I'll do it like this.

52
00:02:57.540 --> 00:02:59.610
If I do that and identify show system,

53
00:02:59.610 --> 00:03:02.700
you'll see that that system message was also saved.

54
00:03:02.700 --> 00:03:06.150
So that's one way of setting a system message

55
00:03:06.150 --> 00:03:09.660
and any other kind of parameter settings you might wanna set

56
00:03:09.660 --> 00:03:13.230
and maybe even create a chat history that should be saved

57
00:03:13.230 --> 00:03:17.580
and then save it in a separate model that you can reuse,

58
00:03:17.580 --> 00:03:19.920
so that if you know that you have certain settings

59
00:03:19.920 --> 00:03:21.690
you want to use over and over again,

60
00:03:21.690 --> 00:03:23.910
you can conveniently save them, load them,

61
00:03:23.910 --> 00:03:25.590
and you don't have to reset them

62
00:03:25.590 --> 00:03:28.320
every time you start a new chat history.

63
00:03:28.320 --> 00:03:30.810
So that is a useful feature,

64
00:03:30.810 --> 00:03:33.873
but it's also a feature that's worth a closer look.

