Granite Code 20B

CodeAvailable
by IBMModel ID: granite-code-20b

IBM Granite 20B Code Instruct. Larger Granite code model balancing quality and inference cost for enterprise CI/CD code-review automation.

Price · 1M in / out
US$0.12 / US$0.60
Context
8,192 tokens
Max. output
8,192 tokens
Input → output
Text → Text
Developer
IBM
Updated
24 September 2026
01

Playground

Try Granite Code 20B

Input & output

US$0.12/1M in
Try Granite Code 20B
Output
The answer appears here.

This run

at most US$0.0025 · 0.25 credits reserved

Billed by the tokens actually used; the unused part of the reservation is refunded.

New here?

10 free credits (US$0.10) when you sign up with Google

Usable 24 hours after sign-up, up to 5 runs per day and at most 2 credits per run. Other sign-in methods start without credits. Enough for 40 runs of this model.

02

Examples

Real outputs from the public examples of this model on Replicate, with the prompt and settings that produced them. They were not generated live on this page.
  • Prompt

    Could you please explain what APR means?

    Response

    APR stands for Annual Percentage Rate. It is a figure that represents the annual cost of borrowing, including fees and interest. It is used to help consumers compare the costs of different loans and credit products. The higher the APR, the more expensive the loan is.

    Settings

    system_prompt: You are an expert in finance that knows many concepts related to loans and credit.

  • Prompt

    Now, please explain APR meaning with a simple example, so that even a 5 years old kid can understand you.

    Response

    Sure, I'd be happy to explain it to a 5-year-old! Let's say you want to buy a toy that costs $10. You ask your parents if you can borrow the money, and they agree. You sign a loan agreement promising to pay them back the $10 plus some extra money, called interest. The interest is calculated as a percentage of the loan amount, and it's called the Annual Percentage Rate, or APR for short. For example, let's say the APR is 5%. This means that you have to pay an extra $0.50 for each dollar you borrow. So, if you borrow $10, you have to pay $10 + ($10 * 0.05) = $10.50 back. The APR is important because it helps you understand how much extra money you'll have to pay back. The higher the APR, the more interest you'll have to pay. So, you want to make sure the APR is as low as possible when you take a loan.

    Settings

    system_prompt: You are an expert in finance that knows many concepts related to loans and credit.

03

About Granite Code 20B

TL;DRAs of 24 September 2026

Granite Code 20B is a model by IBM in the Code category. On Railwail, Granite Code 20B costs US$0.12 per 1M input tokens and US$0.60 per 1M output tokens. The context window holds 8,192 tokens, and one response can be up to 8,192 tokens long.

04

Pricing

Prices in US dollars. Usage is charged from prepaid credits.
InputUS$0.12 / 1M tokens
OutputUS$0.60 / 1M tokens
  • Billed by the tokens each request actually uses.
  • 1 credit = US$0.01

Cost calculator

Price calculator

/ req.
/ req.

Total

US$0.05

5 credits

Per request

US$0.0005 · 0.05 credits

Each request is rounded up to 0.01 credits.

05

API

Call Granite Code 20B with your Railwail API key. Use this model ID in the request:

No verified API example

The public API passes a different input format than this model needs. Use the playground above.

06

Specifications

Model ID
granite-code-20b
Developer
IBM
Category
Code
Input
Text
Output
Text
Context window
8,192 tokens
Max. output
8,192 tokens
Billing
By usage (tokens or GPU time)
Catalog entry updated
24 September 2026

Tags

  • replicate
  • code-generation
  • ibm
  • granite
  • open-weights
  • apache-2
07

Use cases

08

Frequently asked questions

What is Granite Code 20B?

Granite Code 20B is a model by IBM in the Code category.

How much does Granite Code 20B cost on Railwail?

On Railwail, Granite Code 20B costs US$0.12 per 1M input tokens and US$0.60 per 1M output tokens. You are charged for what each request actually uses. Usage is paid from prepaid credits; 1 credit equals US$0.01.

What is the context window of Granite Code 20B?

The context window of Granite Code 20B holds 8,192 tokens. One response can be up to 8,192 tokens long.

How fast is Granite Code 20B?

There are not enough measured runs of Granite Code 20B on Railwail yet to state a run time. It depends on the input, the settings and the load at the provider.

Is Granite Code 20B better than Code Llama 13B Instruct?

That depends on the task. Granite Code 20B (IBM) and Code Llama 13B Instruct (Meta) are both models in the Code category. The comparison page shows their prices and specifications side by side.

Compare Granite Code 20B and Code Llama 13B Instruct
09

Comparable models

All in this category

All models through one API

One API key for every model on Railwail. Usage is charged from prepaid credits, 1 credit = US$0.01.