Model Lifecycle Management¶
Effectively managing LLM weights is crucial on edge hardware where storage and memory are highly constrained.
1. Model Inventory¶
To see which models are currently downloaded and stored on your node's Persistent Volume:
Expected Output:
NAME ID SIZE MODIFIED
llama3.2:1b abcd1234efgh 1.3 GB 2 days ago
qwen2.5:1.5b ijkl5678mnop 1.1 GB 4 hours ago
2. Pulling Models¶
You can download models directly from the Ollama registry without running them immediately:
[!TIP] Pulling large models (e.g., Llama 3 8B at ~5GB) can take several minutes depending on your network connection. During this time, the disk I/O on the node will increase.
3. Creating Custom Models from Modelfile¶
To create a customized version of a model (e.g., setting a system prompt or tuning parameters):
-
Create a
Modelfilelocally: -
Copy the file into the pod:
-
Build the model:
4. Load and Unload Procedures¶
Models are automatically loaded into VRAM when an API request is received. However, on small GPUs, you may need to explicitly manage memory.
Verify Loaded Models¶
See which models are currently consuming VRAM:
Expected Output:Force Unload a Model¶
If you need to free up VRAM immediately for a different model:
5. Storage Management¶
Models are stored on a Persistent Volume Claim (PVC) mounted to /root/.ollama inside the ollama-0 pod.
If your disk fills up, you must delete old models:
To see actual disk usage on the host (assuming local-path-provisioner):
6. Model Switching on Small GPUs¶
When running Open WebUI on a small GPU (e.g., 8GB-12GB), rapidly switching between chats that use different models can cause Out-Of-Memory (OOM) errors if the previous model hasn't been unloaded yet.
Best Practice:
Configure Open WebUI to aggressively unload models. In the Open WebUI admin settings, navigate to the Connections > Ollama section and set the Keep Alive setting to a very short duration (e.g., 1m or 0) if you frequently switch models.