Text Generation
Transformers
GGUF
code
granite
TensorBlock
GGUF
Eval Results (legacy)
conversational
Instructions to use tensorblock/granite-3b-code-instruct-128k-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-128k-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-128k-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tensorblock/granite-3b-code-instruct-128k-GGUF", dtype="auto") - llama-cpp-python
How to use tensorblock/granite-3b-code-instruct-128k-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-instruct-128k-GGUF", filename="granite-3b-code-instruct-128k-Q2_K.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tensorblock/granite-3b-code-instruct-128k-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-3b-code-instruct-128k-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf tensorblock/granite-3b-code-instruct-128k-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-3b-code-instruct-128k-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf tensorblock/granite-3b-code-instruct-128k-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-instruct-128k-GGUF:Q2_K # Run inference directly in the terminal: ./llama-cli -hf tensorblock/granite-3b-code-instruct-128k-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-instruct-128k-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf tensorblock/granite-3b-code-instruct-128k-GGUF:Q2_K
Use Docker
docker model run hf.co/tensorblock/granite-3b-code-instruct-128k-GGUF:Q2_K
- LM Studio
- Jan
- vLLM
How to use tensorblock/granite-3b-code-instruct-128k-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-128k-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-128k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tensorblock/granite-3b-code-instruct-128k-GGUF:Q2_K
- SGLang
How to use tensorblock/granite-3b-code-instruct-128k-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-128k-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-128k-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-128k-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-128k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use tensorblock/granite-3b-code-instruct-128k-GGUF with Ollama:
ollama run hf.co/tensorblock/granite-3b-code-instruct-128k-GGUF:Q2_K
- Unsloth Studio
How to use tensorblock/granite-3b-code-instruct-128k-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-instruct-128k-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-instruct-128k-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-instruct-128k-GGUF to start chatting
- Docker Model Runner
How to use tensorblock/granite-3b-code-instruct-128k-GGUF with Docker Model Runner:
docker model run hf.co/tensorblock/granite-3b-code-instruct-128k-GGUF:Q2_K
- Lemonade
How to use tensorblock/granite-3b-code-instruct-128k-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tensorblock/granite-3b-code-instruct-128k-GGUF:Q2_K
Run and chat with the model
lemonade run user.granite-3b-code-instruct-128k-GGUF-Q2_K
List all available models
lemonade list
Keep Q2_K/Q3_K_M gguf only
Browse files- granite-3b-code-instruct-128k-Q3_K_L.gguf +0 -3
- granite-3b-code-instruct-128k-Q3_K_S.gguf +0 -3
- granite-3b-code-instruct-128k-Q4_0.gguf +0 -3
- granite-3b-code-instruct-128k-Q4_K_M.gguf +0 -3
- granite-3b-code-instruct-128k-Q4_K_S.gguf +0 -3
- granite-3b-code-instruct-128k-Q5_0.gguf +0 -3
- granite-3b-code-instruct-128k-Q5_K_M.gguf +0 -3
- granite-3b-code-instruct-128k-Q5_K_S.gguf +0 -3
- granite-3b-code-instruct-128k-Q6_K.gguf +0 -3
- granite-3b-code-instruct-128k-Q8_0.gguf +0 -3
granite-3b-code-instruct-128k-Q3_K_L.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:6289d36e8da7db2a05d4ce8f506f38221d80ff437748061de7b3f827f7bc2b6d
|
| 3 |
-
size 1876089216
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-instruct-128k-Q3_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:3505f7058837518913c9ebed44d7fab004a8af744b82e677a9910315aa8aca44
|
| 3 |
-
size 1551686016
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-instruct-128k-Q4_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:259e525afc718ba49b87472e666ff0673cf8dd90f4f1c59a8be640d4e43ad87b
|
| 3 |
-
size 1997330816
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-instruct-128k-Q4_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:c27e1f8798d9ab1f1c2af435f71844990c8a8e889459539ca57c4882b4729fca
|
| 3 |
-
size 2132498816
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-instruct-128k-Q4_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:3d3f8429a028d507463e28f0f1d3b212089687290f3e6a45159fd4e939636184
|
| 3 |
-
size 2013714816
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-instruct-128k-Q5_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:72e557c5f95057f548e22ce32fa474f964052d117b6878331e5f4266bb186cde
|
| 3 |
-
size 2416761216
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-instruct-128k-Q5_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:fad97024600c7be3e13ad360161b2fe806b6e45d00c6db34fb1b03d01a84565a
|
| 3 |
-
size 2486393216
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-instruct-128k-Q5_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:1f9a15f2ceb81334f1a0654d5d2a335a1066a7e765bf3938aa21eedc2ec07b6c
|
| 3 |
-
size 2416761216
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-instruct-128k-Q6_K.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:24ff4b25dcb2e0799dc2eacfe09f97a7087edc36e804366ade18ad88c85a8afc
|
| 3 |
-
size 2862406016
|
|
|
|
|
|
|
|
|
|
|
|
granite-3b-code-instruct-128k-Q8_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:e937e8d8054ff5383ac8b410bbf29ee6bf76bde543848076a8aa9ee274868b8b
|
| 3 |
-
size 3705526656
|
|
|
|
|
|
|
|
|
|
|
|