---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/transformers_js/helpers/functions/probeGpuBudget.md
---

# Function: probeGpuBudget()

```ts
function probeGpuBudget(nav?: NavigatorGpuLike): Promise<GpuBudget>;
```

Defined in: [src/batteries/llm/chat\_common/gpu\_budget.ts:108](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/llm/chat_common/gpu_budget.ts#L108)

Probe the host WebGPU device for its memory budget (per-allocation ceilings + adapter info).

## Parameters

| Parameter | Type               | Description                                                                       |
| --------- | ------------------ | --------------------------------------------------------------------------------- |
| `nav?`    | `NavigatorGpuLike` | Injectable `navigator`-like object for tests; defaults to the global `navigator`. |

## Returns

`Promise`<[`GpuBudget`](../interfaces/GpuBudget.md)>

The [GpuBudget](../interfaces/GpuBudget.md) snapshot.

## Remarks

Reads `navigator.gpu` adapter limits — this is OBSERVABILITY ONLY; it allocates nothing and changes
no behavior. Returns `{ available: false }` (with zeroed sizes) when WebGPU is absent (Node, a
browser without the API, or a refused adapter) so callers can branch without try/catch. Best-effort
and never throws. A battery emits the result through its lifecycle hook so the application can show
"you have ~N GiB of GPU budget" and let the user choose a context window accordingly.
