Maximilian: One other interesting thing you can do
with Ollama is save chat sessions.
And actually chat session is not entirely the correct term,
even though Ollama itself calls it saving a session.
But what you'll actually do,
as you will see over the next minutes,
is you can save a copy of a model
that has certain settings and parameters baked in.
For example, here I could say, "Hi, I am Max."
So I'm sharing my name with Ollama,
or I'm putting it into the chat history to be more precise.
Now, as you see, if you type slash question mark,
you can now save your current session.
So here I'll say save s1 for session one.
And it says "Created a new model s1," here.
Now I'll quit here and if I now run this model again,
I can say load s1
and I loaded that other session or model,
and I'll get back to why it's called a model in a second.
But if I now ask what's my name,
it remembers that my name is Max,
even though I did not share that in this chat session here.
But I did share it in that session I saved, the s1 session.
Now what's important to understand though is
that technically Ollama doesn't just save
and load the chat session,
instead, it created a copy of this model here
where it basically saved the previous chat session
in the model data or in the model initialization data,
so that whenever you load or run that saved model,
it would be initialized with the entire chat history it had
when I saved that session, when I saved that model.
So it's a copy of that Gemma model
with the exact same configuration,
but also with the chat history I had at the point of time
where I saved it.
That's important to understand.
And therefore, of course you can use that save command,
not just to save a chat history for future use,
but also to save anything else you changed
about this chat session.
For example, if I set a system prompt here
and I say, "You are friendly customer service agent.
Don't grant any refunds."
If I set this system message
and I then saved this
and I overwrote my old model, s1,
if I now quit this,
and again, I run my model here and I'd type load s1,
and there would be a different way of loading
that safe model, but for now I'll do it like this.
If I do that and identify show system,
you'll see that that system message was also saved.
So that's one way of setting a system message
and any other kind of parameter settings you might wanna set
and maybe even create a chat history that should be saved
and then save it in a separate model that you can reuse,
so that if you know that you have certain settings
you want to use over and over again,
you can conveniently save them, load them,
and you don't have to reset them
every time you start a new chat history.
So that is a useful feature,
but it's also a feature that's worth a closer look.