Maximilian: Of course, you can use Ollama
through that command line-based chat interface.
Or, as briefly shown earlier,
you could use it in conjunction
with a solution like Open WebUI
to add a graphical user interface to it.
Though if you want one, as explained before,
my recommendation would be to just go for LM Studio.
But you can also use Ollama programmatically
just as you could use LM Studio programmatically.
And you can therefore take advantage
of all the benefits Ollama gives you,
like the ability to easily build
your own customized model versions and use those,
so that you could have different models
that have specific system problems for different situations,
and you could easily switch between them.
You can use all that programmatically as well,
because Ollama, like LM Studio,
also runs a server behind the scenes,
a server to which you can send requests
from inside your code.
Now, unlike with LM Studio,
you don't need to explicitly enable that server.
Instead, it's started automatically when you start Ollama.
Now, in case it stopped for whatever reason,
for example, you quit Ollama through the Windows system tray
or the macOS status bar here, if that happened,
you can always run ollama serve to bring it back up.
If you run that command, by the way,
you also get a detailed output of the configuration
that was set for that server, like for example,
the default context length that's being set,
and you're also stuck in a running process
where you will see server log messages.
If you don't want that, you can quit this,
and you can simply ollama run a model
and then quit, for example,
and this will also start that server again.
So now, Ollama is also running again here,
and I would have to quit it again
if I wanted to get rid of that background process.
And with that server up and running,
you can communicate with it from inside your code,
and that's what we'll explore next.