ollama
Install instruction
Output:
https://docs.ollama.com/linux
Launch environment
#!/bin/bash # maximum number of parallel requests per model export OLLAMA_NUM_PARALLEL=1 # extra debug output export OLLAMA_DEBUG=1 # Keep models loaded for a day export OLLAMA_KEEP_ALIVE=36000 # Bind on all interface make ollama available on local network export OLLAMA_HOST=0.0.0.0 ollama serve
First run
ollama pull
Access ollama on remote machine
OLLAMA_HOST=http://192.168.0.55:11434 ollama run
Create new model
Tip
Output:
Over-and-over again, when a new model come out, I made a test run with chat, code generating, text review, tool usage, etc, pick up the most capable model for these task, scale the context size to mostly fit into the GPU (max-1 GB to run with other embedding models in parallel, as some application loads them). Then use the model name and context length to create a model called default:latest. All my applications VSCodium/KiloCode, Khoj, Obsidian, LangChain, Fabric, all of them using default:latest, which can be replaced when a new better, shinyer model has come and no need the hustle to update model name and context length everywhere.
Scale up model to GPU size
# Run ollama with custom context length OLLAMA_CONTEXT_LENGTH=164000 ollama serve # Run your model (load at least) ollama run qwen3.5:9b # See the GPU usage ollama ps
Output:
NAME ID SIZE PROCESSOR CONTEXT UNTIL qwen3.5:9b 6488c96fa5fa 11 GB 100% GPU 164000 4 minutes from now
Dump model and save to file
ollama show --modelfile qwen3.5:9b > default.Modelfile
Edit the modelfile
edit default.Modelfile
Output:
Change "FROM " and "PARAMETER num_ctx 164000". I also set "PARAMETER temperature 0" this makes model less creative but more deterministic.
Delete old model
ollama rm default:latest
Create new model
ollama create default:latest -f default.Modelfile