ModelHub XC 864760c431 初始化项目,由ModelHub XC社区提供模型
Model: Mungert/granite-3b-code-instruct-128k-GGUF
Source: Original Platform
2026-09-22 10:42:13 +08:00

pipeline_tag, inference, license, datasets, metrics, library_name, tags, model-index
pipeline_tag inference license datasets metrics library_name tags model-index
text-generation false apache-2.0
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
bigcode/self-oss-instruct-sc2-exec-filter-50k
code_eval
transformers
code
granite
name results
granite-3b-code-instruct-128k
task dataset metrics
type
text-generation
type name
bigcode/humanevalpack HumanEvalSynthesis (Python)
name type value verified
pass@1 pass@1 53.7 false
task dataset metrics
type
text-generation
type name
bigcode/humanevalpack HumanEvalSynthesis (Average)
name type value verified
pass@1 pass@1 41.4 false
task dataset metrics
type
text-generation
type name
bigcode/humanevalpack HumanEvalExplain (Average)
name type value verified
pass@1 pass@1 25.1 false
task dataset metrics
type
text-generation
type name
bigcode/humanevalpack HumanEvalFix (Average)
name type value verified
pass@1 pass@1 26.2 false
task dataset metrics
type
text-generation
type name
repoqa RepoQA (Python@16K)
name type value verified
pass@1 (thresh=0.5) pass@1 (thresh=0.5) 48.0 false
task dataset metrics
type
text-generation
type name
repoqa RepoQA (C++@16K)
name type value verified
pass@1 (thresh=0.5) pass@1 (thresh=0.5) 36.0 false
task dataset metrics
type
text-generation
type name
repoqa RepoQA (Java@16K)
name type value verified
pass@1 (thresh=0.5) pass@1 (thresh=0.5) 38.0 false
task dataset metrics
type
text-generation
type name
repoqa RepoQA (TypeScript@16K)
name type value verified
pass@1 (thresh=0.5) pass@1 (thresh=0.5) 39.0 false
task dataset metrics
type
text-generation
type name
repoqa RepoQA (Rust@16K)
name type value verified
pass@1 (thresh=0.5) pass@1 (thresh=0.5) 29.0 false

granite-3b-code-instruct-128k GGUF Models

Model Generation Details

This model was generated using llama.cpp at commit 0a5a3b5c.


Quantization Beyond the IMatrix

I've been experimenting with a new quantization approach that selectively elevates the precision of key layers beyond what the default IMatrix configuration provides.

In my testing, standard IMatrix quantization underperforms at lower bit depths, especially with Mixture of Experts (MoE) models. To address this, I'm using the --tensor-type option in llama.cpp to manually "bump" important layers to higher precision. You can see the implementation here:
👉 Layer bumping with llama.cpp

While this does increase model file size, it significantly improves precision for a given quantization level.

I'd love your feedback—have you tried this? How does it perform for you?


Click here to get info on choosing the right GGUF model format

image/png

Granite-3B-Code-Instruct-128K

Model Summary

Granite-3B-Code-Instruct-128K is a 3B parameter long-context instruct model fine tuned from Granite-3B-Code-Base-128K on a combination of permissively licensed data used in training the original Granite code instruct models, in addition to synthetically generated code instruction datasets tailored for solving long context problems. By exposing the model to both short and long context data, we aim to enhance its long-context capability without sacrificing code generation performance at short input context.

Usage

Intended use

The model is designed to respond to coding related instructions over long-conext input up to 128K length and can be used to build coding assistants.

Generation

This is a simple example of how to use Granite-3B-Code-Instruct model.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # or "cpu"
model_path = "ibm-granite/granite-3b-code-instruct-128k"
tokenizer = AutoTokenizer.from_pretrained(model_path)
# drop device_map if running on CPU
model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
model.eval()
# change input text as desired
chat = [
    { "role": "user", "content": "Write a code to find the maximum value in a list of numbers." },
]
chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
# tokenize the text
input_tokens = tokenizer(chat, return_tensors="pt")
# transfer tokenized inputs to the device
for i in input_tokens:
    input_tokens[i] = input_tokens[i].to(device)
# generate output tokens
output = model.generate(**input_tokens, max_new_tokens=100)
# decode output tokens into text
output = tokenizer.batch_decode(output)
# loop over the batch to print, in this example the batch size is 1
for i in output:
    print(i)

Training Data

Granite Code Instruct models are trained on a mix of short and long context data as follows.

Infrastructure

We train the Granite Code models using two of IBM's super computing clusters, namely Vela and Blue Vela, both outfitted with NVIDIA A100 and H100 GPUs respectively. These clusters provide a scalable and efficient infrastructure for training our models over thousands of GPUs.

Ethical Considerations and Limitations

Granite code instruct models are primarily finetuned using instruction-response pairs across a specific set of programming languages. Thus, their performance may be limited with out-of-domain programming languages. In this situation, it is beneficial providing few-shot examples to steer the model's output. Moreover, developers should perform safety testing and target-specific tuning before deploying these models on critical applications. The model also inherits ethical considerations and limitations from its base model. For more information, please refer to Granite-3B-Code-Base-128K model card.


🚀 If you find these models useful

Help me test my AI-Powered Quantum Network Monitor Assistant with quantum-ready security checks:

👉 Quantum Network Monitor

The full Open Source Code for the Quantum Network Monitor Service available at my github repos ( repos with NetworkMonitor in the name) : Source Code Quantum Network Monitor. You will also find the code I use to quantize the models if you want to do it yourself GGUFModelBuilder

💬 How to test:
Choose an AI assistant type:

  • TurboLLM (GPT-4.1-mini)
  • HugLLM (Hugginface Open-source models)
  • TestLLM (Experimental CPU-only)

What I’m Testing

I’m pushing the limits of small open-source models for AI network monitoring, specifically:

  • Function calling against live network services
  • How small can a model go while still handling:
    • Automated Nmap security scans
    • Quantum-readiness checks
    • Network Monitoring tasks

🟡 TestLLM – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):

  • ✅ Zero-configuration setup
  • ⏳ 30s load time (slow inference but no API costs) . No token limited as the cost is low.
  • 🔧 Help wanted! If you’re into edge-device AI, let’s collaborate!

Other Assistants

🟢 TurboLLM – Uses gpt-4.1-mini :

  • **It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
  • Create custom cmd processors to run .net code on Quantum Network Monitor Agents
  • Real-time network diagnostics and monitoring
  • Security Audits
  • Penetration testing (Nmap/Metasploit)

🔵 HugLLM – Latest Open-source models:

  • 🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.

💡 Example commands you could test:

  1. "Give me info on my websites SSL certificate"
  2. "Check if my server is using quantum safe encyption for communication"
  3. "Run a comprehensive security audit on my server"
  4. '"Create a cmd processor to .. (what ever you want)" Note you need to install a Quantum Network Monitor Agent to run the .net code on. This is a very flexible and powerful feature. Use with caution!

Final Word

I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAI—all out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is open source. Feel free to use whatever you find helpful.

If you appreciate the work, please consider buying me a coffee ☕. Your support helps cover service costs and allows me to raise token limits for everyone.

I'm also open to job opportunities or sponsorship.

Thank you! 😊

Description
Model synced from source: Mungert/granite-3b-code-instruct-128k-GGUF
Readme 33 KiB