Using modelfiles
Modelfiles are an Ollama concept akin to Dockerfiles that allow you to build custom models by adjusting parameters, prompts, system messages, and other meta-information.
The gt4llm
package ships with a simple model for these files.
modelfile := GtLlmModelFile new from: 'llama3'; system: 'You are Mario from Super Mario Bros, acting as an assistant.'; messageFrom: 'user' withText: 'Who are you?'; messageFrom: 'assistant' withText: 'It’s me, Mario! What can I do for you today?'
These modelfiles can then be used to create custom models. Please note that the name has to be unique.
GtOllamaClient new createModel: 'mario' withModelFile: modelfile
Once created, the custom models can be used as any normal model.
GtLlmChat new provider: (GtOllamaProvider new model: 'mario')