Instructions to use google/gemma-2-2b-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use google/gemma-2-2b-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="google/gemma-2-2b-GGUF", filename="2b_pt_v2.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use google/gemma-2-2b-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf google/gemma-2-2b-GGUF # Run inference directly in the terminal: llama-cli -hf google/gemma-2-2b-GGUF
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf google/gemma-2-2b-GGUF # Run inference directly in the terminal: llama-cli -hf google/gemma-2-2b-GGUF
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf google/gemma-2-2b-GGUF # Run inference directly in the terminal: ./llama-cli -hf google/gemma-2-2b-GGUF
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf google/gemma-2-2b-GGUF # Run inference directly in the terminal: ./build/bin/llama-cli -hf google/gemma-2-2b-GGUF
Use Docker
docker model run hf.co/google/gemma-2-2b-GGUF
- LM Studio
- Jan
- Ollama
How to use google/gemma-2-2b-GGUF with Ollama:
ollama run hf.co/google/gemma-2-2b-GGUF
- Unsloth Studio new
How to use google/gemma-2-2b-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for google/gemma-2-2b-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for google/gemma-2-2b-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for google/gemma-2-2b-GGUF to start chatting
- Docker Model Runner
How to use google/gemma-2-2b-GGUF with Docker Model Runner:
docker model run hf.co/google/gemma-2-2b-GGUF
- Lemonade
How to use google/gemma-2-2b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull google/gemma-2-2b-GGUF
Run and chat with the model
lemonade run user.gemma-2-2b-GGUF-{{QUANT_TAG}}List all available models
lemonade list
Access Gemma on Hugging Face
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
To access Gemma on Hugging Face, you’re required to review and agree to Google’s usage license. To do this, please ensure you’re logged-in to Hugging Face and click below. Requests are processed immediately.
Log in or Sign Up to review the conditions and access this model content.
Gemma Model Card
Model Page: Gemma
This model card corresponds to the 2b pretrained version of the Gemma 2 model in GGUF Format. The weights here are float32.
In llama.cpp, and other related tools such as Ollama and LM Studio, please make sure that you have these flags set correctly, especially
repeat-penalty. Georgi Gerganov (llama.cpp's author) shared his experience in https://huggingface.co/google/gemma-7b-it/discussions/38#65d7b14adb51f7c160769fa1.
You can also visit the model card of the 2B instruct v2 model GGUF.
Resources and Technical Documentation:
Terms of Use: Terms
Authors: Google
Model Information
Summary description and brief definition of inputs and outputs.
Description
Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models. They are text-to-text, decoder-only large language models, available in English, with open weights, pre-trained variants, and instruction-tuned variants. Gemma models are well-suited for a variety of text generation tasks, including question answering, summarization, and reasoning. Their relatively small size makes it possible to deploy them in environments with limited resources such as a laptop, desktop or your own cloud infrastructure, democratizing access to state of the art AI models and helping foster innovation for everyone.
- Downloads last month
- 152
We're not able to determine the quantization variants.