Skip to main content

Control cost

Cap and monitor what your DIAL deployment spends on model calls and infrastructure. This guide is the operational hub: it points to the settings that enforce limits, the pipeline that measures spend, and the levers that lower it. It assumes a working deployment with access to config.json and your observability stack.

For why DIAL enforces limits at all, read Usage limits and cost control. This page is how to act on it.

Prerequisites​

  • DIAL Core with edit access to config.json (roles and keys)
  • DIAL Analytics available, to measure spend

Step 1: Enforce limits per role and per key​

The primary cost guardrail is a limit on tokens, cost, and requests, set on roles and API keys in config.json. A user inherits the limits of their role; a per-request or application key can carry its own. Configure these in the dedicated guide:

Apply limits to every role that can reach an expensive model. An unlimited default role is the most common source of runaway spend.

Step 2: Measure spend with DIAL Analytics​

You cannot control what you do not measure. DIAL Analytics ingests DIAL Core request logs into ClickHouse and records per-request token counts and cost, which you read in the DIAL Admin dashboards or in Grafana. Set it up with:

Use the dashboards to find the models, roles, and applications that drive cost, then tighten their limits from Step 1.

Step 3: Alert before the bill, not after​

Add alerts on cost and token-rate metrics so a spike pages you instead of surprising you at month end:

  • Alerting — rules for token-limit exhaustion and cost thresholds

Step 4: Pull the cost levers​

Beyond limits, several settings lower the cost of the same workload:

  • Route to the right model. Use cheaper models for cheaper tasks and reserve premium models for where they pay off. Configure model upstreams and routing in Models configuration.
  • Cache repeated prompt prefixes. Prompt caching cuts the cost of requests that share a large common prefix. See Prompt caching.
  • Right-size infrastructure. Match the managed cache tier and service replica counts to real demand rather than peak guesses; pair with Scale DIAL for load so capacity follows usage down as well as up.

Result​

Every role has a limit that caps its spend, DIAL Analytics shows where money goes, alerts fire before budgets are blown, and routing, caching, and right-sizing reduce the cost of the workload itself.

Further reading​