Instructions to use tensorblock/granite-3b-code-base-2k-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tensorblock/granite-3b-code-base-2k-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tensorblock/granite-3b-code-base-2k-GGUF")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tensorblock/granite-3b-code-base-2k-GGUF", dtype="auto") - llama-cpp-python
How to use tensorblock/granite-3b-code-base-2k-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="tensorblock/granite-3b-code-base-2k-GGUF", filename="granite-3b-code-base-2k-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-3b-code-base-2k-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf tensorblock/granite-3b-code-base-2k-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf tensorblock/granite-3b-code-base-2k-GGUF:Q2_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf tensorblock/granite-3b-code-base-2k-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf tensorblock/granite-3b-code-base-2k-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-3b-code-base-2k-GGUF:Q2_K # Run inference directly in the terminal: ./llama-cli -hf tensorblock/granite-3b-code-base-2k-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-3b-code-base-2k-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf tensorblock/granite-3b-code-base-2k-GGUF:Q2_K
Use Docker
docker model run hf.co/tensorblock/granite-3b-code-base-2k-GGUF:Q2_K
- LM Studio
- Jan
- vLLM
How to use tensorblock/granite-3b-code-base-2k-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tensorblock/granite-3b-code-base-2k-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-3b-code-base-2k-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tensorblock/granite-3b-code-base-2k-GGUF:Q2_K
- SGLang
How to use tensorblock/granite-3b-code-base-2k-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-3b-code-base-2k-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-3b-code-base-2k-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-3b-code-base-2k-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-3b-code-base-2k-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use tensorblock/granite-3b-code-base-2k-GGUF with Ollama:
ollama run hf.co/tensorblock/granite-3b-code-base-2k-GGUF:Q2_K
- Unsloth Studio
How to use tensorblock/granite-3b-code-base-2k-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-3b-code-base-2k-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-3b-code-base-2k-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-3b-code-base-2k-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use tensorblock/granite-3b-code-base-2k-GGUF with Docker Model Runner:
docker model run hf.co/tensorblock/granite-3b-code-base-2k-GGUF:Q2_K
- Lemonade
How to use tensorblock/granite-3b-code-base-2k-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tensorblock/granite-3b-code-base-2k-GGUF:Q2_K
Run and chat with the model
lemonade run user.granite-3b-code-base-2k-GGUF-Q2_K
List all available models
lemonade list
Keep Q2_K/Q3_K_M gguf only
Browse files- granite-3b-code-base-2k-Q3_K_L.gguf +0 -3
- granite-3b-code-base-2k-Q3_K_S.gguf +0 -3
- granite-3b-code-base-2k-Q4_0.gguf +0 -3
- granite-3b-code-base-2k-Q4_K_M.gguf +0 -3
- granite-3b-code-base-2k-Q4_K_S.gguf +0 -3
- granite-3b-code-base-2k-Q5_0.gguf +0 -3
- granite-3b-code-base-2k-Q5_K_M.gguf +0 -3
- granite-3b-code-base-2k-Q5_K_S.gguf +0 -3
- granite-3b-code-base-2k-Q6_K.gguf +0 -3
- granite-3b-code-base-2k-Q8_0.gguf +0 -3
granite-3b-code-base-2k-Q3_K_L.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:c9d87e3a69a5d65f3bfdcf2bc005e57807b4c0f95ba391a0be7d1e2d64624c66
|
| 3 |
-
size 1876088608
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-base-2k-Q3_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:9959d90626419a1aa52d33bb610f9e9b1edd7cdcf226befc9324309f58602fbf
|
| 3 |
-
size 1551685408
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-base-2k-Q4_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:b90c5bb6cb7c9ac3702860ef2e42f97287e8b8de78d234079c196a888e5fc814
|
| 3 |
-
size 1997330208
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-base-2k-Q4_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:88618aeed3759f79d49a72b2c527159e64c677986c5695136fe86d1a7692f4d1
|
| 3 |
-
size 2132498208
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-base-2k-Q4_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:c8fa927757efe059537b72b421a7a558b4a3c5fd0ade36504d7e3ae3b16183fe
|
| 3 |
-
size 2013714208
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-base-2k-Q5_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:e3289f5c974e63b0d05f7db2cc5f5e6a17fe4113729c5bc6b8066e680a0f69f2
|
| 3 |
-
size 2416760608
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-base-2k-Q5_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:b3a7e724f7267bbf2fed61ae670263157b353e6570da058aef1a94a1cae4c7dd
|
| 3 |
-
size 2486392608
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-base-2k-Q5_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:0a18cc68cf6fc0d9063cc642ab48eeec001bc5688378011e5bd1b1523cdf0c10
|
| 3 |
-
size 2416760608
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-base-2k-Q6_K.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:46131b4d4b3bbca08fae6a6c3193e04092f88f420a176d5b5178eb88893a2cb0
|
| 3 |
-
size 2862405408
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-base-2k-Q8_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:1234ab0deca10483eb3792ed6c09dfb24cd276064f0183a20bfb6d924a3ec02a
|
| 3 |
-
size 3705526048
|
|
|
|
|
|
|
|
|
|
|
|