Granite Code

Granite-8B-Code-Instruct

by IBM watsonx · Deprecated; still publicly available for historical and scientific use

IBM Granite-8B-Code-Instruct is an 8-billion-parameter, Apache 2.0 open-weight coding model released in May 2024. It supports text-based code generation, explanation, repair, conversion, and documentation within a 4,096-token context window. The model can run locally through compatible open-model tools, but IBM now marks the original 4K checkpoint as deprecated and recommends newer Granite families for new production work.

Text Reasoning Coding
Granite-8B-Code-Instruct is an open-weight coding model released by IBM Research on May 6, 2024. Fine-tuned from Granite-8B-Code-Base-4K, it produces text and source code for common programming tasks within a 4,096-token context window. Its Apache 2.0 license and local-deployment options make it useful for experimentation, research, and small coding workflows, although its deprecated status and short context limit its suitability for new production systems.
Outputs

What Granite-8B-Code-Instruct can produce

Text
Inputs

What it can understand

Text
Capabilities

Supported features

Fine-tuning
Model profile

Performance characteristics

5/10 Reasoning
7/10 Coding
7/10 Speed
9/10 Cost efficiency
Specifications

Technical details

Model family Granite Code
Model type Coding
Context window 4K tokens
Release date 2024-05-06
Status Deprecated; still publicly available for historical and scientific use
Knowledge cutoff notes

IBM's authoritative model card does not publish a specific knowledge cutoff date for this exact checkpoint.

Model notes

The exact original checkpoint is commonly identified as ibm-granite/granite-8b-code-instruct-4k. It is an 8B-parameter BF16 causal language model fine-tuned from Granite-8B-Code-Base-4K. IBM's current model card marks it deprecated and not recommended for new projects because newer Granite families supersede its coding capabilities. A separate Granite-8B-Code-Instruct-128K model was released on July 18, 2024 and should not be conflated with this 4K model. No official per-token API pricing was identified for the open-weight checkpoint.

Model guide

Granite-8B-Code-Instruct: IBM’s Open-Weight 4K Coding Model

Granite-8B-Code-Instruct is IBM Research’s 8-billion-parameter, Apache 2.0-licensed coding language model. The original 4,096-token model is designed for code generation, explanation, repair, translation, documentation, and instruction following. It can be run through compatible open-model tools, but IBM now marks the exact checkpoint as deprecated and recommends newer Granite families for new projects.

What is Granite-8B-Code-Instruct?

Granite-8B-Code-Instruct is an 8-billion-parameter, decoder-only language model developed by IBM Research. It belongs to IBM’s original Granite Code family and is the instruction-tuned version of Granite-8B-Code-Base-4K. In practical terms, it is designed to respond to coding requests rather than simply predict the next token in an unstructured source-code corpus.

The model can generate code, explain existing code, suggest repairs, translate code between languages, create documentation, and follow written instructions related to programming. It is distributed as open weights under the Apache 2.0 license, which generally permits commercial use, modification, and redistribution subject to the license terms.

This page concerns the original 4K checkpoint, commonly identified as ibm-granite/granite-8b-code-instruct-4k. IBM later released a separate Granite-8B-Code-Instruct-128K model. The two checkpoints should not be treated as the same model: the 128K variant has a materially different context limit and release history.

Provider and position in IBM’s lineup

IBM Research developed the model, and IBM Granite publishes it through the Granite organization on Hugging Face. It is an open model that can be downloaded and run independently rather than only accessed through a managed IBM chatbot or a provider-controlled tool interface.

Within IBM’s broader catalog, Granite-8B-Code-Instruct represents an earlier coding-focused model generation. IBM’s current model information marks the original 4K checkpoint as deprecated and not recommended for new projects because newer Granite families supersede its coding capabilities. The weights remain publicly accessible, so the model still has value for historical comparisons, reproducible research, and local experimentation.

What can it do?

Granite-8B-Code-Instruct accepts text prompts and returns text. A user can ask it to write a function, explain a class, identify a likely bug, convert code to another programming language, or produce comments and documentation. It is also suited to smaller code-assistance workflows where the relevant source file and task description fit comfortably within the context window.

  • Generate code from natural-language requirements
  • Complete or edit existing code
  • Explain code and programming concepts
  • Suggest bug fixes and code repairs
  • Translate or convert code between programming languages
  • Produce documentation, comments, and summaries
  • Follow coding-oriented instructions and examples

IBM reports that the broader Granite Code training data covered code in 116 programming languages. The instruction-tuning mixture included code commits, mathematics, code assistance, API-calling examples, and general language instruction. That training background supports programming-related requests, but it does not guarantee equal quality across every language, framework, or specialized domain.

Context window and deployment

The original model has a verified 4,096-token context window. A token is a fragment of text, so this limit includes the prompt, supplied source code, instructions, and the model’s response context. Large repositories, lengthy logs, or several source files may therefore need to be divided into smaller requests.

The model is available in BF16 format and can be loaded with compatible open-model tooling such as Transformers. IBM’s model documentation and repository also identify compatibility with serving or runtime tools including vLLM, SGLang, and Ollama. Features such as streaming, batching, or OpenAI-compatible endpoints depend on the selected deployment layer; they are not intrinsic output capabilities of the checkpoint.

No verified maximum output-token value separate from the 4,096-token context limit is supplied for this exact model. In an actual runtime, the usable response length will depend on how much of the context is occupied by the prompt and on the serving framework’s configuration.

Input, output, and tool support

This is a text-only causal language model. It accepts text and produces text, including source code and natural-language explanations. It does not natively accept images, audio, or video, and it does not generate images, audio, video, speech, music, or embeddings.

The training data included function-calling and API-calling examples, which may help the model write calls or describe an integration. However, the checkpoint should not be treated as having a provider-managed native tool API. It cannot independently execute a function, browse the web, access a database, or operate an external application. Those actions require an application runtime or orchestration layer that interprets the model’s text and performs the requested operation.

Likewise, structured JSON responses are not documented as a distinct native JSON mode for this checkpoint. An application can prompt for a format and validate the result, but format enforcement would come from the surrounding software rather than a verified model feature.

Reasoning, coding quality, speed, and cost

Granite-8B-Code-Instruct can perform reasoning related to code: it can work through a programming problem, explain why a change may fix a defect, or outline steps for an implementation. This should be understood as language-model reasoning rather than a separately documented reasoning mode or guaranteed chain-of-thought capability.

Its 8-billion-parameter size is a practical compromise. Compared with much larger hosted models, it can be more suitable for local experimentation and may have lower infrastructure requirements. It also avoids per-token API charges when an organization operates its own hardware, although local hosting still creates compute, storage, maintenance, and engineering costs. Smaller open models can also be faster and easier to deploy than large models, but they may provide less reliable reasoning on complex tasks, weaker performance on unfamiliar languages, and less robust handling of long source files.

The supplied editorial assessment rates its coding capability at 7 out of 10, speed at 7 out of 10, and cost at 9 out of 10. These are editorial evaluations, not IBM-published benchmark results. They reflect the model’s open-weight economics and focused coding purpose rather than a guarantee of performance for a particular project.

Pricing and licensing

No official per-token API price was identified for the open-weight Granite-8B-Code-Instruct checkpoint. Because the model can be downloaded and run with compatible infrastructure, the main financial consideration is the cost of hosting and operating it rather than a documented IBM inference tariff for this exact model.

The model is released under the Apache 2.0 license. That permissive license supports research and commercial use, modification, and redistribution, subject to the license’s conditions. Users remain responsible for evaluating third-party code, generated output, security risks, and any obligations associated with their deployment environment.

Limitations and deprecated status

The most important limitation is its current status. IBM marks Granite-8B-Code-Instruct-4K as deprecated and not recommended for new projects. Newer Granite models may offer more current maintenance, longer context, or stronger coding performance. This does not make the old checkpoint unusable, but it changes the reason to select it: it is more defensible for research, local testing, education, or historical comparison than for a new mission-critical coding service.

The 4,096-token context also restricts repository-scale work. A prompt containing extensive code, requirements, test output, and documentation can quickly consume the available space. Performance may be weaker on programming languages or tasks that were underrepresented in its instruction-tuning data. IBM recommends few-shot examples for out-of-domain languages and safety testing and target-specific tuning before critical deployment.

There is no published knowledge-cutoff date for this exact checkpoint in the supplied model information. Users should therefore avoid assuming that it knows current libraries, APIs, security advisories, or coding conventions. Generated code should be reviewed, tested, and scanned rather than accepted solely because it appears plausible.

When to choose Granite-8B-Code-Instruct

This model is a reasonable choice when the priority is an openly licensed, locally runnable coding model and the work fits within a short context. Suitable examples include:

  • Testing an early IBM Granite Code model on local hardware
  • Research into instruction-tuned coding language models
  • Small code-generation, explanation, repair, and documentation workflows
  • Educational demonstrations that benefit from downloadable weights
  • Historical comparisons with later Granite Code checkpoints

Its Apache 2.0 license can also be useful when a team wants more control over deployment than a hosted, closed API provides. The trade-off is that the team must supply the runtime, monitoring, security controls, evaluation process, and model maintenance.

When another option may be more appropriate

Choose a newer actively supported coding model when the project needs a current production recommendation, a larger context window, or stronger performance on complex repository-level tasks. Within IBM’s family, the distinct Granite-8B-Code-Instruct-128K checkpoint is relevant when long context is the deciding requirement, although it should be evaluated separately rather than assumed to perform identically.

A managed model or hosted coding service may be preferable when the team needs provider-operated scaling, monitoring, support, or a native tool-execution layer. Conversely, a larger model may be more appropriate when correctness on difficult debugging, unfamiliar codebases, or multi-step reasoning matters more than local cost and speed.

Bottom line

Granite-8B-Code-Instruct is a clear example of IBM’s early open coding-model strategy: an 8-billion-parameter, Apache 2.0 model focused on text-based programming assistance and practical local deployment. Its strongest reasons to use it are openness, relatively compact size, coding specialization, and the ability to run it outside a mandatory hosted API. Its 4K context, text-only design, lack of native managed tools, uncertain current knowledge, and deprecated status make it a poor default for new production systems. For those projects, treat it as a baseline to evaluate rather than as IBM’s current coding endpoint.


Answers to Frequently Asked Questions

Is Granite-8B-Code-Instruct recommended for new production projects?
Generally, no. IBM marks the original Granite-8B-Code-Instruct-4K checkpoint as deprecated and not recommended for new projects. It remains useful for research, education, local experimentation, and historical comparisons, while newer models may offer stronger coding performance, longer context, and more current support.
Does Granite-8B-Code-Instruct support native tool use or multimodal inputs?
No. The model is text-only and does not natively accept images, audio, or video. It can generate text describing function or API calls, but it cannot independently browse the web, execute functions, access databases, or operate external applications without an additional orchestration layer.
Can Granite-8B-Code-Instruct run locally?
Yes. Granite-8B-Code-Instruct can be downloaded and run independently using compatible open-model tools. Its documentation identifies compatibility with Transformers, vLLM, SGLang, and Ollama, although features such as streaming, batching, and OpenAI-compatible endpoints depend on the deployment framework.
What is Granite-8B-Code-Instruct?
Granite-8B-Code-Instruct is an 8-billion-parameter, decoder-only coding language model developed by IBM Research. It is instruction-tuned to generate, explain, repair, translate, and document code, and is available as open weights under the Apache 2.0 license.
What is the context window of Granite-8B-Code-Instruct-4K?
The original Granite-8B-Code-Instruct-4K checkpoint has a verified 4,096-token context window. This limit includes the prompt, source code, instructions, and response context, so large repositories or multiple files may need to be split into smaller requests.


Sources 5
Provider

About IBM watsonx