Instructions to use tensorblock/granite-20b-code-base-8k-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tensorblock/granite-20b-code-base-8k-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tensorblock/granite-20b-code-base-8k-GGUF")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tensorblock/granite-20b-code-base-8k-GGUF", dtype="auto") - llama-cpp-python
How to use tensorblock/granite-20b-code-base-8k-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="tensorblock/granite-20b-code-base-8k-GGUF", filename="granite-20b-code-base-8k-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/granite-20b-code-base-8k-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/granite-20b-code-base-8k-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf tensorblock/granite-20b-code-base-8k-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/granite-20b-code-base-8k-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf tensorblock/granite-20b-code-base-8k-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/granite-20b-code-base-8k-GGUF:Q2_K # Run inference directly in the terminal: ./llama-cli -hf tensorblock/granite-20b-code-base-8k-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/granite-20b-code-base-8k-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf tensorblock/granite-20b-code-base-8k-GGUF:Q2_K
Use Docker
docker model run hf.co/tensorblock/granite-20b-code-base-8k-GGUF:Q2_K
- LM Studio
- Jan
- vLLM
How to use tensorblock/granite-20b-code-base-8k-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tensorblock/granite-20b-code-base-8k-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/granite-20b-code-base-8k-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tensorblock/granite-20b-code-base-8k-GGUF:Q2_K
- SGLang
How to use tensorblock/granite-20b-code-base-8k-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/granite-20b-code-base-8k-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/granite-20b-code-base-8k-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/granite-20b-code-base-8k-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/granite-20b-code-base-8k-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use tensorblock/granite-20b-code-base-8k-GGUF with Ollama:
ollama run hf.co/tensorblock/granite-20b-code-base-8k-GGUF:Q2_K
- Unsloth Studio
How to use tensorblock/granite-20b-code-base-8k-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/granite-20b-code-base-8k-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/granite-20b-code-base-8k-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/granite-20b-code-base-8k-GGUF to start chatting
- Docker Model Runner
How to use tensorblock/granite-20b-code-base-8k-GGUF with Docker Model Runner:
docker model run hf.co/tensorblock/granite-20b-code-base-8k-GGUF:Q2_K
- Lemonade
How to use tensorblock/granite-20b-code-base-8k-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tensorblock/granite-20b-code-base-8k-GGUF:Q2_K
Run and chat with the model
lemonade run user.granite-20b-code-base-8k-GGUF-Q2_K
List all available models
lemonade list
Keep Q2_K/Q3_K_M gguf only
Browse files- granite-20b-code-base-8k-Q3_K_L.gguf +0 -3
- granite-20b-code-base-8k-Q3_K_S.gguf +0 -3
- granite-20b-code-base-8k-Q4_0.gguf +0 -3
- granite-20b-code-base-8k-Q4_K_M.gguf +0 -3
- granite-20b-code-base-8k-Q4_K_S.gguf +0 -3
- granite-20b-code-base-8k-Q5_0.gguf +0 -3
- granite-20b-code-base-8k-Q5_K_M.gguf +0 -3
- granite-20b-code-base-8k-Q5_K_S.gguf +0 -3
- granite-20b-code-base-8k-Q6_K.gguf +0 -3
- granite-20b-code-base-8k-Q8_0.gguf +0 -3
granite-20b-code-base-8k-Q3_K_L.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:a0337ebd3199c88f32b694072946fca7ce8aef493ac4919d56f498135ce94428
|
| 3 |
-
size 11736504160
|
|
|
|
|
|
|
|
|
|
|
|
granite-20b-code-base-8k-Q3_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:4b9fc585cec410bcdf1e342eaf75903d3566c4fb407646bd38d06d8bf770e613
|
| 3 |
-
size 8934594400
|
|
|
|
|
|
|
|
|
|
|
|
granite-20b-code-base-8k-Q4_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:34d7ac7b95ffa22d5e722f18b81e17d30aa92a95ce750219c0edaf7145f5360d
|
| 3 |
-
size 11552479072
|
|
|
|
|
|
|
|
|
|
|
|
granite-20b-code-base-8k-Q4_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:cedef153e05490bc88e292eb98e062f6dca5c08c9f90a0dde162b82b96f75d41
|
| 3 |
-
size 12820207456
|
|
|
|
|
|
|
|
|
|
|
|
granite-20b-code-base-8k-Q4_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:eb24f107d7057eee6e2e66afad09633a1f9ad921bf8f40935a5cfc795369d34c
|
| 3 |
-
size 11665725280
|
|
|
|
|
|
|
|
|
|
|
|
granite-20b-code-base-8k-Q5_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:7b6929d67b6cf1a047662fc72cfe8af05c41d52474829ca6822396675f00091f
|
| 3 |
-
size 14016370528
|
|
|
|
|
|
|
|
|
|
|
|
granite-20b-code-base-8k-Q5_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:e13adb0d5f6fa963126e7dbc69e02113e5a25f908a1346b8064ca2cf3352e6b3
|
| 3 |
-
size 14809339744
|
|
|
|
|
|
|
|
|
|
|
|
granite-20b-code-base-8k-Q5_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:5b8d2656e28f3bbb81a454f11d1fe3988649285744b33c30de0a9ed29faf4bf9
|
| 3 |
-
size 14016370528
|
|
|
|
|
|
|
|
|
|
|
|
granite-20b-code-base-8k-Q6_K.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:23344685597c9e45d32ff2e163945bbcee32be1a522e262e0dadaa26c58612b7
|
| 3 |
-
size 16634255200
|
|
|
|
|
|
|
|
|
|
|
|
granite-20b-code-base-8k-Q8_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:65f11193d2ff72046100b80626186ebecb6f02effe18abfeb34d4ea755368622
|
| 3 |
-
size 21481183072
|
|
|
|
|
|
|
|
|
|
|
|