Text Generation
Transformers
GGUF
code
granite
TensorBlock
GGUF
Eval Results (legacy)
conversational
Instructions to use tensorblock/granite-34b-code-instruct-8k-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tensorblock/granite-34b-code-instruct-8k-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tensorblock/granite-34b-code-instruct-8k-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tensorblock/granite-34b-code-instruct-8k-GGUF", dtype="auto") - llama-cpp-python
How to use tensorblock/granite-34b-code-instruct-8k-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="tensorblock/granite-34b-code-instruct-8k-GGUF", filename="granite-34b-code-instruct-8k-Q2_K.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use tensorblock/granite-34b-code-instruct-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-34b-code-instruct-8k-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf tensorblock/granite-34b-code-instruct-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-34b-code-instruct-8k-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf tensorblock/granite-34b-code-instruct-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-34b-code-instruct-8k-GGUF:Q2_K # Run inference directly in the terminal: ./llama-cli -hf tensorblock/granite-34b-code-instruct-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-34b-code-instruct-8k-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf tensorblock/granite-34b-code-instruct-8k-GGUF:Q2_K
Use Docker
docker model run hf.co/tensorblock/granite-34b-code-instruct-8k-GGUF:Q2_K
- LM Studio
- Jan
- vLLM
How to use tensorblock/granite-34b-code-instruct-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-34b-code-instruct-8k-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-34b-code-instruct-8k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tensorblock/granite-34b-code-instruct-8k-GGUF:Q2_K
- SGLang
How to use tensorblock/granite-34b-code-instruct-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-34b-code-instruct-8k-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-34b-code-instruct-8k-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-34b-code-instruct-8k-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-34b-code-instruct-8k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use tensorblock/granite-34b-code-instruct-8k-GGUF with Ollama:
ollama run hf.co/tensorblock/granite-34b-code-instruct-8k-GGUF:Q2_K
- Unsloth Studio new
How to use tensorblock/granite-34b-code-instruct-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-34b-code-instruct-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-34b-code-instruct-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-34b-code-instruct-8k-GGUF to start chatting
- Docker Model Runner
How to use tensorblock/granite-34b-code-instruct-8k-GGUF with Docker Model Runner:
docker model run hf.co/tensorblock/granite-34b-code-instruct-8k-GGUF:Q2_K
- Lemonade
How to use tensorblock/granite-34b-code-instruct-8k-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tensorblock/granite-34b-code-instruct-8k-GGUF:Q2_K
Run and chat with the model
lemonade run user.granite-34b-code-instruct-8k-GGUF-Q2_K
List all available models
lemonade list
Update README.md
Browse files
README.md
CHANGED
|
@@ -103,12 +103,47 @@ This repo contains GGUF format model files for [ibm-granite/granite-34b-code-ins
|
|
| 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 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
</
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
## Prompt template
|
| 113 |
|
| 114 |
|
|
|
|
| 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 |
+
## Our projects
|
| 107 |
+
<table border="1" cellspacing="0" cellpadding="10">
|
| 108 |
+
<tr>
|
| 109 |
+
<th style="font-size: 25px;">Awesome MCP Servers</th>
|
| 110 |
+
<th style="font-size: 25px;">TensorBlock Studio</th>
|
| 111 |
+
</tr>
|
| 112 |
+
<tr>
|
| 113 |
+
<th><img src="https://imgur.com/2Xov7B7.jpeg" alt="Project A" width="450"/></th>
|
| 114 |
+
<th><img src="https://imgur.com/pJcmF5u.jpeg" alt="Project B" width="450"/></th>
|
| 115 |
+
</tr>
|
| 116 |
+
<tr>
|
| 117 |
+
<th>A comprehensive collection of Model Context Protocol (MCP) servers.</th>
|
| 118 |
+
<th>A lightweight, open, and extensible multi-LLM interaction studio.</th>
|
| 119 |
+
</tr>
|
| 120 |
+
<tr>
|
| 121 |
+
<th>
|
| 122 |
+
<a href="https://github.com/TensorBlock/awesome-mcp-servers" target="_blank" style="
|
| 123 |
+
display: inline-block;
|
| 124 |
+
padding: 8px 16px;
|
| 125 |
+
background-color: #FF7F50;
|
| 126 |
+
color: white;
|
| 127 |
+
text-decoration: none;
|
| 128 |
+
border-radius: 6px;
|
| 129 |
+
font-weight: bold;
|
| 130 |
+
font-family: sans-serif;
|
| 131 |
+
">๐ See what we built ๐</a>
|
| 132 |
+
</th>
|
| 133 |
+
<th>
|
| 134 |
+
<a href="https://github.com/TensorBlock/TensorBlock-Studio" target="_blank" style="
|
| 135 |
+
display: inline-block;
|
| 136 |
+
padding: 8px 16px;
|
| 137 |
+
background-color: #FF7F50;
|
| 138 |
+
color: white;
|
| 139 |
+
text-decoration: none;
|
| 140 |
+
border-radius: 6px;
|
| 141 |
+
font-weight: bold;
|
| 142 |
+
font-family: sans-serif;
|
| 143 |
+
">๐ See what we built ๐</a>
|
| 144 |
+
</th>
|
| 145 |
+
</tr>
|
| 146 |
+
</table>
|
| 147 |
## Prompt template
|
| 148 |
|
| 149 |
|