Maximilian: So we got a Modelfile.
How can we now build an actual model based on that file?
Well, for that, Ollama gives us the create command,
because, as we learned here,
this creates a model from a Modelfile.
Now, for that, you must make sure that,
in your command line, in your terminal,
you navigate into the folder where you got that Modelfile,
which in my case is the case.
And then you can run ollama create,
then any name of your choice, like service-agent,
but that is entirely up to you.
That will be the name of the model you are creating.
And then -f
and then ./Modelfile.
And here you simply specify the path to that Modelfile.
And since here, for me, it sits in the same directory,
it's a very simple path.
If you had it in some other directory,
you could specify the full absolute path
to that Modelfile here.
So now if you save that,
it will build a new model based on that Modelfile.
And therefore, if thereafter you run ollama list,
you should see that model here.
Now again, this size is kind of wrong
because of course, this service-agent model,
thanks to this command we just executed,
is based on this Modelfile,
which builds a model based on this Gemma model,
and therefore Ollama will not technically copy that model,
it will not copy the weights or parameters of that model,
it will also not change them, by the way.
Instead it will use that as a base
and just adjust that metadata, so to say.
So that these settings are always set
when we now run our customized model.
But under the hood,
we're still using the unchanged Gemma 3 model.
But of course therefore here I can ollama run service-agent
like this and this will now load my own model.
And here we also see
that chat history we added to that model.
And if I type /show system, I for example,
also see that system message,
which I added to that Modelfile.
And that's therefore another maybe more convenient way
of building customized models based on existing models,
not by using /set and /save, which you can also do,
which has the same effect,
but instead by using such a Modelfile.
And of course, the great thing about such a Modelfile
is that you can also share it with other people.
You can upload it to GitHub, share it through your website,
and therefore allow other people
that are also using Ollama
to easily copy your customized model version.
Now for completeness sake, I also wanna mention
that when it comes to sharing customized versions of models,
you can also use the ollama push command.
And this pushes a model to a registry.
A registry like the official Ollama models registry,
for example.
But that's not something I'll do in this course here,
not something you have to do.
As I just explained,
if you wanna share a customized version of a model,
you could also just share the Modelfile
and have people create that model based on
that Modelfile locally on their systems.
But it's worth noting that ollama push exists
and can therefore be an interesting way
of sharing an adjusted model with other people.