Text Generation
Transformers
GGUF
code
granite
TensorBlock
GGUF
Eval Results (legacy)
conversational
Instructions to use tensorblock/granite-8b-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-8b-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-8b-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-8b-code-instruct-128k-GGUF", dtype="auto") - llama-cpp-python
How to use tensorblock/granite-8b-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-8b-code-instruct-128k-GGUF", filename="granite-8b-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-8b-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-8b-code-instruct-128k-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf tensorblock/granite-8b-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-8b-code-instruct-128k-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf tensorblock/granite-8b-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-8b-code-instruct-128k-GGUF:Q2_K # Run inference directly in the terminal: ./llama-cli -hf tensorblock/granite-8b-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-8b-code-instruct-128k-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf tensorblock/granite-8b-code-instruct-128k-GGUF:Q2_K
Use Docker
docker model run hf.co/tensorblock/granite-8b-code-instruct-128k-GGUF:Q2_K
- LM Studio
- Jan
- vLLM
How to use tensorblock/granite-8b-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-8b-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-8b-code-instruct-128k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tensorblock/granite-8b-code-instruct-128k-GGUF:Q2_K
- SGLang
How to use tensorblock/granite-8b-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-8b-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-8b-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-8b-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-8b-code-instruct-128k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use tensorblock/granite-8b-code-instruct-128k-GGUF with Ollama:
ollama run hf.co/tensorblock/granite-8b-code-instruct-128k-GGUF:Q2_K
- Unsloth Studio
How to use tensorblock/granite-8b-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-8b-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-8b-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-8b-code-instruct-128k-GGUF to start chatting
- Docker Model Runner
How to use tensorblock/granite-8b-code-instruct-128k-GGUF with Docker Model Runner:
docker model run hf.co/tensorblock/granite-8b-code-instruct-128k-GGUF:Q2_K
- Lemonade
How to use tensorblock/granite-8b-code-instruct-128k-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tensorblock/granite-8b-code-instruct-128k-GGUF:Q2_K
Run and chat with the model
lemonade run user.granite-8b-code-instruct-128k-GGUF-Q2_K
List all available models
lemonade list
Keep Q2_K/Q3_K_M gguf only
Browse files- granite-8b-code-instruct-128k-Q3_K_L.gguf +0 -3
- granite-8b-code-instruct-128k-Q3_K_S.gguf +0 -3
- granite-8b-code-instruct-128k-Q4_0.gguf +0 -3
- granite-8b-code-instruct-128k-Q4_K_M.gguf +0 -3
- granite-8b-code-instruct-128k-Q4_K_S.gguf +0 -3
- granite-8b-code-instruct-128k-Q5_0.gguf +0 -3
- granite-8b-code-instruct-128k-Q5_K_M.gguf +0 -3
- granite-8b-code-instruct-128k-Q5_K_S.gguf +0 -3
- granite-8b-code-instruct-128k-Q6_K.gguf +0 -3
- granite-8b-code-instruct-128k-Q8_0.gguf +0 -3
granite-8b-code-instruct-128k-Q3_K_L.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:1382114244aa9dea149436cae98eeb91e707475dc364f61f519b22d7faa2f76b
|
| 3 |
-
size 4287725440
|
|
|
|
|
|
|
|
|
|
|
|
granite-8b-code-instruct-128k-Q3_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:f598a0fbf47c7c45a3aa05b113d77ad0f5b3a68642c6135c5e987ec9e5023427
|
| 3 |
-
size 3548086144
|
|
|
|
|
|
|
|
|
|
|
|
granite-8b-code-instruct-128k-Q4_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:f8d51547840cc28a6d8a5c261769bff2767d6c515de5d1c1e2ebfd64915057cb
|
| 3 |
-
size 4590894976
|
|
|
|
|
|
|
|
|
|
|
|
granite-8b-code-instruct-128k-Q4_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:04680b9c3770f0e76b3399613cb16054211d92d9d43ce395fc94919cfcf638b1
|
| 3 |
-
size 4882857856
|
|
|
|
|
|
|
|
|
|
|
|
granite-8b-code-instruct-128k-Q4_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:a759447e056556dbe0ff721194677b2d91db8289f015f54724964af56ed51cc4
|
| 3 |
-
size 4622352256
|
|
|
|
|
|
|
|
|
|
|
|
granite-8b-code-instruct-128k-Q5_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:e6cea2eec37b73a126536989b3d1f11e2c8c25af6bc6ea6ff3e971e646511748
|
| 3 |
-
size 5572362112
|
|
|
|
|
|
|
|
|
|
|
|
granite-8b-code-instruct-128k-Q5_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:37c4493d6f184275e654ebdd2ea5a0e8d93dcd2af5f149cd79270eb5d8c381d0
|
| 3 |
-
size 5722767232
|
|
|
|
|
|
|
|
|
|
|
|
granite-8b-code-instruct-128k-Q5_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:979e66fd59ebec2f8d86dc7c7a08ff636b9608b7169c469c925ca2358e3b0cda
|
| 3 |
-
size 5572362112
|
|
|
|
|
|
|
|
|
|
|
|
granite-8b-code-instruct-128k-Q6_K.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:109497efa8560c94aaf68fffb599918258e4b246ffba97020a91719f0c644897
|
| 3 |
-
size 6615170944
|
|
|
|
|
|
|
|
|
|
|
|
granite-8b-code-instruct-128k-Q8_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:4e301355a06a653fd7b27508abfe91abfce707c479bda0b7b21c345bafc0f370
|
| 3 |
-
size 8565522304
|
|
|
|
|
|
|
|
|
|
|
|