Text Generation
Transformers
GGUF
code
granite
TensorBlock
GGUF
Eval Results (legacy)
conversational
Instructions to use tensorblock/granite-3b-code-instruct-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-instruct-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-instruct-2k-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tensorblock/granite-3b-code-instruct-2k-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tensorblock/granite-3b-code-instruct-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-instruct-2k-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf tensorblock/granite-3b-code-instruct-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-instruct-2k-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama cli -hf tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
Use Docker
docker model run hf.co/tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
- Llama new
- LM Studio
- Jan
- vLLM
How to use tensorblock/granite-3b-code-instruct-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-instruct-2k-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": "tensorblock/granite-3b-code-instruct-2k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
- SGLang
How to use tensorblock/granite-3b-code-instruct-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-instruct-2k-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": "tensorblock/granite-3b-code-instruct-2k-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 "tensorblock/granite-3b-code-instruct-2k-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": "tensorblock/granite-3b-code-instruct-2k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use tensorblock/granite-3b-code-instruct-2k-GGUF with Ollama:
ollama run hf.co/tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
- Unsloth Desktop
- Docker Model Runner
How to use tensorblock/granite-3b-code-instruct-2k-GGUF with Docker Model Runner:
docker model run hf.co/tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
- Lemonade
How to use tensorblock/granite-3b-code-instruct-2k-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
Run and chat with the model
lemonade run user.granite-3b-code-instruct-2k-GGUF-Q2_K
List all available models
lemonade list
- Atomic Chat
Update README.md
Browse files
README.md
CHANGED
|
@@ -102,8 +102,16 @@ This repo contains GGUF format model files for [ibm-granite/granite-3b-code-inst
|
|
| 102 |
|
| 103 |
The files were quantized using machines provided by [TensorBlock](https://tensorblock.co/), and they are compatible with llama.cpp as of [commit b4011](https://github.com/ggerganov/llama.cpp/commit/a6744e43e80f4be6398fc7733a01642c846dce1d).
|
| 104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
## Prompt template
|
| 106 |
|
|
|
|
| 107 |
```
|
| 108 |
System:
|
| 109 |
{system_prompt}
|
|
@@ -118,18 +126,18 @@ Answer:
|
|
| 118 |
|
| 119 |
| Filename | Quant type | File Size | Description |
|
| 120 |
| -------- | ---------- | --------- | ----------- |
|
| 121 |
-
| [granite-3b-code-instruct-2k-Q2_K.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 122 |
-
| [granite-3b-code-instruct-2k-Q3_K_S.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 123 |
-
| [granite-3b-code-instruct-2k-Q3_K_M.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 124 |
-
| [granite-3b-code-instruct-2k-Q3_K_L.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 125 |
-
| [granite-3b-code-instruct-2k-Q4_0.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 126 |
-
| [granite-3b-code-instruct-2k-Q4_K_S.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 127 |
-
| [granite-3b-code-instruct-2k-Q4_K_M.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 128 |
-
| [granite-3b-code-instruct-2k-Q5_0.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 129 |
-
| [granite-3b-code-instruct-2k-Q5_K_S.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 130 |
-
| [granite-3b-code-instruct-2k-Q5_K_M.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 131 |
-
| [granite-3b-code-instruct-2k-Q6_K.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 132 |
-
| [granite-3b-code-instruct-2k-Q8_0.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/
|
| 133 |
|
| 134 |
|
| 135 |
## Downloading instruction
|
|
|
|
| 102 |
|
| 103 |
The files were quantized using machines provided by [TensorBlock](https://tensorblock.co/), and they are compatible with llama.cpp as of [commit b4011](https://github.com/ggerganov/llama.cpp/commit/a6744e43e80f4be6398fc7733a01642c846dce1d).
|
| 104 |
|
| 105 |
+
|
| 106 |
+
<div style="text-align: left; margin: 20px 0;">
|
| 107 |
+
<a href="https://tensorblock.co/waitlist/client" style="display: inline-block; padding: 10px 20px; background-color: #007bff; color: white; text-decoration: none; border-radius: 5px; font-weight: bold;">
|
| 108 |
+
Run them on the TensorBlock client using your local machine ↗
|
| 109 |
+
</a>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
## Prompt template
|
| 113 |
|
| 114 |
+
|
| 115 |
```
|
| 116 |
System:
|
| 117 |
{system_prompt}
|
|
|
|
| 126 |
|
| 127 |
| Filename | Quant type | File Size | Description |
|
| 128 |
| -------- | ---------- | --------- | ----------- |
|
| 129 |
+
| [granite-3b-code-instruct-2k-Q2_K.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q2_K.gguf) | Q2_K | 1.247 GB | smallest, significant quality loss - not recommended for most purposes |
|
| 130 |
+
| [granite-3b-code-instruct-2k-Q3_K_S.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q3_K_S.gguf) | Q3_K_S | 1.445 GB | very small, high quality loss |
|
| 131 |
+
| [granite-3b-code-instruct-2k-Q3_K_M.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q3_K_M.gguf) | Q3_K_M | 1.608 GB | very small, high quality loss |
|
| 132 |
+
| [granite-3b-code-instruct-2k-Q3_K_L.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q3_K_L.gguf) | Q3_K_L | 1.747 GB | small, substantial quality loss |
|
| 133 |
+
| [granite-3b-code-instruct-2k-Q4_0.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q4_0.gguf) | Q4_0 | 1.860 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
|
| 134 |
+
| [granite-3b-code-instruct-2k-Q4_K_S.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q4_K_S.gguf) | Q4_K_S | 1.875 GB | small, greater quality loss |
|
| 135 |
+
| [granite-3b-code-instruct-2k-Q4_K_M.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q4_K_M.gguf) | Q4_K_M | 1.986 GB | medium, balanced quality - recommended |
|
| 136 |
+
| [granite-3b-code-instruct-2k-Q5_0.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q5_0.gguf) | Q5_0 | 2.251 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
|
| 137 |
+
| [granite-3b-code-instruct-2k-Q5_K_S.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q5_K_S.gguf) | Q5_K_S | 2.251 GB | large, low quality loss - recommended |
|
| 138 |
+
| [granite-3b-code-instruct-2k-Q5_K_M.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q5_K_M.gguf) | Q5_K_M | 2.316 GB | large, very low quality loss - recommended |
|
| 139 |
+
| [granite-3b-code-instruct-2k-Q6_K.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q6_K.gguf) | Q6_K | 2.666 GB | very large, extremely low quality loss |
|
| 140 |
+
| [granite-3b-code-instruct-2k-Q8_0.gguf](https://huggingface.co/tensorblock/granite-3b-code-instruct-2k-GGUF/blob/main/granite-3b-code-instruct-2k-Q8_0.gguf) | Q8_0 | 3.451 GB | very large, extremely low quality loss - not recommended |
|
| 141 |
|
| 142 |
|
| 143 |
## Downloading instruction
|