02-01-02 - Ollama Install and Variant

1. Ollama Install Video 1

** This tutorial explains hermes first, makes for sense to me to do ollama first, espcially on intel,

OLLAMA Desktop **doesn't behave / work on intel

see Video 1 for extra help, and follow this tutorial

2. Ollama

Go to ollama.com/download/mac download ollama with curl

curl -fsSL https://ollama.com/install.sh | sh

Or click Download manually

**PRoblem HERE

3. 2-b. ChatGpt question /answer

I have chat copy of terminal output, and I asked chatgpt to explain the output,
it says,

Run

ollama serve

Open new termainl run

ollama --version

it should work

3. Model gemma4

We'ere using

gemma4

go to https://ollama.com/library/gemma4

Under Applications are commads to run models,

Commands

04 Context Window legnths

Hermes website, I found it! NOTE TO SELF:, use search bar in docs on herems nousportal site , I found it here https://hermes-agent.nousresearch.com/docs/guides/local-ollama-setup

Ollama by default only runs a 24,000 context legnth, we need to change it to 64,000

To change Context Window Length, we create a Modelfile

# Create a Modelfile that extends context
cat > ~/.hermes/cache/scratch/Modelfile << 'EOF'
FROM gemma4:31b
PARAMETER num_ctx 64000
EOF

ollama create gemma4-64k -f ~/.hermes/cache/scratch/Modelfile

To do this paste in the follwing string in termainal

05 Change Context Window, create Modelfile

This is where the Variant is created to copy model with correct context window size with new name

Open the termainl and paste in the following string ,

printf 'FROM gemma4:e4b\nPARAMETER num_ctx 64000\n' > /tmp/gemma4e-64k.Modelfile && ollama create gemma4e-64k -f /tmp/gemma4e-64k.Modelfile

To see the model copy Variant type

ollama list

Running the printf command ALSO pulled the model with having to download it first