Instructions to use SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF", filename="granite-3.1-8b-instruct-Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf SandLogicTechnologies/Granite-3.1-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-server -hf SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf SandLogicTechnologies/Granite-3.1-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 SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf SandLogicTechnologies/Granite-3.1-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 SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF with Ollama:
ollama run hf.co/SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF:Q4_K_M
- Unsloth Studio
How to use SandLogicTechnologies/Granite-3.1-8b-instruct-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 SandLogicTechnologies/Granite-3.1-8b-instruct-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 SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF to start chatting
- Pi
How to use SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf SandLogicTechnologies/Granite-3.1-8b-instruct-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": "SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use SandLogicTechnologies/Granite-3.1-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-server -hf SandLogicTechnologies/Granite-3.1-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 SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF with Docker Model Runner:
docker model run hf.co/SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF:Q4_K_M
- Lemonade
How to use SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Granite-3.1-8b-instruct-GGUF-Q4_K_M
List all available models
lemonade list
SandLogic Technology Quantized Granite-3.1-8B-Instruct-GGUF
This repository contains Q4_KM and Q5_KM quantized versions of the ibm-granite/granite-3.1-8b-instruct model. These quantized variants maintain the core capabilities of the original model while significantly reducing the memory footprint and increasing inference speed.
Discover our full range of quantized language models by visiting our SandLogic Lexicon GitHub. To learn more about our company and services, check out our website at SandLogic.
Model Details
- Original Model: Granite-3.1-8B-Instruct
- Quantized Versions:
- Q4_KM (4-bit quantization)
- Q5_KM (5-bit quantization)
- Base Architecture: 8B parameter long-context instruct model
- Developer: Granite Team, IBM
- License: Apache 2.0
- Release Date: December 18th, 2024
Quantization Benefits
Q4_KM Version
- Reduced model size: ~4GB (75% smaller than original)
- Faster inference speed
- Minimal quality degradation
- Optimal for resource-constrained environments
Q5_KM Version
- Reduced model size: ~5GB (69% smaller than original)
- Better quality preservation compared to Q4
- Balanced trade-off between model size and performance
- Recommended for quality-sensitive applications
Supported Languages
The quantized models maintain support for all original languages:
- English
- German
- Spanish
- French
- Japanese
- Portuguese
- Arabic
- Czech
- Italian
- Korean
- Dutch
- Chinese
Users can fine-tune these quantized models for additional languages.
Capabilities
Both quantized versions preserve the original model's capabilities:
- Summarization
- Text classification
- Text extraction
- Question-answering
- Retrieval Augmented Generation (RAG)
- Code related tasks
- Function-calling tasks
- Multilingual dialog use cases
- Long-context tasks including document/meeting summarization and QA
Usage
from llama_cpp import Llama
llm = Llama(
model_path="models/granite-3.1-8b-instruct-Q4_K_M.gguf",
verbose=False,
# n_gpu_layers=-1, # Uncomment to use GPU acceleration
# n_ctx=2048, # Uncomment to increase the context window
)
output = llm.create_chat_completion(
messages =[
{
"role": "system",
"content": "You are an AI Assistant"
,
},
{"role": "user", "content": "Please list one IBM Research laboratory located in the United States. You should only output its name and location."},
]
)
print(output["choices"][0]['message']['content'])
Intended Use
These quantized models are designed for:
- Resource-constrained environments
- Edge deployment scenarios
- Applications requiring faster inference
- Building AI assistants for multiple domains
- Business applications with limited computational resources
Training Information
The base model was trained on:
- Publicly available datasets with permissive license
- Internal synthetic data targeting specific capabilities
- Small amounts of human-curated data
Detailed attribution can be found in the upcoming Granite 3.1 Technical Report.
Acknowledgements
We thank Meta for developing the original IBM Granite model and the creators of the bigbio/med_qa dataset. Special thanks to Georgi Gerganov and the entire llama.cpp development team for their outstanding contributions.
Contact
For any inquiries or support, please contact us at support@sandlogic.com or visit our support page.
Explore More
For any inquiries or support, please contact us at support@sandlogic.com or visit our support page.
- Downloads last month
- 4
4-bit
5-bit
Model tree for SandLogicTechnologies/Granite-3.1-8b-instruct-GGUF
Base model
ibm-granite/granite-3.1-8b-base