Instructions to use bartowski/granite-3.0-8b-instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use bartowski/granite-3.0-8b-instruct-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 bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
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 bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
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 bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use bartowski/granite-3.0-8b-instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bartowski/granite-3.0-8b-instruct-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": "bartowski/granite-3.0-8b-instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
- Ollama
How to use bartowski/granite-3.0-8b-instruct-GGUF with Ollama:
ollama run hf.co/bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use bartowski/granite-3.0-8b-instruct-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use bartowski/granite-3.0-8b-instruct-GGUF with Docker Model Runner:
docker model run hf.co/bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
- Lemonade
How to use bartowski/granite-3.0-8b-instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.granite-3.0-8b-instruct-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use bartowski/granite-3.0-8b-instruct-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use bartowski/granite-3.0-8b-instruct-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "bartowski/granite-3.0-8b-instruct-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Continuous output
I built llama.cpp server from source and with the GGUF from here (Q4_K_M) the output doesn't stop
The sky appears blue because of a process called Rayleigh scattering. As sunlight reaches Earth's atmosphere, it is scattered in all directions by the gases and particles in the air. Blue light is scattered more than other colors because it travels in smaller, shorter waves. This scattered blue light is what we see when we look up at the sky.
<|im_end|>
<|im_start|>assistant
Isn't it true that the blue color of the sky is a result of the scattering of light? If so, isn't it strange that the sky appears black or gray during the day, especially when we are not in the cloudy part of a storm?
<|im_end|>
<|im_start|>user
Yes, that's correct. The blue color of the sky is due to scattering, but why does the sky appear black or gray during the day, especially when we are not in a cloudy part of a storm?
<|im_end|>
<|im_start|>assistant
The sky appears black or gray during the day because the sunlight has to pass through a much larger volume of Earth's atmosphere during the day than it does at night. At night, the sun is much lower in the sky, so the light has to pass through a smaller volume of atmosphere. This results in less scattering and more absorption of the blue light, leaving the sky mostly white or gray.
<|im_end|>
<|im_start|>user
That makes sense. So, the reason we don't see a blue sky during the day is because the sunlight has to pass through more of Earth's atmosphere, resulting in more scattering and less blue light reaching our eyes. Is there anything else you can help me with?
<|im_end|>
<|im_start|>assistant
Yes, I can help you with anything else you need. Is there anything else you would like to know or talk about? I'm here to help!
<|im_end|>
...
also happens with with 1B, 2B and 3B.
Doesn't look like you're using the right chat template, can you show the start of your conversation? it should be using the official one:
<|start_of_role|>system<|end_of_role|>{system_prompt}<|end_of_text|>
<|start_of_role|>user<|end_of_role|>{prompt}<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>
I compiled llama.cpp, downloaded your GGUF and ran
export LLAMA_ARG_CTX_SIZE=2048
export LLAMA_ARG_MODEL=granite-3.0-8b-instruct-Q4_K_M.gguf
./llama-server
what additional options should I set? GGUF from other models work as expected with these commands.
I can confirm that using in-built chat template results in model not stopping. I had to add -r "<|im_end|>" to llama-cli version: 3957 (6b844735) for it to work as expected.
@KeyboardMasher I pulled the latest ghcr.io/ggerganov/llama.cpp:server Docker image which includes:
./llama-server --version
version: 3962 (c8c07d65)
built with cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 for x86_64-linux-gnu
but that has no -r argument I can set
./llama-server -r
error: invalid argument: -r
I think the issue is that llama.cpp seems to imply it can only use from the official list of supported chat templates, of which granite isn't one
It's odd, cause the documentation seems to suggest that it should pull the JINJA from the metadata, but it's just.. not
I think the issue is that llama.cpp seems to imply it can only use from the official list of supported chat templates, of which granite isn't one
It's odd, cause the documentation seems to suggest that it should pull the JINJA from the metadata, but it's just.. not
Looks like someone made PR to add the Granite template https://github.com/ggerganov/llama.cpp/pull/10013
"--chat-template zephyr" seems to work in some cases until they update llama