Spiral gives your agent every tool with one account. Browse the tools →

VS Code · LLMReleased 2026-08-31

How to Use Granite 4.2 8B in VS Code

Granite 4.2 8B handles coding, tool use, and multi-step reasoning. Unlike Granite 4.2 3B, it received additional agent training for software engineering, terminal tasks, and search.

Prompts to try with Granite 4.2 8B in VS Code

Copy an example into VS Code, or ask in your own words.

Use Granite 4.2 8B to investigate the project's failing tests. Trace the first failure to its cause, make the smallest justified patch, and rerun the relevant tests. Report the change and any remaining failures.

Granite 4.2 8BVS Code
Try asking
  • Use Granite 4.2 8B to trace how this project validates incoming requests. Read the relevant files, identify inconsistent validation rules, and propose a focused change with a concrete before-and-after example.

  • Use Granite 4.2 8B to diagnose the latest build failure from the terminal output. Check the project's configuration before suggesting commands, then verify whether the proposed fix resolves the failure.

  • Use Granite 4.2 8B to review this project's tool descriptions. Identify ambiguous arguments and missing failure cases, then revise the descriptions and show example calls for success, missing information, and tool errors.

  • Use Granite 4.2 8B to review the project's Spanish support messages against its English messages. Follow existing Spanish examples, preserve product names and interpolation tokens, and flag wording that needs a human language review.

How to set up Granite 4.2 8B in VS Code

Pick the way that suits you. Each takes about two minutes.

Use Spiral's MCP server

  1. Add the hosted server

    Use Add to VS Code on the console's Agents & MCP page, or run:

    code --add-mcp '{"name":"spiral","type":"http","url":"https://api.spiral.ai/mcp"}'
  2. Sign in

    VS Code asks you to sign in when it first starts the server: sign in to Spiral and click Authorize. No API key. Run MCP: List Servers from the Command Palette to check that Spiral is running.

Use the Spiral skill

  1. Send VS Code this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run Granite 4.2 8B

    One request; the result comes back by polling or a webhook.

    curl https://api.spiral.ai/v1/runs \
      -H "Authorization: Bearer $SPIRAL_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "provider": "openrouter",
        "model": "ibm-granite/granite-4.2-8b",
        "input": {
          "messages": [
            {
              "role": "system"
            }
          ]
        }
      }'

Then paste one of the prompts above: VS Code finds Granite 4.2 8B on Spiral, shows the price and runs it.

Granite 4.2 8B providers and prices

Spiral runs Granite 4.2 8B through OpenRouter. Open a card for today's price, with every fee included.

OpenRouterLLM
IBM: Granite 4.2 8B
ibm-granite/granite-4.2-8b

Settings you can ask for

Ask VS Code for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Seeda whole number
Min p0 to 1
Top ka whole number from 0
Top p0 to 1
Logprobson or off
Max tokens1 to 117964

The most output tokens to generate.

Temperature0 to 2
Top logprobs0 to 20
Presence penalty-2 to 2
Reasoning effortnone, low, or highhigh

How much the model reasons.

Frequency penalty-2 to 2
Repetition penalty0 to 2

Every API field of IBM: Granite 4.2 8B is on its tool page: open its card above.

What can you do with Granite 4.2 8B in VS Code?

Turn a failing test or terminal error into a patch you can check with Granite 4.2 8B. Give the agent a concrete failure, relevant project files, and a clear definition of success.

Fix a reproducible software bug

Ask Granite 4.2 8B to trace a failing test, propose a focused patch, and check the result against that test.

Diagnose a terminal failure

Give Granite 4.2 8B command output and the expected result. Request the next diagnostic command and an explanation of what its result would establish.

Research a question across sources

Have Granite 4.2 8B use available search tools to collect evidence, compare conflicting claims, and draft an answer with citations.

Answer questions about policy text

Supply relevant policy passages to Granite 4.2 8B and request an answer with supporting excerpts and unresolved questions.

Draft multilingual support replies

Give Granite 4.2 8B an approved policy, a customer message, and examples in a supported language. Request a reply that preserves product names and policy terms.

Investigate a service incident

Ask Granite 4.2 8B to compare incident reports with available status-tool results, separate observations from hypotheses, and identify the next check.

Plan a multi-step tool task

Give Granite 4.2 8B a goal and clearly described tools. Ask it to identify dependencies, request missing information, and verify tool results before continuing.

Questions about Granite 4.2 8B in VS Code

Can VS Code use Granite 4.2 8B?

Yes. Add Spiral to VS Code as an MCP server, and VS Code can find and run Granite 4.2 8B like any built-in tool.

How much does Granite 4.2 8B cost in VS Code?

Up to $0.000803 per run at the default inputs. $0.078 per 1M input tokens, $0.195 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your VS Code plan is separate.

Do I need an OpenRouter account to use Granite 4.2 8B in VS Code?

No. Spiral runs Granite 4.2 8B on its own OpenRouter account. You sign in to Spiral once and never paste a key.

How long does it take to set up Granite 4.2 8B in VS Code?

About two minutes: add the hosted server, then sign in.

Does VS Code wait while Granite 4.2 8B runs?

Granite 4.2 8B runs in the background. VS Code starts the run, checks on it and gives you the text, json when it's ready.

What is Granite 4.2 8B useful for?

Use it for coding tasks, tool-assisted work, and problems that require several decisions. IBM specifically trained it on software engineering, terminal coding, and search workflows.

How much context can Granite 4.2 8B handle?

IBM documents a native 128K-token context window. For long-document work, ask a focused question and request supporting passages so you can check the answer.

Does Granite 4.2 always need to think before answering?

It supports thinking, non-thinking, and low-effort thinking modes. Use full thinking for multi-step problems, brief thinking for simpler decisions, and direct answers for straightforward requests.

Which languages does Granite 4.2 support?

IBM lists English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Performance can differ from English, so include examples of the wording and format you want.

Which sampling settings should I start with?

IBM recommends temperature 1.0 and top-p 0.95 for chat, reasoning, and tool calling. Start there before experimenting with other values.

Get started

Start using Granite 4.2 8B in VS Code

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into VS Code:

Set up VS Code

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options