Granite Code 20B
IBM Granite 20B Code Instruct. Larger Granite code model balancing quality and inference cost for enterprise CI/CD code-review automation.
Granite Code 20B is code AI model from Replicate, priced at €0.000 per 1M input tokens with a 128K tokens context window.
Pricing
API Integration
Use our OpenAI-compatible API to integrate Granite Code 20B into your application.
npm install railwailimport railwail from "railwail";
const rw = railwail("YOUR_API_KEY");
// Simple — just pass a string
const reply = await rw.run("granite-code-20b", "Hello! What can you do?");
console.log(reply);
// With message history
const reply2 = await rw.run("granite-code-20b", [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Explain quantum computing simply." },
]);
console.log(reply2);
// Full response with usage info
const res = await rw.chat("granite-code-20b", [
{ role: "user", content: "Hello!" },
], { temperature: 0.7, max_tokens: 500 });
console.log(res.choices[0].message.content);
console.log(res.usage);Frequently asked questions
Related Models
View all CodeCodestral
Mistral's code-specialized model. Optimized for code generation, completion, and understanding across 80+ languages.
Code Llama 13B Instruct
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.
Code Llama 34B Instruct
Meta'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.
Code Llama 70B Instruct
Meta's largest Code Llama, a 70B Llama-2 derivative specialized for programming and tuned to follow instructions in chat form. Handles code generation, completion, and explanation across common languages. Served on Replicate as a per-call endpoint.
Start using Granite Code 20B today
Get started with free credits. No credit card required. Access Granite Code 20B and 100+ other models through a single API.