Choose and run open models
Measure what a smaller, more compressed copy of a model costs you in quality and gives you in speed and memory.
You build: A table for one model at two compression levels: size, memory, tokens per second, and your score.
- Ollama
- About 6 GB of free disk
- Lab 12 done (your five prompts)
-
01Pull the same model at 4-bit and 8-bit
Quantising stores each weight in fewer bits. The file shrinks and runs faster; some accuracy is lost. How much is what you measure.
ollama pull llama3.2:3b-instruct-q4_K_M && ollama pull llama3.2:3b-instruct-q8_0 && ollama listYou pass when: Two entries for the same model. The 8-bit one is clearly larger on disk.
-
02Time both on one prompt
ollama run llama3.2:3b-instruct-q4_K_M --verbose "Write a haiku about parcels"You pass when: After the answer, a block of timings with an eval rate in tokens per second. Run it for both and note the two rates.
-
03See what is loaded and how much memory it takes
ollama psYou pass when: The loaded model with its size in memory and whether it runs on the GPU.
-
04Run your five prompts from lab 12 on both and score them blind
cat QUANT.mdYou pass when: A table with size, memory, speed and average score for each, and the one you would ship.
The check runs on the computer, not on your word: a step passes when its command exits with 0 there.
Computers are not set up on this site yet. Run each command on your own machine and compare with "You pass when".
Commands run in labs/34-open-weights and may take up to 60 seconds each. Every command starts a new shell: put keys and settings in a .env file there, it is loaded each time.