Instructions to use ruslanmv/granite-3.1-8b-Reasoning-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ruslanmv/granite-3.1-8b-Reasoning-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ruslanmv/granite-3.1-8b-Reasoning-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ruslanmv/granite-3.1-8b-Reasoning-GGUF", device_map="auto") - llama-cpp-python
How to use ruslanmv/granite-3.1-8b-Reasoning-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ruslanmv/granite-3.1-8b-Reasoning-GGUF", filename="unsloth.Q4_K_M.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 ruslanmv/granite-3.1-8b-Reasoning-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 ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf ruslanmv/granite-3.1-8b-Reasoning-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 ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf ruslanmv/granite-3.1-8b-Reasoning-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 ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ruslanmv/granite-3.1-8b-Reasoning-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 ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M
Use Docker
docker model run hf.co/ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ruslanmv/granite-3.1-8b-Reasoning-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ruslanmv/granite-3.1-8b-Reasoning-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": "ruslanmv/granite-3.1-8b-Reasoning-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M
- SGLang
How to use ruslanmv/granite-3.1-8b-Reasoning-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 "ruslanmv/granite-3.1-8b-Reasoning-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": "ruslanmv/granite-3.1-8b-Reasoning-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 "ruslanmv/granite-3.1-8b-Reasoning-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": "ruslanmv/granite-3.1-8b-Reasoning-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use ruslanmv/granite-3.1-8b-Reasoning-GGUF with Ollama:
ollama run hf.co/ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M
- Unsloth Studio
How to use ruslanmv/granite-3.1-8b-Reasoning-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 ruslanmv/granite-3.1-8b-Reasoning-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 ruslanmv/granite-3.1-8b-Reasoning-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ruslanmv/granite-3.1-8b-Reasoning-GGUF to start chatting
- Pi
How to use ruslanmv/granite-3.1-8b-Reasoning-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use ruslanmv/granite-3.1-8b-Reasoning-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 ruslanmv/granite-3.1-8b-Reasoning-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 ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use ruslanmv/granite-3.1-8b-Reasoning-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ruslanmv/granite-3.1-8b-Reasoning-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 "ruslanmv/granite-3.1-8b-Reasoning-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"
- Docker Model Runner
How to use ruslanmv/granite-3.1-8b-Reasoning-GGUF with Docker Model Runner:
docker model run hf.co/ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M
- Lemonade
How to use ruslanmv/granite-3.1-8b-Reasoning-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ruslanmv/granite-3.1-8b-Reasoning-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.granite-3.1-8b-Reasoning-GGUF-Q4_K_M
List all available models
lemonade list
Granite-3.1-8B-Reasoning-GGUF (Quantized for Efficient Inference)
Model Overview
This is a GGUF quantized version of ruslanmv/granite-3.1-8b-Reasoning, fine-tuned from ibm-granite/granite-3.1-8b-instruct. The GGUF format enables efficient inference on CPUs and GPUs, optimized for various K-bit quantization levels (4-bit, 5-bit, and 8-bit).
- Developed by: ruslanmv
- License: Apache 2.0
- Base Model: ibm-granite/granite-3.1-8b-instruct
- Fine-tuned for: Logical reasoning, structured problem-solving, long-context tasks
- Quantized GGUF versions available:
- 4-bit:
Q4_K_M - 5-bit:
Q5_K_M - 8-bit:
Q8_0
- 4-bit:
- Supported Languages: English
- Architecture: Granite
- Model Size: 8.17B params
Why Use the GGUF Quantized Version?
The GGUF format is designed for optimized CPU and GPU inference, making it ideal for:
โ
Lower memory usage for efficient deployment
โ
Faster inference speeds on consumer hardware
โ
Compatibility with leading inference engines like llama.cpp, ctransformers, and KoboldCpp
โ
Improved performance on logical reasoning and analytical tasks
Installation & Usage
Install dependencies for llama.cpp:
pip install llama-cpp-python
Running the Model with llama.cpp:
from llama_cpp import Llama
model_path = "path/to/ruslanmv/granite-3.1-8b-Reasoning-GGUF.Q4_K_M.gguf"
llm = Llama(model_path=model_path)
input_text = "Can you explain the difference between inductive and deductive reasoning?"
output = llm(input_text, max_tokens=400)
print(output["choices"][0]["text"])
Alternatively, using ctransformers:
pip install ctransformers
from ctransformers import AutoModelForCausalLM
model_path = "path/to/ruslanmv/granite-3.1-8b-Reasoning-GGUF.Q4_K_M.gguf"
model = AutoModelForCausalLM.from_pretrained(model_path, model_type="llama", gpu_layers=50)
input_text = "What are the key principles of logical reasoning?"
output = model(input_text, max_new_tokens=400)
print(output)
Intended Use
Granite-3.1-8B-Reasoning-GGUF is designed for efficient inference while maintaining strong reasoning capabilities, making it ideal for:
- Logical and analytical problem-solving
- Text-based reasoning tasks
- Mathematical and symbolic reasoning
- Advanced instruction-following
This model is particularly beneficial for CPU-based deployments, low-memory environments, and users who need optimized text generation without requiring high-end GPUs.
License & Acknowledgments
This model is released under the Apache 2.0 license. It is fine-tuned from IBMโs Granite 3.1-8B-Instruct model and quantized using GGUF for optimal efficiency. Special thanks to the IBM Granite Team for developing the base model.
For more details, visit the IBM Granite Documentation.
Citation
If you use this model in your research or applications, please cite:
@misc{ruslanmv2025granite,
title={Fine-Tuning and GGUF Quantization of Granite-3.1-8B for Advanced Reasoning},
author={Ruslan M.V.},
year={2025},
url={https://huggingface.co/ruslanmv/granite-3.1-8b-Reasoning-GGUF}
}
- Downloads last month
- 88
4-bit
5-bit
8-bit
Model tree for ruslanmv/granite-3.1-8b-Reasoning-GGUF
Base model
ibm-granite/granite-3.1-8b-base