# Infrastructure

Owned, rented and dedicated inference: observed and modelled cost per deployment, beside a hosted model.

AI Spendbook documentation, Finance. Web page: https://www.aispendbook.com/docs/infrastructure

The infrastructure page is for inference you run yourself: a rented cloud GPU, a dedicated endpoint, or hardware you own. For each deployment it shows what it cost, what it served, and what the same tokens would cost on a hosted model. Every figure is labelled **observed** or **modelled**.

## Deployments

- A deployment has a name, a kind (cloud GPU, owned hardware or dedicated endpoint) and the model ids it serves, written as they appear in your telemetry.
- Cloud GPU and dedicated endpoint: an hourly rate and hours per day.
- Owned hardware: purchase price, useful life in months and in-service date, and optionally power draw in watts, hours per day and an electricity price per kWh.
- Optional: a capacity (maximum requests or tokens per hour), and a hosted provider and model to compare with.
- Every input you enter is shown on the report as a configured assumption.

Every member can read the page. Admins create, edit and delete deployments and record costs.

## Observed cost

- Daily cost records for a deployment, entered by hand or uploaded as CSV or JSON with a date column and a US dollar amount column. Rows for one day are summed, and a later write for a day replaces the earlier one.
- [Cost lines](https://www.aispendbook.com/docs/outcomes-and-unit-costs) of kind infrastructure whose source equals the deployment's cost line source. Infrastructure cost lines that match no deployment are reported as unassigned and counted on none.
- Cost lines written by the cloud and GPU connectors: [AWS CUR](https://www.aispendbook.com/integrations/aws-cur) (`eks:<cluster>` or `ec2:<instance type>`), the [Google](https://www.aispendbook.com/integrations/google) GPU option (`gke:<cluster>` or `gce_gpu:<project>`), [RunPod](https://www.aispendbook.com/integrations/runpod), [Baseten](https://www.aispendbook.com/integrations/baseten) and [Crusoe](https://www.aispendbook.com/integrations/crusoe). Set the deployment's cost line source to the source the connector writes. GPU clouds without a billing API (Lambda, Modal) are a daily CSV upload. For CoreWeave, upload or forward its PDF invoice and set the deployment's cost line source to `coreweave`; the amount before tax is spread evenly over the service period. See [cloud and GPU billing](https://www.aispendbook.com/docs/cloud-billing-exports).

## Modelled cost

```text
depreciation = purchase price x days in range / days of useful life
electricity  = watts / 1000 x hours per day x days x price per kWh
rate x hours = hourly rate x hours per day x days without an observed cost
total        = observed + depreciation + electricity + rate x hours
```

- Depreciation is straight-line by day, from the in-service date to the end of the useful life.
- For a cloud GPU or dedicated endpoint, the hourly rate is used only on days that have no observed cost.
- A total that includes any modelled cost is labelled modelled.

## What it served

- Requests and tokens are observed in request telemetry for the deployment's models. Tokens are input, output, cache read and cache write.
- Cost per request and cost per million tokens are the total divided by those counts. With no telemetry for the models in the range, they are not defined.
- Where a deployment serves several models, its cost is one amount. The split across models is by token share. It is an allocation, not a measurement.
- A model listed on more than one deployment has its telemetry counted on each, and the report says so.
- Idle share is 1 minus served divided by capacity, where capacity is the configured maximum per hour times hours per day times days. It is unknown when no capacity is configured.
- With a utilisation key on the deployment, and a [NVIDIA DCGM](https://www.aispendbook.com/integrations/prometheus-dcgm), [Kubecost](https://www.aispendbook.com/integrations/kubecost) or [OpenCost](https://www.aispendbook.com/integrations/opencost) connection measuring that key, the idle share is measured instead (1 minus the GPU-hour weighted busy share) and labelled observed. A busy GPU means a kernel was running, not how fully it was used.

## Hosted comparison

- The same tokens are priced on the hosted model you named, at the prices in effect on the last day of the range.
- The difference is the deployment total minus the hosted cost. A positive difference means hosting would have cost less.
- It is a modelled estimate. It ignores quality and latency, and it is empty when the hosted model cannot be priced.

Infrastructure cost is shown on this page. It is not added to provider spend.
