Instructions to use NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use NikolayKozloff/granite-8b-code-instruct-Q6_K-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 NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_K # Run inference directly in the terminal: llama cli -hf NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_K # Run inference directly in the terminal: llama cli -hf NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_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 NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_K # Run inference directly in the terminal: ./llama-cli -hf NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_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 NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_K
Use Docker
docker model run hf.co/NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_K
- LM Studio
- Jan
- vLLM
How to use NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NikolayKozloff/granite-8b-code-instruct-Q6_K-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": "NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_K
- SGLang
How to use NikolayKozloff/granite-8b-code-instruct-Q6_K-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 "NikolayKozloff/granite-8b-code-instruct-Q6_K-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": "NikolayKozloff/granite-8b-code-instruct-Q6_K-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 "NikolayKozloff/granite-8b-code-instruct-Q6_K-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": "NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF with Ollama:
ollama run hf.co/NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_K
- Unsloth Desktop
- Docker Model Runner
How to use NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF with Docker Model Runner:
docker model run hf.co/NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_K
- Lemonade
How to use NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF:Q6_K
Run and chat with the model
lemonade run user.granite-8b-code-instruct-Q6_K-GGUF-Q6_K
List all available models
lemonade list
- Atomic Chat
license: apache-2.0
library_name: transformers
tags:
- code
- llama-cpp
- gguf-my-repo
base_model: ibm-granite/granite-8b-code-base
datasets:
- bigcode/commitpackft
- TIGER-Lab/MathInstruct
- meta-math/MetaMathQA
- glaiveai/glaive-code-assistant-v3
- glaive-function-calling-v2
- bugdaryan/sql-create-context-instruction
- garage-bAInd/Open-Platypus
- nvidia/HelpSteer
metrics:
- code_eval
pipeline_tag: text-generation
inference: false
model-index:
- name: granite-8b-code-instruct
results:
- task:
type: text-generation
dataset:
name: HumanEvalSynthesis(Python)
type: bigcode/humanevalpack
metrics:
- type: pass@1
value: 57.9
name: pass@1
- type: pass@1
value: 52.4
name: pass@1
- type: pass@1
value: 58.5
name: pass@1
- type: pass@1
value: 43.3
name: pass@1
- type: pass@1
value: 48.2
name: pass@1
- type: pass@1
value: 37.2
name: pass@1
- type: pass@1
value: 53
name: pass@1
- type: pass@1
value: 42.7
name: pass@1
- type: pass@1
value: 52.4
name: pass@1
- type: pass@1
value: 36.6
name: pass@1
- type: pass@1
value: 43.9
name: pass@1
- type: pass@1
value: 16.5
name: pass@1
- type: pass@1
value: 39.6
name: pass@1
- type: pass@1
value: 40.9
name: pass@1
- type: pass@1
value: 48.2
name: pass@1
- type: pass@1
value: 41.5
name: pass@1
- type: pass@1
value: 39
name: pass@1
- type: pass@1
value: 32.9
name: pass@1
NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF
This model was converted to GGUF format from ibm-granite/granite-8b-code-instruct using llama.cpp via the ggml.ai's GGUF-my-repo space.
Refer to the original model card for more details on the model.
Use with llama.cpp
Install llama.cpp through brew.
brew install ggerganov/ggerganov/llama.cpp
Invoke the llama.cpp server or the CLI.
CLI:
llama-cli --hf-repo NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF --model granite-8b-code-instruct.Q6_K.gguf -p "The meaning to life and the universe is"
Server:
llama-server --hf-repo NikolayKozloff/granite-8b-code-instruct-Q6_K-GGUF --model granite-8b-code-instruct.Q6_K.gguf -c 2048
Note: You can also use this checkpoint directly through the usage steps listed in the Llama.cpp repo as well.
git clone https://github.com/ggerganov/llama.cpp && cd llama.cpp && make && ./main -m granite-8b-code-instruct.Q6_K.gguf -n 128