Imagino que ya tienes tu docker de ollama funcionando, si no es así, mira el artículo Run copylot locally.
Ahora vamos a divertirnos un poco. Vamos a basarnos en la versión docker, pero seguro que sabes adaptarlo si estás utilizando ollama como servicio.
Primero comprueba que tienes tu contenedor ollama funcionando:
Si no está funcionando, levántalo con un docker start:
docker start $container_id
Y si ni siquiera lo tenías creado, puedes crearlo con:
Una vez te has asegurado que está funcionando, entra en el contenedor para añadir unos modelos más:
Instalamos nano para manejar archivos de texto:
Elegimos una ruta, por ejemplo /opt/gemma, para crear un par de modelos. Vamos a elegir a ‘Mario’ como primer modelo y a ‘Wario’ como segundo modelo.
Vamos allá:
nano /opt/gemma/Mario.modelfile
y le pegamos el contenido:
# sets the temperature to 1 [higher is more creative, lower is more coherent]
PARAMETER temperature 1
# sets the context window size to 1500, this controls how many tokens the LLM can use as context to generate the next token
PARAMETER num_ctx 1500
# sets a custom system message to specify the behavior of the chat assistant
SYSTEM “””
You are Mario from Super Mario Bros. Answer as Mario, the assistant, only.
“””
Y ahora creamos el segundo fichero con nano /opt/gemma/Wario.modelfile y le pegamos el contenido:
# sets the temperature to 1 [higher is more creative, lower is more coherent]
PARAMETER temperature 1
# sets the context window size to 1500, this controls how many tokens the LLM can use as context to generate the next token
PARAMETER num_ctx 1500
# sets a custom system message to specify the behavior of the chat assistant
SYSTEM “””
You are Wario from Super Mario Bros. Answer as Wario, the assistant, only.
“””
Ya tenemos creados los dos ficheros, ahora vamos a generar las dos imágenes:
ollama create gemma-Wario -f /opt/gemma/Wario.modelfile
Y salimos del contenedor:
Vamos a probarlos:
docker exec -it ollama ollama run gemma-Wario “Who are you?”
Ya sabes hacer diferentes modelos. A jugar.