# ibm-granite/granite-code-models

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/ibm-granite-granite-code-models).**

1,250 stars · 82 forks · Apache-2.0

## Links

- GitHub: https://github.com/ibm-granite/granite-code-models
- Homepage: https://huggingface.co/collections/ibm-granite/granite-code-models-6624c5cec322e4c148c8b330
- awesome-repositories: https://awesome-repositories.com/repository/ibm-granite-granite-code-models.md

## Description

Granite Code Models is a family of transformer-based foundational models designed for software engineering and logical reasoning tasks. These models are trained on high-quality programming datasets to interpret natural language prompts and generate functional source code, explain complex logic, repair code defects, and produce technical documentation.

The project distinguishes itself through specialized training methodologies that align model behavior with complex programming instructions and mathematical problem-solving. By utilizing chain-of-thought reasoning and instruction-tuned parameter alignment, the models are capable of decomposing intricate tasks into logical, verifiable sequences. Furthermore, the platform incorporates schema-grounded techniques to improve the accuracy of natural language to database query generation while minimizing hallucinations.

The system supports a broad range of capabilities, including automated code generation, software maintenance, and function calling. It also provides comprehensive workflows for fine-tuning models on custom datasets, allowing for domain-specific adaptation and the adjustment of response characteristics such as complexity and verbosity.

To ensure computational efficiency, the architecture employs memory optimization techniques that remove non-informative padding tokens during both training and inference. The repository provides the necessary foundational models, training datasets, and scripts to facilitate the development and refinement of code-centric artificial intelligence.

## Tags

### Artificial Intelligence & ML

- [Code-Specific Language Models](https://awesome-repositories.com/f/artificial-intelligence-ml/code-specific-language-models.md) — Ships a family of foundational models trained on diverse programming datasets for code generation, explanation, and repair.
- [Natural Language to Code Generators](https://awesome-repositories.com/f/artificial-intelligence-ml/natural-language-to-code-generators.md) — Translates natural language prompts into functional source code using transformer-based foundational models.
- [Chain-of-Thought Prompting](https://awesome-repositories.com/f/artificial-intelligence-ml/chain-of-thought-prompting.md) — Utilizes chain-of-thought prompting to generate intermediate logical steps before producing final outputs.
- [Decoder Architectures](https://awesome-repositories.com/f/artificial-intelligence-ml/decoder-architectures.md) — Uses a transformer-based decoder architecture to predict subsequent tokens by attending to previous context.
- [Instruction Tuning](https://awesome-repositories.com/f/artificial-intelligence-ml/instruction-tuning.md) — Refines model weights using curated instruction-response datasets to improve adherence to specific user commands.
- [Instruction-Tuned Language Models](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/architectures/instruction-tuned-language-models.md) — Provides an instruction-tuned language model optimized for complex software development and logical reasoning tasks.
- [Natural Language Code Generators](https://awesome-repositories.com/f/artificial-intelligence-ml/natural-language-code-generators.md) — Automates the creation of functional source code snippets based on natural language prompts.
- [Code Explanation](https://awesome-repositories.com/f/artificial-intelligence-ml/code-explanation.md) — Analyzes code blocks to provide human-readable summaries that clarify underlying structure and logical flow. ([source](https://huggingface.co/collections/ibm-granite/granite-code-models-6624c5cec322e4c148c8b330))
- [Documentation Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/code-generation-assistants/documentation-generation.md) — Generates technical documentation and unit tests to assist with long-term maintenance and technical debt reduction. ([source](https://huggingface.co/ibm-granite/granite-3b-code-base-2k))
- [Large Language Model Fine-Tuning](https://awesome-repositories.com/f/artificial-intelligence-ml/large-language-model-fine-tuning.md) — Provides workflows for fine-tuning foundational models on custom datasets to improve domain-specific performance.
- [Mathematical Reasoning Training](https://awesome-repositories.com/f/artificial-intelligence-ml/large-scale-training/mathematical-reasoning-training.md) — Trains models to construct logical reasoning paths for complex calculations using chain-of-thought methodologies.
- [Function Calling Fine-Tuning](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-training-and-tuning/fine-tuning-and-customization/model-fine-tuning/function-calling-fine-tuning.md) — Trains models to identify, format, and invoke external tools through structured conversational examples. ([source](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2))
- [Multi-Stage Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-training-and-tuning/fine-tuning-and-customization/model-fine-tuning/quantized-fine-tuning/domain-adaptation/multi-stage-pipelines.md) — Employs a sequential training strategy that adapts foundational models from general code patterns to specialized domain tasks.
- [Human Preference Alignment](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-training-and-tuning/fine-tuning-and-customization/model-fine-tuning/quantized-fine-tuning/human-preference-alignment.md) — Uses human-annotated attribute scores to align model outputs for improved helpfulness and accuracy. ([source](https://huggingface.co/datasets/nvidia/HelpSteer))
- [Reasoning Dataset Curation](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-training-and-tuning/training-frameworks/large-language-model-training-frameworks/reasoning-training-frameworks/reasoning-dataset-curation.md) — Curates diverse datasets to improve the logical reasoning and problem-solving capabilities of language models. ([source](https://huggingface.co/datasets/garage-bAInd/Open-Platypus))
- [Machine Learning Datasets](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/machine-learning-datasets.md) — Provides high-quality programming datasets and synthetic instruction sets for fine-tuning code-centric language models.
- [Padding-Free Optimizers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-training-frameworks/vision-model-training/hybrid-transformer-training/hybrid-sequence-model-training/user-behavior-sequence-training/variable-length-sequence-training/padding-free-samplers/padding-free-optimizers.md) — Optimizes memory usage by removing non-informative padding tokens during training and inference.
- [Natural Language Task Execution](https://awesome-repositories.com/f/artificial-intelligence-ml/natural-language-task-execution.md) — Executes coding tasks by leveraging models trained on instruction-paired datasets and version control data. ([source](https://github.com/ibm-granite/granite-code-models/blob/main/README.md))
- [Schema Grounding Retrievers](https://awesome-repositories.com/f/artificial-intelligence-ml/rag-context-retrieval/schema-grounding-retrievers.md) — Incorporates schema-grounded techniques to provide database definitions as context for accurate natural language to code translation.
- [Mathematical Reasoning Steps](https://awesome-repositories.com/f/artificial-intelligence-ml/reasoning-models/reasoning-pipelines/reasoning-model-integrations/reasoning-step-outputs/mathematical-reasoning-steps.md) — Provides logical, step-by-step reasoning paths for complex mathematical calculations. ([source](https://huggingface.co/datasets/meta-math/MetaMathQA))
- [Text-to-SQL Translators](https://awesome-repositories.com/f/artificial-intelligence-ml/text-to-sql-translators.md) — Provides schema definitions as context for natural language queries to improve accuracy and minimize hallucinations. ([source](https://huggingface.co/datasets/bugdaryan/sql-create-context-instruction))

### Part of an Awesome List

- [Code Generation Training](https://awesome-repositories.com/f/awesome-lists/ai/model-training-and-fine-tuning/code-generation-training.md) — Provides large-scale programming problem datasets to facilitate the training of models for software development. ([source](https://huggingface.co/datasets/glaiveai/glaive-code-assistant-v3))
- [Model Fine-Tuning](https://awesome-repositories.com/f/awesome-lists/ai/model-training-and-fine-tuning/model-fine-tuning.md) — Adapts base models to specific coding domains using specialized engine configurations. ([source](https://github.com/ibm-granite/granite-code-models#readme))
- [Mathematical Reasoning Tuning](https://awesome-repositories.com/f/awesome-lists/ai/model-training-and-fine-tuning/model-fine-tuning/mathematical-reasoning-tuning.md) — Trains models on hybrid chain-of-thought and program-of-thought datasets to improve mathematical reasoning. ([source](https://huggingface.co/datasets/TIGER-Lab/MathInstruct))

### Programming Languages & Runtimes

- [Natural Language Code Generators](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-generators/specification-from-code-generators/natural-language-code-generators.md) — Produces functional code snippets by interpreting natural language prompts and completing partial code contexts. ([source](https://huggingface.co/collections/ibm-granite/granite-code-models-6624c5cec322e4c148c8b330))

### Data & Databases

- [Natural Language to SQL](https://awesome-repositories.com/f/data-databases/data-visualization-charts/natural-language-querying/natural-language-to-sql.md) — Converts natural language requests into valid database queries using schema definitions to ensure accuracy.
- [Padding-Free Sequence Processing](https://awesome-repositories.com/f/data-databases/memory-optimization-strategies/training-memory-optimizers/padding-free-sequence-processing.md) — Reduces activation memory consumption by removing non-informative padding tokens during training and inference. ([source](https://huggingface.co/blog/mayank-mishra/padding-free-transformer))

### Development Tools & Productivity

- [Cross-Platform Code Suggestions](https://awesome-repositories.com/f/development-tools-productivity/automated-code-fix-suggestions/cross-platform-code-suggestions.md) — Identifies errors and performance inefficiencies in code to suggest corrected versions for improved stability. ([source](https://huggingface.co/collections/ibm-granite/granite-code-models-6624c5cec322e4c148c8b330))

### Operating Systems & Systems Programming

- [Programming Instruction Execution](https://awesome-repositories.com/f/operating-systems-systems-programming/computer-architecture/instruction-execution-models/neural-network-instruction-execution/programming-instruction-execution.md) — Executes complex programming tasks by interpreting natural language prompts through instruction-tuned models. ([source](https://github.com/ibm-granite/granite-code-models#readme))

### Testing & Quality Assurance

- [Debugging and Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/diagnostic-toolchains/debugging-and-testing.md) — Analyzes codebases to explain logic, identify defects, and generate documentation for software maintenance.
