IBM logo

Granite 4.0 Micro

GraniteCurrent
byIBMIBM(enterprise)
Released October 20, 2025
Context131K tokens
Price (In / Out)$0.02/M / $0.11/M
CategoryLarge Language Model

About Granite 4.0 Micro

Granite 4.0 Micro is a large language model from IBM. Supports up to 131,000 token context window. Available from $0.02/M input tokens.

Capabilities

textcode

Input Modalities

text

Output Modalities

text

Technical Details

API Identifier
ibm-granite/granite-4.0-h-micro
Category
Large Language Model
Context Window
131,000 tokens

Tags

budget-friendlylong-context

Run this model yourself

Local and cloud setup for Granite 4.0 Micro, with exact configurations, sources and clear evidence limits.

Find a model for your hardware
Local hardwareDocumented setupSources checked Oct 16, 2026

Run Granite 4.0 H Micro on a Linux RTX 4090 desktop

Use an existing Linux desktop with one GeForce RTX 4090 to serve IBM’s 3B Granite 4.0 H Micro instruct checkpoint. Pin the original BF16 weights and vLLM 0.31.0, keep access on loopback, and check a short chat at a 4,096-token context. This is the catalog’s H Micro artifact, distinct from non-H Micro. Documented instructions; no measured fit or speed claim.

Hardware
One NVIDIA GeForce RTX 4090 on Linux x86_64
Runtime
vLLM 0.31.0+cu129 · CUDA
Model format
safetensors · BF16 · None; original BF16 weights
Workload
4,096 token context · 1 concurrent

Based on source documentation; this setup has not been executed by OpenTools. Memory: unknown. No compatible measurement available.

Read the complete setup guide

Before you start

  • An already provisioned Linux x86_64 host with one NVIDIA GeForce RTX 4090 (manufacturer-labeled 24 GB dedicated memory); no claim that this is a tested minimum.
  • Python 3.12 with virtual-environment support, curl, sha256sum, outbound HTTPS to the official package/model hosts, and a working CUDA-compatible NVIDIA driver.
  • The full repository download is about 6.39 GB. Allow additional disk for the virtual environment, package cache and runtime files; complete disk and RAM minima have not been measured.
  • A trusted single-user deployment: this guide binds vLLM to 127.0.0.1. Do not publish port 8000 or treat the API key as protection for every vLLM route.
  • Check your desktop case, cooling, GPU power connectors and power supply against NVIDIA’s installation requirements. The RTX 4090 page lists an 850 W minimum system power recommendation; GPU maximum power is not measured wall draw. This guide assumes the GPU is already installed and its driver works.

Exact model and requirements

Artifact:
IBM / Granite 4.0 H Micro · checkpoint ibm-granite/granite-4.0-h-micro
Publisher revision:
d5f01a3ea75f088947be3aae039f4ad52837dfde
Artifact digest:
No single publisher digest identifies the full repository; exact per-file hashes and the repository commit are pinned.
Download size:
5.94 GiB
Memory requirement (unknown):
Unknown — Complete GPU footprint has not been measured: model weights, KV cache, runtime allocations, compilation and workspace must all fit.
System RAM / disk:
Unknown / Unknown
Placement:
single device. One GPU; no tensor or pipeline sharding and no pooling of GPU and host RAM. No CPU or disk weight offload is enabled.
KV cache:
BF16 attention KV cache via auto with BF16 weights. Prefix caching disabled; Mamba cache mode none; Triton Mamba backend; BF16 Mamba convolution and SSM state. No separate mamba_ssm package.
Workload:
4,096 token context; Unknown; Unknown; concurrency 1; batch 1; cache cold; repetitions Unknown.
Tokenizer:
ibm-granite/granite-4.0-h-micro · d5f01a3ea75f088947be3aae039f4ad52837dfde
Sampling / reasoning:
Verification uses temperature 0 and max_tokens 64. The service uses --generation-config vllm; this is not a throughput protocol. Prefix caching is explicitly disabled; no warm-cache measurement is inferred. Instruct checkpoint with no separate reasoning parser or budget. This recipe checks text chat only; it does not validate tool calling, FIM, structured output or long-context quality.
Runtime prerequisites:
Linux x86_64; Python 3.12; Working NVIDIA driver R580 or newer; CUDA 12.x applications remain supported by newer drivers through backward compatibility. Verify the selected environment with nvidia-smi and torch.cuda.is_available()..

Official artifact · License

IBM declares Apache 2.0 for this checkpoint. Read the license, retain applicable copyright, license and attribution notices, and mark modifications when redistributing covered work. No provider API subscription is needed to download these ungated weights.

  • The two BF16 weight shards total 6,382,844,048 bytes. The full repository is about 6.39 GB. Neither figure is a complete runtime RAM/VRAM or disk requirement.
  • The selected GeForce RTX 4090 is labeled 24 GB by the vendor. Dedicated GPU memory and system RAM are different pools and are not summed.
  • No measured peak memory, completed-run evidence, tokens per second or latency result is supplied. A documented runtime architecture match does not prove this exact deployment fits.
  • H Micro uses attention and Mamba layers (GraniteMoeHybridForCausalLM). Do not estimate its full cache from a transformer-only KV formula or substitute the non-H Micro checkpoint.

One-time setup and hardware

Hardware purchase
Unknown — No dated hardware purchase quote is available; existing ownership is not treated as a zero purchase price.
No dated hardware purchase quote is available; existing ownership is not treated as a zero purchase price. Tax: unknown.
Initial setup work
Unknown — Initial setup time is not priced; no labour rate or duration has been measured.
Initial setup time is not priced; no labour rate or duration has been measured. Tax: unknown.

Recurring costs

Electricity
Unknown — Whole-system measured wall power, powered-on hours and the reader’s electricity tariff are unknown. GPU maximum board power is not a measured system draw.
Whole-system measured wall power, powered-on hours and the reader’s electricity tariff are unknown. GPU maximum board power is not a measured system draw. Tax: unknown.
Operations and maintenance
Unknown — Ongoing patching and operation effort is not measured or priced.
Ongoing patching and operation effort is not measured or priced. Tax: unknown.
Persistent storage
Unknown — The owned host storage arrangement and any recurring backup or storage bill are unknown; no monthly amount is asserted.
The owned host storage arrangement and any recurring backup or storage bill are unknown; no monthly amount is asserted. Tax: unknown.
Data transfer
Unknown — The reader’s internet or network plan and traffic volume are unknown; loopback requests alone do not establish total network costs.
The reader’s internet or network plan and traffic volume are unknown; loopback requests alone do not establish total network costs. Tax: unknown.

Install the runtime

  1. 1. Check the existing GPU host

    Use an already provisioned Linux x86_64 server with one GeForce RTX 4090, Python 3.12 with venv support, curl, sha256sum, and a working NVIDIA R580-or-newer driver. Driver provisioning is a server-administrator prerequisite; this guide does not replace the host driver. Keep the machine on a trusted network and ensure port 8000 is unused.

    Command
    nvidia-smi
    python3.12 --version
    df -h "$HOME"

    Expected result: The GeForce RTX 4090 is visible, Python reports 3.12, and there is enough free space for the 6.39 GB model download plus the Python environment, package cache and runtime workspace.

  2. 2. Create an isolated environment and install pinned vLLM

    Run in a new shell on the GPU host. The exact CUDA 12.9 vLLM wheel is pinned by release and publisher-provided SHA256. Dependencies resolve inside this fresh environment; do not mix the AMI or host Python environment into it. The system CUDA toolkit version need not equal the bundled wheel runtime. If python3.12 -m venv is unavailable, install your OS vendor’s Python 3.12 venv package first.

    Command
    mkdir -p "$HOME/granite4-h-micro-hosting"
    cd "$HOME/granite4-h-micro-hosting"
    python3.12 -m venv .venv
    source .venv/bin/activate
    python -m pip install --upgrade pip
    python -m pip install --extra-index-url https://download.pytorch.org/whl/cu129 'https://github.com/vllm-project/vllm/releases/download/v0.31.0/vllm-0.31.0%2Bcu129-cp38-abi3-manylinux_2_28_x86_64.whl#sha256=5176ab746f4e736c4a354a11d0620abf0a941de287cad937ac34039293ca6f5f'
    python -m pip check
    vllm --version
    python -c 'import torch; print("CUDA available:", torch.cuda.is_available()); print("GPU:", torch.cuda.get_device_name(0) if torch.cuda.is_available() else "not detected")'

    Expected result: pip check reports no broken requirements; vllm reports version 0.31.0 (the wheel may include +cu129); CUDA available is True and the GPU is NVIDIA GeForce RTX 4090. This is an expected check for the reader, not a result observed by OpenTools.

Download the model

  1. 1. Download IBM’s exact H Micro snapshot

    The catalog points to H Micro, not the separate non-H Micro repository. Pin weights, tokenizer, configuration and chat template together. The repository metadata reports ungated access when checked.

    Command
    cd "$HOME/granite4-h-micro-hosting"
    source .venv/bin/activate
    python - <<'PY'
    from huggingface_hub import snapshot_download
    snapshot_download(repo_id="ibm-granite/granite-4.0-h-micro", revision="d5f01a3ea75f088947be3aae039f4ad52837dfde", local_dir="./model")
    PY

    Expected result: ./model contains both weight shards, config.json, tokenizer files, chat_template.jinja and the weight index from the exact pinned revision.

  2. 2. Verify both weight shards

    Compare the downloaded files with SHA256 values exposed by IBM’s official repository metadata. Stop on any mismatch.

    Command
    cd "$HOME/granite4-h-micro-hosting"
    sha256sum --check <<'SHA256'
    883f134c083852597a3033cfc7de8357acde530b3fe941a567f507431f5c9216  model/model-00001-of-00002.safetensors
    987e8aee10c40446c71f4c91d689672f1805f94712738f7a44d06a7dee5e787f  model/model-00002-of-00002.safetensors
    SHA256

    Expected result: Both weight files report OK.

Configure

  1. 1. Create a private local service key

    Run on the GPU host. This writes a fresh random key only when the file is absent, keeps it mode 600 and exports it without printing it. Treat the key file as private. vLLM API-key checks do not cover every route, so keep the loopback binding used below.

    Command
    cd "$HOME/granite4-h-micro-hosting"
    source .venv/bin/activate
    umask 077
    python - <<'PY'
    import secrets
    from pathlib import Path
    key = Path(".vllm-api-key")
    if not key.exists():
        key.write_text(secrets.token_urlsafe(32))
    key.chmod(0o600)
    PY
    export VLLM_API_KEY="$(cat .vllm-api-key)"

    Expected result: A private .vllm-api-key file exists in the dedicated directory; no secret is printed. The shell environment contains VLLM_API_KEY.

Start the model

  1. 1. Start the private Granite 4.0 H Micro endpoint

    Run the verified local snapshot in a dedicated foreground terminal. The runtime supports the GraniteMoeHybridForCausalLM architecture declared by this checkpoint. Use BF16 weights, one GPU, no weight offload and one active sequence. The 4,096-token limit covers prompt plus output; this is a bounded text-chat setup rather than a test of the advertised 131,072-token maximum. Wait for initialization and pass the checks below before treating the service as usable. Prefix caching disabled; Mamba cache mode none; Triton Mamba backend; BF16 Mamba convolution and SSM state. No separate mamba_ssm package. The vLLM wheel supplies its internal Mamba kernels.

    Command
    cd "$HOME/granite4-h-micro-hosting"
    source .venv/bin/activate
    export VLLM_API_KEY="$(cat .vllm-api-key)"
    vllm serve ./model \
      --served-model-name granite4-h-micro-local \
      --host 127.0.0.1 --port 8000 \
      --dtype bfloat16 --kv-cache-dtype auto \
      --max-model-len 4096 --max-num-seqs 1 \
      --tensor-parallel-size 1 --pipeline-parallel-size 1 \
      --generation-config vllm \
      --no-enable-prefix-caching --mamba-cache-mode none \
      --mamba-backend triton --mamba-cache-dtype bfloat16 --mamba-ssm-cache-dtype bfloat16

    Expected result: The process remains running and announces an HTTP listener on 127.0.0.1:8000 after model initialization. If it exits, use the troubleshooting checks before making any success or performance claim.

Connect to your endpoint

http://127.0.0.1:8000/v1

Run clients and verification on the GPU host. Only that host loopback is bound. Remote clients need a separately controlled SSH tunnel; do not change --host to a public interface for convenience.

Access: loopback. VLLM_API_KEY is a reader-generated local service key for /v1, /v2 and /inference paths. Other paths may remain unauthenticated; the loopback boundary is essential. Other users on the same host can reach loopback, so use a trusted single-user machine.

Verify the setup

  1. 1. Check the model identity

    Open a second terminal on the same GPU host. Load the local key without displaying it and call the authenticated models endpoint.

    Command
    cd "$HOME/granite4-h-micro-hosting"
    export VLLM_API_KEY="$(cat .vllm-api-key)"
    curl --fail --silent --show-error http://127.0.0.1:8000/v1/models \
      -H "Authorization: Bearer $VLLM_API_KEY"

    Expected result: The JSON response contains the served model id granite4-h-micro-local. The endpoint responds successfully only after startup completes.

  2. 2. Request a short response

    In that second terminal, send a small chat request. This checks response generation; it is not a benchmark and provides no throughput or latency guarantee.

    Command
    curl --fail --silent --show-error http://127.0.0.1:8000/v1/chat/completions \
      -H "Authorization: Bearer $VLLM_API_KEY" \
      -H 'Content-Type: application/json' \
      -d '{"model":"granite4-h-micro-local","messages":[{"role":"user","content":"Explain what a GPU does in one sentence."}],"max_tokens":64,"temperature":0}'

    Expected result: A successful JSON response includes a nonempty choices[0].message.content. Wording varies; no exact answer or speed is guaranteed.

  3. 3. Verify the access boundary

    Check that the listener is only on 127.0.0.1:8000 and that the /v1 route rejects a missing key. Keep the listener on desktop loopback.

    Command
    ss -ltn | grep '127.0.0.1:8000'
    curl --silent --output /dev/null --write-out '%{http_code}\n' http://127.0.0.1:8000/v1/models

    Expected result: The listener is on loopback and the unauthenticated /v1/models request is denied (normally HTTP 401). This denial does not prove that every server path is authenticated.

Performance evidence

No compatible measurement available. Documented support and estimated memory do not establish response speed.

Limits and troubleshooting

  • These are documented instructions assembled from publisher and runtime sources. OpenTools has not executed this configuration or measured its full memory fit, throughput or latency.
  • The frozen catalog API identifier is ibm-granite/granite-4.0-h-micro. IBM also publishes a different granite-4.0-micro checkpoint. This guide deliberately uses H Micro; weights, configuration and memory observations must not be transferred between them.
  • IBM describes H Micro as a 3B instruct model; its configuration combines Mamba and attention layers. vLLM lists its GraniteMoeHybridForCausalLM architecture. An architecture match is documented support, not proof that this exact pinned deployment starts successfully.
  • The publisher config permits 131,072 positions. This recipe sets 4,096 combined prompt and output tokens with one active sequence. Larger context, concurrent users and a different cache policy create different configurations.
  • The verification request checks text generation only. IBM documents tool calling and other uses, but this service recipe does not configure or verify a tool parser, FIM or structured output. Generated answers can be wrong; validate results for the intended task.
  • The runtime wheel is pinned; its dependencies resolve at installation. Save pip freeze with any actual run evidence. The host NVIDIA driver remains an administrator prerequisite.
  • Loopback is reachable by other users on the host. Use a trusted single-user desktop. Run the client on that same desktop. Remote access and a public authenticated gateway are outside this local recipe.
  • The pinned vLLM hybrid implementation requires an aligned Mamba cache when prefix caching is enabled; this basic recipe disables prefix caching and sets Mamba cache mode none. Enabling prefix caching or changing Mamba state precision changes the configuration.
nvidia-smi fails or PyTorch reports CUDA unavailable
Check the physical/virtual GPU and host driver before downloading weights. Check the installed desktop driver and GPU power/cooling. Use a fresh environment and the pinned CUDA 12.9 wheel; do not mix a pre-existing torch installation into it.
Installation or download runs out of disk space
Check the filesystem containing $HOME/granite4-h-micro-hosting and package caches. The model download alone is about 6.39 GB; add space for the environment and runtime files. Resume the same pinned snapshot and repeat all shard checks.
Model loading or runtime initialization runs out of GPU or host memory
Stop other GPU workloads and inspect nvidia-smi. Complete memory fit is unknown. Lowering context, changing precision or moving to different hardware creates a different configuration; do not report that as a successful run of this exact recipe.
Port 8000 is already used
Stop the conflicting service you own or choose another loopback port consistently in the start command, checks and SSH tunnel. Do not expose a public interface to work around a local port conflict.
A /v1 request returns 401
In the client terminal load the same private .vllm-api-key file used by the server and send Authorization: Bearer. Restart the server after deliberately rotating the key.

Stop the model

  1. 1. Stop the model process

    Press Ctrl-C in the terminal running vllm and wait for shutdown. Then check from the host terminal that the endpoint no longer answers. Confirm GPU memory is released with nvidia-smi.

    Command
    curl --connect-timeout 3 http://127.0.0.1:8000/v1/models

    Expected result: The request cannot connect after the listener has stopped. Confirm no other process has taken the same port before assuming the host is idle.

Uninstall

  1. 1. Remove only this guide’s environment and files

    After stopping the server, preserve any needed outputs, then remove the dedicated $HOME/granite4-h-micro-hosting directory you created, including its virtual environment, downloaded model and private key. Check the path before deleting; do not remove shared model caches or another project. Remove any copied client key as well. The host NVIDIA driver is not removed.

    Command
    deactivate
    unset VLLM_API_KEY

    Expected result: The dedicated directory is removed when you choose to delete it; the shell no longer uses the virtual environment or service key. Shared host configuration remains separate.

Sources and verification

Sources checked Oct 16, 2026. Verification source

Related guides

Compare this configuration
Cloud serverDocumented setupSources checked Oct 16, 2026

Self-host Granite 4.0 H Micro on AWS G6e

Run IBM’s 3B-parameter Granite 4.0 H Micro instruct checkpoint with pinned BF16 files and vLLM 0.31.0. This self-managed AWS g6e.2xlarge recipe uses a private loopback endpoint, a 4,096-token context and one active sequence. It follows the catalog’s H Micro artifact, which differs from non-H Micro. Documented instructions; no OpenTools GPU execution, fit measurement or speed result.

Hardware
AWS EC2 g6e.2xlarge (one NVIDIA L40S)
Runtime
vLLM 0.31.0+cu129 · CUDA
Model format
safetensors · BF16 · None; original BF16 weights
Workload
4,096 token context · 1 concurrent

Based on source documentation; this setup has not been executed by OpenTools. Memory: unknown. No compatible measurement available.

Read the complete setup guide

Before you start

  • AWS account, region with G6e capacity, sufficient GPU quota, an SSH key and permission to launch and stop the selected EC2 instance. Confirm current charges before launching.
  • Python 3.12 with virtual-environment support, curl, sha256sum, outbound HTTPS to the official package/model hosts, and a working CUDA-compatible NVIDIA driver.
  • The full repository download is about 6.39 GB. Allow additional disk for the virtual environment, package cache and runtime files; complete disk and RAM minima have not been measured.
  • A trusted single-user deployment: this guide binds vLLM to 127.0.0.1. Do not publish port 8000 or treat the API key as protection for every vLLM route.

Exact model and requirements

Artifact:
IBM / Granite 4.0 H Micro · checkpoint ibm-granite/granite-4.0-h-micro
Publisher revision:
d5f01a3ea75f088947be3aae039f4ad52837dfde
Artifact digest:
No single publisher digest identifies the full repository; exact per-file hashes and the repository commit are pinned.
Download size:
5.94 GiB
Memory requirement (unknown):
Unknown — Complete GPU footprint has not been measured: model weights, KV cache, runtime allocations, compilation and workspace must all fit.
System RAM / disk:
Unknown / Unknown
Placement:
single device. One GPU; no tensor or pipeline sharding and no pooling of GPU and host RAM. No CPU or disk weight offload is enabled.
KV cache:
BF16 attention KV cache via auto with BF16 weights. Prefix caching disabled; Mamba cache mode none; Triton Mamba backend; BF16 Mamba convolution and SSM state. No separate mamba_ssm package.
Workload:
4,096 token context; Unknown; Unknown; concurrency 1; batch 1; cache cold; repetitions Unknown.
Tokenizer:
ibm-granite/granite-4.0-h-micro · d5f01a3ea75f088947be3aae039f4ad52837dfde
Sampling / reasoning:
Verification uses temperature 0 and max_tokens 64. The service uses --generation-config vllm; this is not a throughput protocol. Prefix caching is explicitly disabled; no warm-cache measurement is inferred. Instruct checkpoint with no separate reasoning parser or budget. This recipe checks text chat only; it does not validate tool calling, FIM, structured output or long-context quality.
Runtime prerequisites:
Linux x86_64; Python 3.12; Working NVIDIA driver R580 or newer; CUDA 12.x applications remain supported by newer drivers through backward compatibility. Verify the selected environment with nvidia-smi and torch.cuda.is_available()..

Official artifact · License

IBM declares Apache 2.0 for this checkpoint. Read the license, retain applicable copyright, license and attribution notices, and mark modifications when redistributing covered work. No provider API subscription is needed to download these ungated weights.

  • The two BF16 weight shards total 6,382,844,048 bytes. The full repository is about 6.39 GB. Neither figure is a complete runtime RAM/VRAM or disk requirement.
  • The selected L40S is labeled 48 GB by the vendor. Dedicated GPU memory and system RAM are different pools and are not summed.
  • No measured peak memory, completed-run evidence, tokens per second or latency result is supplied. A documented runtime architecture match does not prove this exact deployment fits.
  • H Micro uses attention and Mamba layers (GraniteMoeHybridForCausalLM). Do not estimate its full cache from a transformer-only KV formula or substitute the non-H Micro checkpoint.

One-time setup and hardware

Hardware purchase
Not applicable — This recipe rents EC2 capacity instead of purchasing a server; hourly compute is listed separately.
This recipe rents EC2 capacity instead of purchasing a server; hourly compute is listed separately. Tax: unknown.
Initial setup work
Unknown — Initial provisioning and setup time are not priced; no labour rate or duration has been measured.
Initial provisioning and setup time are not priced; no labour rate or duration has been measured. Tax: unknown.

Recurring costs

EC2 compute
$2.24 / hour
Public AWS Linux On-Demand rate, no preinstalled paid software, no discount/Spot/reservation or tax assumed. Eight billed hours cost USD 17.93664 in compute; 24 hours cost USD 53.80992, before storage, egress and administration. Idle running hours are billed too. Capacity and quotas must be checked before launch. Region: us-east-1 (US East, N. Virginia). SKU: g6e.2xlarge Linux On-Demand. Tax: excluded. Price dated Oct 16, 2026. Price source
Persistent storage
$0.08 / GB month
AWS lists USD0.08 per GB-month for gp3 in this region; its page defines GB as 1024^3 bytes. A 100 GiB root volume retained for a full month costs USD8 in baseline storage, separately from compute. Keep baseline 3000 IOPS and 125 MB/s; extra provisioned performance, snapshots and other retained resources add charges. Storage is provisioned capacity, not model file size, and persists when EC2 is stopped. Region: us-east-1 (US East, N. Virginia). SKU: Amazon EBS gp3 storage at baseline 3000 IOPS and 125 MB/s. Tax: excluded. Price dated Oct 16, 2026. Price source
Data transfer
Unknown — Data transfer charges depend on direction, region and destination; no rate or traffic volume is assumed.
Data transfer charges depend on direction, region and destination; no rate or traffic volume is assumed. Tax: unknown.
Operations and maintenance
Unknown — Ongoing patching and operation effort is not measured or priced.
Ongoing patching and operation effort is not measured or priced. Tax: unknown.

Install the runtime

  1. 1. Select and connect to the EC2 host

    In the EC2 console, select US East (N. Virginia), us-east-1, with G6e capacity and review its current On-Demand estimate and your GPU quota before launching. Select g6e.2xlarge and the AWS-published Deep Learning Base AMI with Single CUDA (Ubuntu 24.04) 20261002, x86_64. The dated AMI release notes list G6e and NVIDIA driver 595.91.07. Regional AMI IDs differ: verify the publisher and exact release name instead of using a random community image. Select a root EBS volume with 100 GiB gp3 at baseline 3,000 IOPS and 125 MB/s as a planning allowance for this walkthrough, not a tested minimum. Restrict inbound SSH to your own address; do not allow inbound TCP 8000. Connect using the SSH command shown in EC2 Connect; run the subsequent installation commands on that instance.

    Command
    nvidia-smi
    python3.12 --version
    df -h "$HOME"

    Expected result: nvidia-smi identifies one L40S and the selected AMI driver; Python reports 3.12; the chosen filesystem has adequate free space. Do not continue if GPU, architecture, image release or access controls differ.

  2. 2. Create an isolated environment and install pinned vLLM

    Run in a new shell on the GPU host. The exact CUDA 12.9 vLLM wheel is pinned by release and publisher-provided SHA256. Dependencies resolve inside this fresh environment; do not mix the AMI or host Python environment into it. The system CUDA toolkit version need not equal the bundled wheel runtime. If python3.12 -m venv is unavailable, install your OS vendor’s Python 3.12 venv package first.

    Command
    mkdir -p "$HOME/granite4-h-micro-hosting"
    cd "$HOME/granite4-h-micro-hosting"
    python3.12 -m venv .venv
    source .venv/bin/activate
    python -m pip install --upgrade pip
    python -m pip install --extra-index-url https://download.pytorch.org/whl/cu129 'https://github.com/vllm-project/vllm/releases/download/v0.31.0/vllm-0.31.0%2Bcu129-cp38-abi3-manylinux_2_28_x86_64.whl#sha256=5176ab746f4e736c4a354a11d0620abf0a941de287cad937ac34039293ca6f5f'
    python -m pip check
    vllm --version
    python -c 'import torch; print("CUDA available:", torch.cuda.is_available()); print("GPU:", torch.cuda.get_device_name(0) if torch.cuda.is_available() else "not detected")'

    Expected result: pip check reports no broken requirements; vllm reports version 0.31.0 (the wheel may include +cu129); CUDA available is True and the GPU is NVIDIA L40S. This is an expected check for the reader, not a result observed by OpenTools.

Download the model

  1. 1. Download IBM’s exact H Micro snapshot

    The catalog points to H Micro, not the separate non-H Micro repository. Pin weights, tokenizer, configuration and chat template together. The repository metadata reports ungated access when checked.

    Command
    cd "$HOME/granite4-h-micro-hosting"
    source .venv/bin/activate
    python - <<'PY'
    from huggingface_hub import snapshot_download
    snapshot_download(repo_id="ibm-granite/granite-4.0-h-micro", revision="d5f01a3ea75f088947be3aae039f4ad52837dfde", local_dir="./model")
    PY

    Expected result: ./model contains both weight shards, config.json, tokenizer files, chat_template.jinja and the weight index from the exact pinned revision.

  2. 2. Verify both weight shards

    Compare the downloaded files with SHA256 values exposed by IBM’s official repository metadata. Stop on any mismatch.

    Command
    cd "$HOME/granite4-h-micro-hosting"
    sha256sum --check <<'SHA256'
    883f134c083852597a3033cfc7de8357acde530b3fe941a567f507431f5c9216  model/model-00001-of-00002.safetensors
    987e8aee10c40446c71f4c91d689672f1805f94712738f7a44d06a7dee5e787f  model/model-00002-of-00002.safetensors
    SHA256

    Expected result: Both weight files report OK.

Configure

  1. 1. Create a private local service key

    Run on the GPU host. This writes a fresh random key only when the file is absent, keeps it mode 600 and exports it without printing it. Treat the key file as private. vLLM API-key checks do not cover every route, so keep the loopback binding used below.

    Command
    cd "$HOME/granite4-h-micro-hosting"
    source .venv/bin/activate
    umask 077
    python - <<'PY'
    import secrets
    from pathlib import Path
    key = Path(".vllm-api-key")
    if not key.exists():
        key.write_text(secrets.token_urlsafe(32))
    key.chmod(0o600)
    PY
    export VLLM_API_KEY="$(cat .vllm-api-key)"

    Expected result: A private .vllm-api-key file exists in the dedicated directory; no secret is printed. The shell environment contains VLLM_API_KEY.

  2. 2. Prepare the private SSH tunnel from your laptop

    After creating the key on the instance, run these commands in a separate laptop terminal. Enter the private-key path and the exact user@host target shown in EC2 Connect. The key is copied over SSH into a private local file; it is not printed. Leave the forwarding command running. Start vLLM in the instance terminal, then use another laptop terminal for clients, loading VLLM_API_KEY from $HOME/.granite4-h-micro-client-api-key. Verify the SSH host fingerprint against your instance connection information.

    Command
    printf 'EC2 private-key path: '
    IFS= read -r GRANITE_SSH_KEY
    printf 'EC2 SSH user@host: '
    IFS= read -r GRANITE_SSH_TARGET
    umask 077
    scp -i "$GRANITE_SSH_KEY" "${GRANITE_SSH_TARGET}:granite4-h-micro-hosting/.vllm-api-key" "$HOME/.granite4-h-micro-client-api-key"
    chmod 600 "$HOME/.granite4-h-micro-client-api-key"
    ssh -i "$GRANITE_SSH_KEY" -N -L 127.0.0.1:8000:127.0.0.1:8000 "$GRANITE_SSH_TARGET"

    Expected result: SSH forwarding stays open. Once vLLM has started, your laptop loopback port 8000 forwards to the instance loopback; EC2 port 8000 remains closed to direct inbound access.

Start the model

  1. 1. Start the private Granite 4.0 H Micro endpoint

    Run the verified local snapshot in a dedicated foreground terminal. The runtime supports the GraniteMoeHybridForCausalLM architecture declared by this checkpoint. Use BF16 weights, one GPU, no weight offload and one active sequence. The 4,096-token limit covers prompt plus output; this is a bounded text-chat setup rather than a test of the advertised 131,072-token maximum. Wait for initialization and pass the checks below before treating the service as usable. Prefix caching disabled; Mamba cache mode none; Triton Mamba backend; BF16 Mamba convolution and SSM state. No separate mamba_ssm package. The vLLM wheel supplies its internal Mamba kernels.

    Command
    cd "$HOME/granite4-h-micro-hosting"
    source .venv/bin/activate
    export VLLM_API_KEY="$(cat .vllm-api-key)"
    vllm serve ./model \
      --served-model-name granite4-h-micro-local \
      --host 127.0.0.1 --port 8000 \
      --dtype bfloat16 --kv-cache-dtype auto \
      --max-model-len 4096 --max-num-seqs 1 \
      --tensor-parallel-size 1 --pipeline-parallel-size 1 \
      --generation-config vllm \
      --no-enable-prefix-caching --mamba-cache-mode none \
      --mamba-backend triton --mamba-cache-dtype bfloat16 --mamba-ssm-cache-dtype bfloat16

    Expected result: The process remains running and announces an HTTP listener on 127.0.0.1:8000 after model initialization. If it exits, use the troubleshooting checks before making any success or performance claim.

Connect to your endpoint

http://127.0.0.1:8000/v1

The service listens only on the EC2 host loopback. On your laptop, set GRANITE_SSH_KEY to your private key file and GRANITE_SSH_TARGET to the user@host target from EC2 Connect. Run ssh -i "$GRANITE_SSH_KEY" -N -L 127.0.0.1:8000:127.0.0.1:8000 "$GRANITE_SSH_TARGET" and leave that tunnel open. Keep EC2 port 8000 closed. Local verification below may run in a second SSH session on the GPU host; laptop clients use the forwarded loopback endpoint and your service key.

Access: loopback. SSH controls remote access. VLLM_API_KEY authenticates /v1, /v2 and /inference paths only; other routes may remain unauthenticated. Loopback binding plus the restricted SSH tunnel is the intended boundary.

Verify the setup

  1. 1. Check the model identity

    Open a second terminal on the same GPU host. Load the local key without displaying it and call the authenticated models endpoint.

    Command
    cd "$HOME/granite4-h-micro-hosting"
    export VLLM_API_KEY="$(cat .vllm-api-key)"
    curl --fail --silent --show-error http://127.0.0.1:8000/v1/models \
      -H "Authorization: Bearer $VLLM_API_KEY"

    Expected result: The JSON response contains the served model id granite4-h-micro-local. The endpoint responds successfully only after startup completes.

  2. 2. Request a short response

    In that second terminal, send a small chat request. This checks response generation; it is not a benchmark and provides no throughput or latency guarantee.

    Command
    curl --fail --silent --show-error http://127.0.0.1:8000/v1/chat/completions \
      -H "Authorization: Bearer $VLLM_API_KEY" \
      -H 'Content-Type: application/json' \
      -d '{"model":"granite4-h-micro-local","messages":[{"role":"user","content":"Explain what a GPU does in one sentence."}],"max_tokens":64,"temperature":0}'

    Expected result: A successful JSON response includes a nonempty choices[0].message.content. Wording varies; no exact answer or speed is guaranteed.

  3. 3. Verify the access boundary

    Check that the listener is only on 127.0.0.1:8000 and that the /v1 route rejects a missing key. For AWS, keep the security group closed to inbound 8000 and use the SSH tunnel for remote access.

    Command
    ss -ltn | grep '127.0.0.1:8000'
    curl --silent --output /dev/null --write-out '%{http_code}\n' http://127.0.0.1:8000/v1/models

    Expected result: The listener is on loopback and the unauthenticated /v1/models request is denied (normally HTTP 401). This denial does not prove that every server path is authenticated.

Performance evidence

No compatible measurement available. Documented support and estimated memory do not establish response speed.

Limits and troubleshooting

  • These are documented instructions assembled from publisher and runtime sources. OpenTools has not executed this configuration or measured its full memory fit, throughput or latency.
  • The frozen catalog API identifier is ibm-granite/granite-4.0-h-micro. IBM also publishes a different granite-4.0-micro checkpoint. This guide deliberately uses H Micro; weights, configuration and memory observations must not be transferred between them.
  • IBM describes H Micro as a 3B instruct model; its configuration combines Mamba and attention layers. vLLM lists its GraniteMoeHybridForCausalLM architecture. An architecture match is documented support, not proof that this exact pinned deployment starts successfully.
  • The publisher config permits 131,072 positions. This recipe sets 4,096 combined prompt and output tokens with one active sequence. Larger context, concurrent users and a different cache policy create different configurations.
  • The verification request checks text generation only. IBM documents tool calling and other uses, but this service recipe does not configure or verify a tool parser, FIM or structured output. Generated answers can be wrong; validate results for the intended task.
  • The runtime wheel is pinned; its dependencies resolve at installation. Save pip freeze with any actual run evidence. The host NVIDIA driver remains an administrator prerequisite.
  • Loopback is reachable by other users on the host. Use a trusted single-user machine. Remote access uses the documented SSH tunnel; a public service requires a separately designed authenticated gateway.
  • The pinned vLLM hybrid implementation requires an aligned Mamba cache when prefix caching is enabled; this basic recipe disables prefix caching and sets Mamba cache mode none. Enabling prefix caching or changing Mamba state precision changes the configuration.
nvidia-smi fails or PyTorch reports CUDA unavailable
Check the physical/virtual GPU and host driver before downloading weights. For the AWS path verify the exact supported G6e AMI. Use a fresh environment and the pinned CUDA 12.9 wheel; do not mix a pre-existing torch installation into it.
Installation or download runs out of disk space
Check the filesystem containing $HOME/granite4-h-micro-hosting and package caches. The model download alone is about 6.39 GB; add space for the environment and runtime files. Resume the same pinned snapshot and repeat all shard checks.
Model loading or runtime initialization runs out of GPU or host memory
Stop other GPU workloads and inspect nvidia-smi. Complete memory fit is unknown. Lowering context, changing precision or moving to different hardware creates a different configuration; do not report that as a successful run of this exact recipe.
Port 8000 is already used
Stop the conflicting service you own or choose another loopback port consistently in the start command, checks and SSH tunnel. Do not expose a public interface to work around a local port conflict.
A /v1 request returns 401
In the client terminal load the same private .vllm-api-key file used by the server and send Authorization: Bearer. Restart the server after deliberately rotating the key.
The AWS tunnel cannot connect
Confirm the EC2 instance is running, SSH is limited to your current address, the private key and user@host target match EC2 Connect, and the vLLM listener is alive on the instance loopback. Keep inbound port 8000 closed.

Stop the model

  1. 1. Stop the model process

    Press Ctrl-C in the terminal running vllm and wait for shutdown. Close any SSH forwarding process with Ctrl-C. Then check from the host terminal that the endpoint no longer answers. Stopping only the process does not stop an EC2 bill.

    Command
    curl --connect-timeout 3 http://127.0.0.1:8000/v1/models

    Expected result: The request cannot connect after the listener has stopped. Confirm no other process has taken the same port before assuming the host is idle.

Uninstall

  1. 1. Remove only this guide’s environment and files

    After stopping the server, preserve any needed outputs, then remove the dedicated $HOME/granite4-h-micro-hosting directory you created, including its virtual environment, downloaded model and private key. Check the path before deleting; do not remove shared model caches or another project. Remove any copied client key as well. The host NVIDIA driver is not removed.

    Command
    deactivate
    unset VLLM_API_KEY

    Expected result: The dedicated directory is removed when you choose to delete it; the shell no longer uses the virtual environment or service key. Shared host configuration remains separate.

Shut down cloud resources

  1. 1. Stop EC2 compute and verify its state

    In EC2, select the exact instance used for this guide, choose Instance state → Stop instance, and wait for the state to become Stopped. Shutting down vLLM or closing SSH alone leaves a running instance billable. Stopping compute does not remove EBS storage charges.

    Expected result: The intended instance is Stopped, not merely stopping or idle; inspect retained EBS volumes and other resources for continuing charges.

  2. 2. Clean up resources when permanently finished

    Preserve needed data first. If the instance is no longer needed, terminate that exact instance in EC2 and verify Terminated. Review attached/preserved EBS volumes, snapshots and allocated addresses and remove only the resources you no longer need. Termination is irreversible; do not use it for a temporary pause.

    Expected result: The instance is Terminated and the billing/resource review accounts for any retained storage, addresses or other services. No zero-cost guarantee is implied.

Sources and verification

Sources checked Oct 16, 2026. Verification source

Related guides

Compare this configuration

Benchmarks

Performance scores for Granite 4.0 Micro across standard benchmarks.

GPQA DiamondArtificial Analysis
33.6%
AIME 2025Artificial Analysis
6%

Pricing

Token pricing for Granite 4.0 Micro API usage.

Input Tokens

$0.02/M

per million tokens

Output Tokens

$0.11/M

per million tokens

Competing Models

Same pricing tier — direct alternatives to Granite 4.0 Micro

Efficiency