-: [Maximilian Schwarzmuller] So as you learned,
you can save and load sessions.
And what happens technically is that a copy
of the model gets created
and for that copied model, all of your settings,
your system message, your parameter settings,
and your existing chat history is saved
and baked into that model, so to say.
And you can see that model if you run Ollama list
because that lists all the models
that have been downloaded onto your system.
You also have Ollama ps, which you can run
to list all currently running models.
So here, Ollama ps does indeed show me
the Gemma 3 model I started because by default,
Ollama keeps them running for five minutes
and after five minutes without action,
it will remove them from memory so
that they no longer take up memory space.
But this one, since I just used it is still running.
And here, you can also see the size it's occupying in memory
and where it's running, if it's on the GPU or a CPU.
GPU, of course, is better as you learned.
But Ollama list shows you all the models you downloaded
onto your system or all the models that are available here.
And that does include
that Gemma 3 quantized 12 billion parameters model
I downloaded earlier,
but it also includes this s1 model I created, this
copy I created, which is that Gemma 3 model
because that is the model I saved,
but it's that model with my system message,
with my parameter settings,
and with my chat history baked-in.
And therefore, if I knew that I want to use this model
that I want to continue with that chat history
and use all the settings
as I saved them when using Ollama Run, instead
of using ollama run gemma3
and so on, I could ollama run s1
since that's the name I chose for saving it.
And that will now restore that session
and run that model with all the settings I did save.
Now, of course, over time, as you work with Ollama,
as you experiment with it and as you add more
and more models, you might end up
with a long list of models.
And, of course, these models
are taking up space on your system.
Now, technically, despite it saying here
that each model has a size of roughly nine gigabytes,
Ollama is smart and it won't just copy models
if you save the derivatives that are based on that model
like that s1 model.
So it will actually not take up 18 gigabytes
of disc space here.
Instead, it will just save the differences,
the additional configuration you applied to the save model
and then use that saved metadata in conjunction
with the original model files when you run the s1 model.
So you can easily create derivatives
and customized versions of models
without quickly cluttering up your disc.
That's the good news.
But still, of course, over time, you might end up
with a long list of models
where you might simply not need all the models anymore.
That's why Ollama also gives you the rm command,
which you can use to remove a model.
And remove means remove it, also removes it from the disc.
So therefore here, I can run ollama rm s1
and that will remove that s1 model.
Again, in case of this model, since it was based on
that Gemma free model,
it didn't actually take up any significant amount
of disc space.
But still, of course, there is no reason to keep old models
around if you're just not using them anymore.
What you can also do with the Ollama command
when managing your locally downloaded models
is use the show command to learn more about a model.
For example, here, I can use Ollama show gemma3,
and then I'll just repeat that, identify here
to learn more about this model.
And essentially, that's the same kind of information we got
with the slash show command when running that model.
Here, you can get it without starting that model
just to learn more about it.
And that can, of course, be particularly helpful
if you don't know what exactly a model was about anymore.
Because, of course, here with the gemma3 model,
it's pretty clear that it's, well, the gemma3 model,
the 12 billion parameter version of it.
But what if you did run that model
and you then set a system message
like You are a friendly assistant and you then saved this,
custom-m1, whatever, you can choose any identifier you want,
and then you quit and you went on vacation, and
after a time, you came back
and you're wondering, what's this model about?
Well, for situations like this, you can use Ollama show
and you will learn that this was indeed based
on the gemma3 model family,
the 12-billion parameter model flavor specifically.
And then you might remember that this was indeed
that custom version of that gemma3 model you saved
that had that system message baked-in.
So that's why the Ollama show command can be useful
for inspecting and understanding your models,
especially your custom models.