> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thinkplatform.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Choose User guide for browser tasks, Developers for CLI, SDK and external agents, and Administration for organization management.
> Confirm identity and organization/project context before operations. Documentation access does not grant ThinkPlatform permissions.
> Review side effects, verify changes with a read, and do not blindly retry an operation with an uncertain outcome.
> Use documented UI steps for the web app and documented public CLI or SDK interfaces for automation. Follow each page’s prerequisites and authentication requirements.

# Lakehouse cost model

> Reconcile billing and usage data, calculate cost metrics, and avoid double counting.

## Source order

1. Azure workspace plus managed resource group ActualCost for financial totals.
2. Databricks `system.billing` usage for DBU, SKU, billing-origin product, and workload attribution.
3. Billing custom tags and Job/resource tags for project allocation; ThinkPlatform Query Tags, Query History, and run metadata for recent cause attribution.
4. Duration, scan bytes, rows, and run counts as diagnostic proxies when direct allocation is unavailable.

Do not sum ActualCost and DBU list-price cost. List price is a diagnostic reference, not an additional charge.

## Reconciliation

Keep these buckets separate:

* `exact`: billing usage directly tagged or uniquely mapped to a project/workload. Do not present a proportional share of financial ActualCost as exact.
* `estimated`: project ActualCost allocated by that project's `system.billing` custom-tagged list cost divided by total list cost for the same period.
* `unallocated`: cost that cannot be mapped safely.

Report backend allocation coverage as custom-tagged list cost divided by total list cost for the same billing period, with currency and source timestamps. Never force coverage to 100% by spreading unallocated cost.

Managed-resource-group resources can include compute, networking, storage, and related services. Attribute them only when resource tags or a documented mapping support the link.

## Useful metrics

* Daily cost and seven-day moving average.
* DBU and ActualCost by SKU, billing-origin product, workload, Warehouse, and Job.
* Warehouse active minutes, idle tail after the last query, starts, and queries per active minute.
* Query count, distinct SQL hashes, cache-hit ratio, failure ratio, p95 duration, and scan bytes.
* Job attempted/successful runs, retries, success rate, p95 duration, and cost per successful run.
* Cost per successful output row only when output counts are reliable.

Handle zero denominators and partial periods explicitly.

An unavailable project allocation must be represented as `null`/unknown, not zero. Keep confirmed workload counts and observation coverage together; a zero count with incomplete Job task data is only a lower bound.

## Timing and confidence

* Recent Azure ActualCost or `system.billing` rows can be delayed or corrected. Mark incomplete days.
* A `system.billing` read can start the configured SQL Warehouse even though it is non-mutating. Prefer cached overviews and avoid concurrent forced refreshes.
* Query History is better for current behavior but is not the financial ledger.
* Query Tags provide a strong recent shared-Warehouse activity signal, but do not become `system.billing.custom_tags` and therefore do not allocate financial cost by themselves.
* A Warehouse tag identifies ownership/configuration, not which project caused every shared query.
* Job tags and IDs can support exact allocation only when their lifecycle and project mapping are authoritative.

Use `high`, `medium`, or `low` confidence for each finding and explain the limiting evidence.

## Double-count prevention

Databricks AI Functions can cause both Lakehouse compute/AI service cost and LLM-like usage. Keep this report scoped to costs returned by Lakehouse/Azure billing sources. Do not merge it into ThinkPlatform Agent/LLM provider totals unless the billing source proves the charges are distinct.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.