Instructions to use fedric95/gemma-7b-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fedric95/gemma-7b-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fedric95/gemma-7b-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("fedric95/gemma-7b-GGUF", dtype="auto") - llama-cpp-python
How to use fedric95/gemma-7b-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="fedric95/gemma-7b-GGUF", filename="gemma-7b-Q2_K.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use fedric95/gemma-7b-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf fedric95/gemma-7b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf fedric95/gemma-7b-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf fedric95/gemma-7b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf fedric95/gemma-7b-GGUF:Q4_K_M
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 fedric95/gemma-7b-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf fedric95/gemma-7b-GGUF:Q4_K_M
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 fedric95/gemma-7b-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf fedric95/gemma-7b-GGUF:Q4_K_M
Use Docker
docker model run hf.co/fedric95/gemma-7b-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use fedric95/gemma-7b-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fedric95/gemma-7b-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fedric95/gemma-7b-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/fedric95/gemma-7b-GGUF:Q4_K_M
- SGLang
How to use fedric95/gemma-7b-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "fedric95/gemma-7b-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fedric95/gemma-7b-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "fedric95/gemma-7b-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fedric95/gemma-7b-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use fedric95/gemma-7b-GGUF with Ollama:
ollama run hf.co/fedric95/gemma-7b-GGUF:Q4_K_M
- Unsloth Studio new
How to use fedric95/gemma-7b-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 fedric95/gemma-7b-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 fedric95/gemma-7b-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for fedric95/gemma-7b-GGUF to start chatting
- Docker Model Runner
How to use fedric95/gemma-7b-GGUF with Docker Model Runner:
docker model run hf.co/fedric95/gemma-7b-GGUF:Q4_K_M
- Lemonade
How to use fedric95/gemma-7b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull fedric95/gemma-7b-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.gemma-7b-GGUF-Q4_K_M
List all available models
lemonade list
Llamacpp Quantizations of Meta-Llama-3.1-8B
Using llama.cpp release b3583 for quantization.
Original model: https://huggingface.co/google/gemma-7b
Download a file (not the whole branch) from below:
| Filename | Quant type | File Size | Perplexity (wikitext-2-raw-v1.test) |
|---|---|---|---|
| gemma-7b.BF16.gguf | BF16 | 17.1 GB | 6.9857 +/- 0.04411 |
| gemma-7b-Q8_0.gguf | Q8_0 | 9.08 GB | 7.0373 +/- 0.04456 |
| gemma-7b-Q6_K.gguf | Q6_K | 7.01 GB | 7.3858 +/- 0.04762 |
| gemma-7b-Q5_K_M.gguf | Q5_K_M | 6.14 GB | 7.4227 +/- 0.04781 |
| gemma-7b-Q5_K_S.gguf | Q5_K_S | 5.98 GB | 7.5232 +/- 0.04857 |
| gemma-7b-Q4_K_M.gguf | Q4_K_M | 5.33 GB | 7.5800 +/- 0.04918 |
| gemma-7b-Q4_K_S.gguf | Q4_K_S | 5.05 GB | 7.9673 +/- 0.05225 |
| gemma-7b-Q3_K_L.gguf | Q3_K_L | 4.71 GB | 7.9586 +/- 0.05186 |
| gemma-7b-Q3_K_M.gguf | Q3_K_M | 4.37 GB | 8.4077 +/- 0.05545 |
| gemma-7b-Q3_K_S.gguf | Q3_K_S | 3.98 GB | 102.6126 +/- 1.62310 |
| gemma-7b-Q2_K.gguf | Q2_K | 3.48 GB | 3970.5385 +/- 102.46527 |
Downloading using huggingface-cli
First, make sure you have hugginface-cli installed:
pip install -U "huggingface_hub[cli]"
Then, you can target the specific file you want:
huggingface-cli download fedric95/gemma-7b-GGUF --include "gemma-7b-Q4_K_M.gguf" --local-dir ./
If the model is bigger than 50GB, it will have been split into multiple files. In order to download them all to a local folder, run:
huggingface-cli download fedric95/gemma-7b-GGUF --include "gemma-7b-Q8_0.gguf/*" --local-dir gemma-7b-Q8_0
You can either specify a new local-dir (gemma-7b-Q8_0) or download them all in place (./)
Reproducibility
https://github.com/ggerganov/llama.cpp/discussions/9020#discussioncomment-10335638
- Downloads last month
- 389
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
16-bit
Model tree for fedric95/gemma-7b-GGUF
Base model
google/gemma-7b