Run Gemma 2 with Ollama
Ollama is the program that manages local models. Gemma 2 is the language model we’ll ask questions. Start with the 2B version: it is a smaller download and a sensible first experiment.
1. Install Ollama
Download Ollama from the official download page and install the version for your system. On Windows and macOS, open the Ollama app after installation. On Linux, follow the instructions on the official page.
Then open a terminal (PowerShell on Windows, Terminal on macOS or Linux) and check that the command is available:
ollama --versionIf you see a version number, Ollama is ready. If not, finish the installer and open a new terminal window.
2. Download and run Gemma 2
Enter this command. The first run downloads the model, so it can take a little while depending on your connection.
ollama run gemma2:2bWhen the model is ready, type a message at the prompt. For example:
Explain what a local language model is in three short sentences.To leave the chat, type /bye and press Enter. The downloaded model stays on your computer.
3. Try these prompts
Use these to get a feel for how instructions change an answer:
- Explain: “Explain how a bicycle gear works to a 10-year-old. Use four bullet points.”
- Summarize: “Summarize why sleep matters in exactly two sentences.”
- Refine: Ask it to rewrite its answer “with simpler words and one practical example.”
Notice what it follows well and what it misses. Local models can make mistakes, so check important facts.
4. Check your setup
ollama --version prints a version.ollama run gemma2:2b opens a conversation./bye to return to your terminal.Useful commands
List the models stored on your computer, or remove one when you no longer need it:
ollama listollama rm gemma2:2bMore details are available in the Gemma 2 model page and Ollama documentation.