Granite Code

Granite-34B-Code-Instruct

by IBM watsonx · Legacy/deprecated; available in some IBM watsonx environments and retained for historical or scientific use

IBM Granite-34B-Code-Instruct is a 34-billion-parameter, Apache 2.0-licensed instruction-tuned coding model released in May 2024. It supports text-based code generation, explanation, repair, conversion, documentation, and testing within an approximately 8,192-token context window. The open-weight checkpoint can be self-hosted or accessed through selected IBM watsonx environments, but IBM now classifies it as legacy and does not recommend it for new projects. Its main trade-offs are substantial deployment requirements, limited context, text-only operation, and no verified native tool-use capability or current per-token price.

Text Reasoning Coding
IBM Granite-34B-Code-Instruct is an open-weight coding model designed to follow programming instructions and assist with software-development tasks. It can generate code from requirements, explain existing code, suggest repairs, translate between languages or frameworks, and produce documentation or tests. Its Apache 2.0 license supports self-hosting, but the model’s 8K context window, substantial hardware requirements, and legacy status are important limitations for new deployments.
Outputs

What Granite-34B-Code-Instruct can produce

Text
Inputs

What it can understand

Text
Capabilities

Supported features

Streaming Fine-tuning
Model profile

Performance characteristics

6/10 Reasoning
7/10 Coding
4/10 Speed
8/10 Cost efficiency
Specifications

Technical details

Model family Granite Code
Model type Coding
Context window 8K tokens
Release date May 6, 2024
Status Legacy/deprecated; available in some IBM watsonx environments and retained for historical or scientific use
Knowledge cutoff notes

No authoritative model-specific knowledge cutoff was published in the reviewed IBM or model-card documentation.

Model notes

The IBM watsonx model ID is granite-34b-code-instruct. The IBM Granite Hugging Face checkpoint is ibm-granite/granite-34b-code-instruct-8k. It is a 34-billion-parameter instruction-tuned model derived from Granite-34B-Code-Base and released under Apache 2.0. IBM's model card states that it is not recommended for new projects because newer Granite language models supersede its coding capabilities. The model is text-only and open-weight; no official current per-token price for the exact self-hosted checkpoint was verified. IBM documentation lists it as available in some watsonx environments.

Model guide

Granite-34B-Code-Instruct: IBM’s Legacy Open-Weight Coding Model

Granite-34B-Code-Instruct is IBM’s 34-billion-parameter, instruction-tuned code model for generating, explaining, repairing, converting, and documenting software. Released under Apache 2.0 with an approximately 8,192-token context window, it remains useful for self-hosted coding assistants and compatibility work, but IBM now treats it as a legacy model and does not recommend it for new projects.

What Granite-34B-Code-Instruct is

Granite-34B-Code-Instruct is a 34-billion-parameter decoder-only language model from IBM Research’s Granite Code family. In practical terms, it is a text-in, text-out model that has been trained and instruction-tuned for programming tasks rather than general multimodal work. The instruction-tuned version is intended to respond to requests such as “write a Python function,” “explain this Java class,” or “find the likely defect in this SQL query.”

The model is derived from Granite-34B-Code-Base and was fine-tuned with permissively licensed instruction data. IBM’s research description of the Granite Code family covers code from 116 programming languages, while the instruct variants were trained with material including code commits, mathematical instructions, code-assistance data, function-calling examples, SQL examples, and general language-instruction datasets.

In IBM watsonx environments, the model is commonly identified as granite-34b-code-instruct. The corresponding Hugging Face checkpoint is ibm-granite/granite-34b-code-instruct-8k. The “8k” designation refers to its approximately 8,192-token context window.

What it can do for software development

The model’s central purpose is coding assistance. It can turn natural-language requirements into code, describe how existing code works, propose implementation changes, and help with routine software-engineering documentation. It is also suitable for workflows where an organization wants to host an open-weight model rather than send source code to an externally managed consumer chatbot.

  • Code generation: Create functions, classes, scripts, queries, and other code from written requirements.
  • Code explanation: Summarize unfamiliar code and clarify programming concepts or implementation choices.
  • Bug fixing: Inspect an error description or code sample and suggest a likely correction.
  • Code conversion: Translate code between programming languages, libraries, or frameworks when the necessary context fits in the prompt.
  • Documentation and tests: Draft comments, technical documentation, test cases, and related development artifacts.
  • Modernization support: Assist with repetitive transformations and software-maintenance tasks in controlled workflows.

These capabilities should be treated as assistance rather than automatic verification. Generated code can contain logic errors, insecure patterns, incorrect library usage, or language-specific mistakes. Production use should include compilation or execution checks, code review, security testing, and tests appropriate to the application.

Verified technical specifications

SpecificationVerified detail
ProviderIBM Research
Model familyGranite Code
Parameters34 billion
Context windowApproximately 8,192 tokens
InputText
OutputText
LicenseApache 2.0
Release dateMay 6, 2024
IBM watsonx model IDgranite-34b-code-instruct
Hugging Face checkpointibm-granite/granite-34b-code-instruct-8k

The supplied documentation does not specify a separate maximum output-token limit. The stated 8,192-token figure describes the model’s context capacity, not necessarily the number of tokens that can be generated in one response. Applications should therefore avoid assuming a larger output limit than their selected serving configuration documents.

What the 8K context window means

A context window is the amount of text the model can consider across the prompt and conversation or surrounding material. With an approximately 8,192-token window, Granite-34B-Code-Instruct can handle focused files, functions, error messages, and moderate task descriptions, but it is less suitable for loading an entire large repository or a lengthy software specification at once.

For larger projects, developers may need to retrieve only relevant files, summarize earlier discussion, split a task into smaller steps, or use a separate indexing and retrieval layer. These techniques can make the model useful in repository workflows, but they do not remove the underlying context limit. Cross-file reasoning may become less reliable when the required dependencies cannot fit into the available prompt.

The 34-billion-parameter size also affects deployment. IBM documentation identifies compatible frameworks and serving systems including Transformers, vLLM, SGLang, and text-generation-inference. Running the model yourself generally requires substantial GPU memory and appropriate inference infrastructure. Quantization or other serving optimizations may change hardware requirements, but specific memory figures are not established by the supplied research and should not be assumed.

Availability, pricing, and legacy status

Granite-34B-Code-Instruct is distributed as open weights under the Apache 2.0 license. An organization can use compatible tooling to download and serve the checkpoint, subject to the license and its own operational requirements. It may also be available through selected IBM watsonx environments under the IBM model ID.

No current official per-token price for this exact self-hosted checkpoint was verified in the supplied research. Self-hosting does not create an IBM inference bill for each generated token, but it does require infrastructure, storage, engineering, monitoring, and maintenance. If the model is accessed through a managed IBM environment, pricing and availability may depend on the specific watsonx product, region, deployment mode, account, and current catalog.

The most important availability qualification is its status. IBM’s Granite model card carries a deprecation warning and says that the model is not recommended for new projects because newer mainline Granite language models supersede its coding capabilities. That does not make the checkpoint unusable: it can still be relevant for historical evaluation, research, compatibility, or an existing deployment that depends on its behavior. It does mean that teams starting a new production system should first evaluate a currently supported model.

Modalities, reasoning, and tool support

This is a text-only model. It accepts text prompts and produces text responses; the supplied research does not verify native image, audio, or video input or output. It is therefore not an appropriate choice for interpreting screenshots, analyzing audio recordings, generating images, or producing media.

Granite-34B-Code-Instruct can perform reasoning useful for programming, such as following requirements, tracing code, comparing implementation approaches, and working through selected logic or SQL problems. The editorial research assigns it a reasoning score of 6 out of 10 and a coding score of 7 out of 10. Those scores are editorial assessments, not IBM-published benchmark results or guarantees. Actual performance depends on the programming language, prompt quality, task complexity, and serving configuration.

The training material included function-calling examples, but the supplied model record does not verify provider-managed tool use or an integrated action system for this checkpoint. Its tool-use field is recorded as 0. In practice, a developer may build an external orchestration layer around the text model, but that is an application feature rather than a native capability that should be attributed to the model itself. Structured JSON output is also not verified as a distinct supported mode.

Main strengths and trade-offs

The model’s strongest practical distinction is the combination of coding specialization, open weights, and a permissive Apache 2.0 license. These characteristics can appeal to teams that need to inspect, adapt, or self-host a code model and want more control over where source code and prompts are processed. The instruction tuning also makes it more directly useful for coding requests than a base language model that has not been trained to follow such instructions.

Those benefits come with costs. A 34-billion-parameter checkpoint is resource-intensive compared with smaller coding models, which can make it slower or more expensive to operate at scale when measured by infrastructure and latency rather than provider token prices. The research gives editorial scores of 4 out of 10 for speed and 8 out of 10 for cost, but these are subjective evaluations rather than standardized provider claims. Actual speed and total cost depend on hardware, quantization, concurrency, prompt length, and serving software.

The 8K context window is another trade-off. It is adequate for targeted coding tasks but restrictive for large-repository analysis. The model also lacks verified native multimodal input, provider-managed web search, native action execution, and a documented current per-token price for the exact checkpoint.

When to choose Granite-34B-Code-Instruct

This model can be a reasonable choice when the main requirement is a self-hosted or open-weight coding assistant and the project can work within an approximately 8K-token context. It is particularly relevant in the following situations:

  • An existing system already depends on the Granite-34B-Code-Instruct checkpoint or its behavior.
  • A research or evaluation project needs the original Granite Code instruct model released in 2024.
  • An organization wants Apache 2.0-licensed weights for controlled deployment and is prepared to supply the required hardware.
  • The workload consists of focused code generation, explanation, repair, conversion, documentation, or test-writing tasks.
  • The team can validate outputs with compilers, tests, security scanners, and human review.

Another option may be more appropriate for a new production system if long repository context, current vendor support, lower serving costs, faster responses, multimodal input, managed tool execution, or a documented structured-output interface is important. A current Granite model should be evaluated first for new IBM-aligned deployments because IBM identifies newer Granite language models as the preferred successor direction. Smaller coding models may offer better latency and hardware economics, while larger or longer-context systems may be better for broad repository analysis. Those alternatives should be compared using the application’s own code languages, latency targets, quality tests, and security requirements.

Bottom line

Granite-34B-Code-Instruct is a capable, text-only coding model with 34 billion parameters, an approximately 8K context window, open weights, and an Apache 2.0 license. It is most defensible today for self-hosted coding assistance, compatibility, research, and historical evaluation. Its legacy designation, resource requirements, limited context, and lack of verified native tools or multimodal features make it a less compelling starting point for new applications. Teams that choose it should treat generated code as untrusted draft output and confirm that the checkpoint remains available and supported in their intended deployment environment.


Answers to Frequently Asked Questions

Is Granite-34B-Code-Instruct still recommended for new projects?
IBM’s model card includes a deprecation warning and does not recommend Granite-34B-Code-Instruct for new projects because newer mainline Granite language models supersede its coding capabilities. The model can still be useful for existing deployments, compatibility, research, historical evaluation, and self-hosted coding assistance, but new production systems should evaluate currently supported alternatives first.
What does the 8K context window mean for Granite-34B-Code-Instruct?
The approximately 8,192-token context window limits how much code, documentation, conversation, and other text the model can consider in one request. It is suitable for focused files, functions, and error messages, but less suitable for entire large repositories. Larger projects may require retrieval, summarization, or splitting tasks into smaller steps.
What programming tasks can Granite-34B-Code-Instruct perform?
It can generate functions, classes, scripts, and queries; explain unfamiliar code; suggest bug fixes; convert code between languages or frameworks; draft documentation and tests; and assist with repetitive software-maintenance and modernization tasks. Generated code should still be checked through testing, code review, compilation or execution, and security validation.
What is Granite-34B-Code-Instruct?
Granite-34B-Code-Instruct is a 34-billion-parameter, text-only decoder-only language model from IBM Research’s Granite Code family. It is instruction-tuned for programming tasks such as code generation, explanation, debugging, conversion, documentation, and test writing.
What are the technical specifications of Granite-34B-Code-Instruct?
The model has 34 billion parameters, an approximately 8,192-token context window, text input and output, and an Apache 2.0 license. It was released on May 6, 2024. Its IBM watsonx model ID is `granite-34b-code-instruct`, and its Hugging Face checkpoint is `ibm-granite/granite-34b-code-instruct-8k`.


Sources 5
Provider

About IBM watsonx