Customizing Giant Language Fashions | by Thomas Reid | Mar, 2024


Customise, run and save LLMs utilizing OLLAMA and the Modelfile

On this article, I’ll present you how one can use the Modelfile in Ollama to alter how an current LLM (Llama2) behaves when interacting with it. I’ll additionally present you how one can save your newly personalized mannequin to your private namespace on the Ollama server.

I do know it could get a bit complicated with all of the completely different ”llamas” flying round. Simply bear in mind, Ollama is the corporate that lets you obtain and domestically run many alternative LLMs. Whereas, Llama2 is a selected LLM created by Meta the proprietor of Fb. Other than this relationship, they don’t seem to be related in another approach.

If you happen to’ve by no means heard of Ollama earlier than I like to recommend that you simply try my article beneath the place I am going into depth on what Ollama is and how one can set up it in your system.

What’s a modelfile?

In Ollama, a modelfile refers to a configuration file that defines the blueprint to create and share fashions with Ollama.

The modelfile incorporates info akin to,

  1. Base Mannequin Reference. All modefiles will need to have a mannequin that they use as the idea for any new mannequin
  2. Parameters. These specify issues such because the temperature, top_k and top_p that must be utilized to the brand new mannequin. We’ll discuss extra about these afterward.
  3. Template. This specifies what the ultimate immediate might be that’s handed to the LLM.
  4. System. We will use this command to find out how the system behaves total.

There are different properties the modelfile could make use of however we’ll solely be utilizing those above. There’s a hyperlink to the Ollama documentation on the finish of the article if you wish to discover out extra about this.

The bottom mannequin

The very first thing we have to do is determine an current mannequin so we will look at its properties and make the adjustments we need to it. For that, I’m going…


Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *