Code LLM for code generation, explanation, fixing, and translation
Top 32.9% on sourcepulse
The Granite Code Models are a family of open foundation models designed for a wide range of code intelligence tasks, including generation, explanation, and bug fixing. Targeting developers and researchers, these models offer state-of-the-art performance on diverse coding benchmarks while adhering to IBM's AI Ethics principles for enterprise-grade trustworthiness.
How It Works
Granite models are decoder-only LLMs trained on 3-4 trillion tokens of code data across 116 programming languages, supplemented with natural language and mathematical reasoning datasets. Training occurs in two phases: initial code-only pretraining, followed by a mix of code and general language data. Instruction-tuned variants are further fine-tuned on curated datasets including code commits, math problems, and various code-specific instruction sets. The models utilize Byte Pair Encoding (BPE) with the StarCoder tokenizer.
Quick Start & Requirements
transformers
library. Example: from transformers import AutoModelForCausalLM, AutoTokenizer; model = AutoModelForCausalLM.from_pretrained("ibm-granite/granite-3b-code-base-2k", device_map="cuda"); tokenizer = AutoTokenizer.from_pretrained("ibm-granite/granite-3b-code-base-2k")
transformers
, PyTorch. GPU recommended for inference.dolomite-engine
(clone repo, modify configs, run scripts/finetune.sh
).ibm-granite/granite-3b-code-base-2k
).Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
dolomite-engine
) which may have its own dependencies and setup complexity.1 month ago
1 day