Granite Code 20B
granite-code-20bIBM 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
Playground
Try Granite Code 20B
Input & output
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.
Examples
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.
About Granite Code 20B
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.
Pricing
| Input | US$0.12 / 1M tokens |
|---|---|
| Output | US$0.60 / 1M tokens |
- Billed by the tokens each request actually uses.
- 1 credit = US$0.01
Cost calculator
Price calculator
Total
US$0.05
5 credits
Per request
US$0.0005 · 0.05 credits
Each request is rounded up to 0.01 credits.
API
No verified API example
The public API passes a different input format than this model needs. Use the playground above.
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
Use cases
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 InstructComparable models
All in this categoryIBM Granite 8B Code Instruct. Trained on permissively-licensed code, strong on multi-language code completion and instruction-following.
Meta's 13B Code Llama tuned for instruction following. A faster mid-size option for code generation and completion, supporting infilling for inserting code at a cursor position. Served on Replicate per call.
≈ US$0.0065/run
Compare Granite Code 20B vs. Code Llama 13B InstructMeta's 34B Code Llama tuned for instruction following. A balance of size and quality for code generation, completion, and explanation, with strong coverage of Python, JavaScript, and other common languages. Runs on Replicate per call.
≈ US$0.0408/run
Compare Granite Code 20B vs. Code Llama 34B Instruct
All models through one API
One API key for every model on Railwail. Usage is charged from prepaid credits, 1 credit = US$0.01.