Instructions to use Prithwiraj731/Granite-3.1-2b-TwoWheeler with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Prithwiraj731/Granite-3.1-2b-TwoWheeler with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Prithwiraj731/Granite-3.1-2b-TwoWheeler", filename="granite-3.1-2b-instruct.F16.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 Prithwiraj731/Granite-3.1-2b-TwoWheeler with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16 # Run inference directly in the terminal: llama-cli -hf Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16 # Run inference directly in the terminal: llama-cli -hf Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
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 Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16 # Run inference directly in the terminal: ./llama-cli -hf Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
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 Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
Use Docker
docker model run hf.co/Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
- LM Studio
- Jan
- vLLM
How to use Prithwiraj731/Granite-3.1-2b-TwoWheeler with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Prithwiraj731/Granite-3.1-2b-TwoWheeler" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Prithwiraj731/Granite-3.1-2b-TwoWheeler", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
- Ollama
How to use Prithwiraj731/Granite-3.1-2b-TwoWheeler with Ollama:
ollama run hf.co/Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
- Unsloth Studio new
How to use Prithwiraj731/Granite-3.1-2b-TwoWheeler 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 Prithwiraj731/Granite-3.1-2b-TwoWheeler 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 Prithwiraj731/Granite-3.1-2b-TwoWheeler to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Prithwiraj731/Granite-3.1-2b-TwoWheeler to start chatting
- Pi new
How to use Prithwiraj731/Granite-3.1-2b-TwoWheeler with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
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": "Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Prithwiraj731/Granite-3.1-2b-TwoWheeler with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
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 Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
Run Hermes
hermes
- Docker Model Runner
How to use Prithwiraj731/Granite-3.1-2b-TwoWheeler with Docker Model Runner:
docker model run hf.co/Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
- Lemonade
How to use Prithwiraj731/Granite-3.1-2b-TwoWheeler with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Prithwiraj731/Granite-3.1-2b-TwoWheeler:F16
Run and chat with the model
lemonade run user.Granite-3.1-2b-TwoWheeler-F16
List all available models
lemonade list
🏍️ Granite-3.1-2b-TwoWheeler
This model is a fine-tuned version of IBM Granite 3.1 2B Instruct, specialized in Two-Wheeler knowledge (Motorcycles, Scooters, Superbikes, and Maintenance).
It was trained using Unsloth on a custom dataset to provide expert advice on bike specifications, comparisons, comparisons, and troubleshooting.
📂 Included Files
This repository contains the full merged model and quantized versions:
| Filename | Type | Description |
|---|---|---|
model.safetensors |
Full Model | The unquantized, merged weights. Use this for Python/Transformers training or inference. |
granite-3.1-2b-instruct.Q4_K_M.gguf |
GGUF (Q4) | Recommended. 4-bit quantized. Fast & efficient (runs on 4GB+ RAM). |
granite-3.1-2b-instruct.F16.gguf |
GGUF (FP16) | High-precision uncompressed GGUF. Best quality but larger file size. |
💻 How to Use (GGUF / Llama.cpp / LM Studio)
You can use the .gguf files directly in LM Studio, Ollama, or llama.cpp.
CLI Command (llama.cpp):
./llama-cli -m granite-3.1-2b-instruct.Q4_K_M.gguf -p "User: Which bike is best for daily city commute with high mileage in India?\nAssistant:" -cnv
System Prompt (Recommended):
You are an expert automotive assistant specializing in two-wheelers. Provide detailed specifications, comparisons, and maintenance advice for bikes and scooters.
🐍 How to Use (Python / Transformers)
Since the model is merged, you can load it directly without needing LoRA adapters.
Python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "Prithwiraj731/Granite-3.1-2b-TwoWheeler"
# Load Tokenizer & Model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
device_map="auto",
torch_dtype=torch.float16 # Use bfloat16 if your GPU supports it
)
# Format the Prompt (Granite Chat Format)
messages = [
{"role": "user", "content": "Compare the Royal Enfield Classic 350 vs Honda CB350. Which one has better vibrations?"}
]
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Generate
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
🔧 Training Details
Base Architecture: IBM Granite 3.1 (2 Billion Parameters)
Framework: Unsloth (PyTorch)
Quantization: Q4_K_M & FP16 GGUF
Fine-tuning Method: Full LoRA Merge (16-bit)
Dataset Focus: Technical specifications, riding comfort, mileage, and maintenance of two-wheelers.
Finetuned with ❤️ using Unsloth.
- Downloads last month
- 16