Instructions to use tensorblock/gemma-2-9b-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tensorblock/gemma-2-9b-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tensorblock/gemma-2-9b-GGUF")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tensorblock/gemma-2-9b-GGUF", dtype="auto") - llama-cpp-python
How to use tensorblock/gemma-2-9b-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="tensorblock/gemma-2-9b-GGUF", filename="gemma-2-9b-Q2_K.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tensorblock/gemma-2-9b-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf tensorblock/gemma-2-9b-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf tensorblock/gemma-2-9b-GGUF:Q2_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf tensorblock/gemma-2-9b-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf tensorblock/gemma-2-9b-GGUF:Q2_K
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 tensorblock/gemma-2-9b-GGUF:Q2_K # Run inference directly in the terminal: ./llama-cli -hf tensorblock/gemma-2-9b-GGUF:Q2_K
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 tensorblock/gemma-2-9b-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf tensorblock/gemma-2-9b-GGUF:Q2_K
Use Docker
docker model run hf.co/tensorblock/gemma-2-9b-GGUF:Q2_K
- LM Studio
- Jan
- vLLM
How to use tensorblock/gemma-2-9b-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tensorblock/gemma-2-9b-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tensorblock/gemma-2-9b-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tensorblock/gemma-2-9b-GGUF:Q2_K
- SGLang
How to use tensorblock/gemma-2-9b-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 "tensorblock/gemma-2-9b-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tensorblock/gemma-2-9b-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "tensorblock/gemma-2-9b-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tensorblock/gemma-2-9b-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use tensorblock/gemma-2-9b-GGUF with Ollama:
ollama run hf.co/tensorblock/gemma-2-9b-GGUF:Q2_K
- Unsloth Studio
How to use tensorblock/gemma-2-9b-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 tensorblock/gemma-2-9b-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 tensorblock/gemma-2-9b-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for tensorblock/gemma-2-9b-GGUF to start chatting
- Docker Model Runner
How to use tensorblock/gemma-2-9b-GGUF with Docker Model Runner:
docker model run hf.co/tensorblock/gemma-2-9b-GGUF:Q2_K
- Lemonade
How to use tensorblock/gemma-2-9b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tensorblock/gemma-2-9b-GGUF:Q2_K
Run and chat with the model
lemonade run user.gemma-2-9b-GGUF-Q2_K
List all available models
lemonade list
Remove gguf quant files (Q4/Q5/Q6/Q8 variants)
Browse files- gemma-2-9b-Q4_0.gguf +0 -3
- gemma-2-9b-Q4_K_S.gguf +0 -3
- gemma-2-9b-Q5_0.gguf +0 -3
- gemma-2-9b-Q5_K_M.gguf +0 -3
- gemma-2-9b-Q5_K_S.gguf +0 -3
- gemma-2-9b-Q6_K.gguf +0 -3
- gemma-2-9b-Q8_0.gguf +0 -3
gemma-2-9b-Q4_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:a7727d251eb83f63988e5dc7c5d61494b7f325cae37eb7fa6e5017b2ae7febf7
|
| 3 |
-
size 5443141920
|
|
|
|
|
|
|
|
|
|
|
|
gemma-2-9b-Q4_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:4440de062603ee96e5bec7ae46b68edacbb08b62f897bf7ef9c3168e544c5a82
|
| 3 |
-
size 5478924576
|
|
|
|
|
|
|
|
|
|
|
|
gemma-2-9b-Q5_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:ad2438dd6236528aa9e6da099e380dab20b806432625c53a5728e80725dac2f8
|
| 3 |
-
size 6483591456
|
|
|
|
|
|
|
|
|
|
|
|
gemma-2-9b-Q5_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:5d43c0777c38d6eb835c26c14aeda656df2c9ad31d6a6255f3f479520b0d4535
|
| 3 |
-
size 6647365920
|
|
|
|
|
|
|
|
|
|
|
|
gemma-2-9b-Q5_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:8c166542809a3d054b9632b8d2f770006da574c699c03f0ba64519c42cf37a86
|
| 3 |
-
size 6483591456
|
|
|
|
|
|
|
|
|
|
|
|
gemma-2-9b-Q6_K.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:67a8fd5eb1507eb966b33905c145e8f3b9bfea9dad0cdeedad3e07d37892070a
|
| 3 |
-
size 7589069088
|
|
|
|
|
|
|
|
|
|
|
|
gemma-2-9b-Q8_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:93f7d9c9143fabe4ba1f9811cfa39ace3c889956bda6e4ace2115fe4646fee32
|
| 3 |
-
size 9827148064
|
|
|
|
|
|
|
|
|
|
|
|