Skip to main content

Model guide

Gemma 2 2B Instruct

Gemma 2 2B is the compact, text-only option in the Gemma 2 instruction family. Try it for brief rewriting or extraction when keeping the download small is the main constraint. It has neither the image input of larger Gemma 3 models nor their longer context, so keep this comparison to short text tasks.

2BText chat8,192 token contextView the model card →

At a glance

Parameters
2B
Accepts
Text
Returns
Text
Published context limit
8,192 tokens
Model format
safetensors · GGUF
Software and download hosts
Ollama · Transformers · Kaggle. Follow the exact setup below; this list does not establish support for every format, input type or software version.
Suggested compression
Q4_K_M
Model-weight download
Q4_K_M weights · 1.71 GBbartowski (community conversion)gemma-2-2b-it-Q4_K_M.gguf
Languages
English

Will it fit?

Gemma 2 2B Instruct · Q4_K_M download. Fit depends on your computer, the app you run it in and the conversation length you need.

Check on your computer

Best for

  • Extract the item count from a sentence that also gives a parcel weight. Check that the answer is four items and that the model ignored the unrelated weight.

Choose something else when

  • For image input or native tool calls, choose a checkpoint designed for that interface.

First setup

Check a representative task

Try compact extraction rather than a long conversation.

From "The parcel weighs 2 kilograms and contains four notebooks", return only the number of notebooks.

Check the result: The answer is 4. The model should not confuse the weight with the item count.

This creates a 4,096-token copy of gemma2:2b-instruct-q4_K_M named gemma-2-2b-it-short-context. Save the following as a file named Modelfile in your working folder:

FROM gemma2:2b-instruct-q4_K_M
PARAMETER num_ctx 4096

Then run these commands from that folder:

ollama pull gemma2:2b-instruct-q4_K_M
ollama create gemma-2-2b-it-short-context -f ./Modelfile
ollama run gemma-2-2b-it-short-context

Run the task check. While the model is loaded, run ollama ps in another terminal and check CONTEXT and PROCESSOR.

The recorded Ollama package is Q4_K_M: 1.71 GB of model weights. Use Ollama 0.40.18 or a supporting newer release. A Hugging Face GGUF or MLX checkpoint is a separate representation; choose the matching source and runner in the memory calculator.

See Ollama context settings and the Modelfile instructions.

Other models for this task