Google's Gemma 2 model family is now available to run locally via Ollama in three sizes: 2B, 9B, and 27B parameters. Google claims the 27B model outperforms models more than twice its size thanks to a new architecture. The post shows how to pull and run each size with a single command and how to integrate the model with LangChain and LlamaIndex.

1m read timeFrom ollama.com
Post cover image
Table of contents
Class leading performanceThree sizes: 2B, 9B and 27B parametersUsing Gemma 2 with popular tooling

Questions this post answers

How do I run Google Gemma 2 locally with Ollama?

Use the command 'ollama run gemma2' to run the default 9B parameter version. For the smaller 2B model, run 'ollama run gemma2:2b', and for the larger 27B model, run 'ollama run gemma2:27b'. All three sizes are available through Ollama's model library. daily.dev surfaces practical guides for developers experimenting with local LLM setups like this one.

What sizes does Google Gemma 2 come in?

Gemma 2 is released in three parameter sizes: 2B, 9B, and 27B. The 27B version features a new architecture and reportedly delivers performance surpassing models more than twice its size in benchmarks, positioning it as a leading open model at that scale. Comparing open model sizes and benchmarks is easier when developers track releases like Gemma 2 on daily.dev.

How do I use Gemma 2 with LangChain or LlamaIndex?

In LangChain, import Ollama from langchain_community.llms, instantiate it with model="gemma2", then call llm.invoke() with a prompt. In LlamaIndex, import Ollama from llama_index.llms.ollama, instantiate the same way, and call llm.complete() with a prompt. Both integrations route requests through the locally running Ollama model. daily.dev helps developers stay current on integrating new open models into their LLM tooling stack.

2 Impressions