Resource budgets for Snowflake Intelligence¶
A resource budget lets you monitor Snowflake Intelligence spend for your account and take actions when it exceeds spending thresholds. This allows you to control costs for Snowflake Intelligence and take automated actions such as revoking access when spending exceeds your configured limits. Resource budgets give you control over the credits consumed at an aggregated level by the entire Snowflake Intelligence service.
How resource budgets work¶
Resource budgets use Snowflake’s tag-based cost attribution model. You create a tag, apply it to a Snowflake Intelligence object, and then associate that tag with a budget. Snowflake tracks credit consumption for the tagged object and evaluates spending against the budget limit periodically. The resource budget is useful for limiting the spend for Snowflake Intelligence aggregated across the entire account.
Snowflake enforces resource budgets with the following flow:
You create a tag
You apply the tag to the Snowflake Intelligence object.
You create a budget and specify the tag to track spending for. As part of creating the budget, you also set a monthly spending limit in credits.
You add a stored procedure to be executed when spending reaches a configured threshold of the budget. For example, you can invoke a stored procedure for alerting at 80% and another stored procedure for revoking access at 100%.
Snowflake tracks credit consumption for the tagged object.
When spending reaches a configured threshold of the budget, such as 80% or 100%, Snowflake executes the stored procedure defined for that threshold.
Snowflake calculates usage, evaluates thresholds, and triggers any configured actions periodically. After the budget is exceeded, it might take up to eight hours for the budget to be enforced.
Create a tag¶
Create a tag to identify the cost center associated with the Snowflake Intelligence object:
Apply the tag to the Snowflake Intelligence object to associate it with a cost center:
Set up a resource budget¶
You can use either Snowsight or SQL to create a budget and associate it with a Snowflake Intelligence object.
Sign in to Snowsight.
In the navigation menu, select Admin » Cost management.
Select Budgets.
Select + Budget.
For Location to store, select the name of the database and schema where you want to create the budget.
For Name, use
my_budget.For Budget (credits per month), enter 10000 for the spending limit of the budget.
To decrease the budget refresh interval so you can watch spending more closely, select Enable low latency budget.
For Threshold, enter 80 for the notification threshold.
For Notify, enter email addresses to receive notification emails.
Select Next.
For Budget scope, add the tag on the Snowflake Intelligence object to the resource budget.
Select Create.
Create a budget instance in the schema where you manage budgets:
Set the monthly credit spending limit, such as 10000, for the budget:
Add the tag to the budget so that Snowflake tracks spending for the tagged object against this budget:
Now, Snowflake tracks credit consumption for si_instance_1 against the my_budget budget
with a 10,000-credit monthly limit.
Configure threshold actions¶
You can attach stored procedures that are executed when spending reaches specific thresholds, which are expressed as a percentage of the spending limit and apply to the monthly budget period. For more information, see Custom actions for budgets.
Send notifications¶
You can send notifications when spending reaches a threshold. For more information, see Notifications for budgets.
Set the email to send notifications to:
Set the notification threshold:
Revoke access¶
Create a stored procedure that revokes access to Snowflake Intelligence. In the stored procedure, you can limit access to a specific role to revoke USAGE for that role.
Important
Ensure the
role_nameand the user do not have access to Snowflake Intelligence through other roles. For guidance about configuring roles and privileges correctly, see User privileges and access control.Set a custom action that blocks access when 100% of the budget has been spent:
Note
You can also use custom actions for notifications or to take action when spending is forecasted to exceed the budget limit. For more information, see Custom actions for budgets.
Handling exceptions to spending limits¶
In some cases, you need to reinstate access after the budget limit is reached, like during earnings season or other peak periods. You can configure thresholds beyond 100%, up to 500%, to handle these exception scenarios.
The workflow assumes that access is revoked using the configured stored procedure when spending reaches a budget threshold. In the following example, access has been revoked after spending reaches the 100% threshold. The admin reinstates a subset of the users and grants access back. When spending reaches 200%, the revocation procedure runs again as a hard stop.
Create a stored procedure to reinstate access to the role:
Configure a threshold beyond 100% with a stored procedure that reinstates access. This allows you to raise the effective budget for exception periods. Access is revoked again when spending reaches 200% of the budget:
Reinstate access¶
To ensure that users can access Snowflake Intelligence again at the start of the next budget period, set the following stored procedure to be called when the budget cycle restarts.
Create a stored procedure to reinstate access to the role:
Set a cycle-start action for the budget:
Setting alerts based on projected spend¶
To receive an alert or perform an action based on forecasted spend rather than actual spend, you can set the trigger type to PROJECTED. For example, to call a stored procedure named alert_team when projected consumption reaches 75% of the budget limit, run the following command:
List custom actions¶
To list all custom actions configured on a budget, use the GET_CUSTOM_ACTIONS method:
For more information, see Custom actions for budgets.
Monitor usage¶
To view credit consumption per Snowflake Intelligence object, use the budget’s usage reporting method:
The output includes the following columns:
Column
Description
Service type
The service category (AI)
Entity type
The object type (SI)
Entity ID
The unique identifier of the Snowflake Intelligence object
Name
The display name of the Snowflake Intelligence object
Credits used
The total credits consumed during the specified period
Credits Cloud
Number of cloud service credits used
Budget enforcement latency¶
Budget calculations and threshold enforcement are conducted periodically:
Snowflake calculates credit consumption for the tagged Snowflake Intelligence object.
The system evaluates spending against all configured thresholds.
If a threshold is reached, the associated stored procedure is executed.
Usage dashboards are updated with the latest figures.
If the low latency budget is enabled, the budgets are enforced in two hours after the budget is exceeded. Otherwise, it may take up to eight hours after the budget is exceeded for enforcement. To reduce the refresh interval, you can trigger budget execution more frequently, such as every 60 minutes.
Warning
There is an inherent delay between when credits are consumed and when the budget system detects the threshold breach. During the enforcement interval, spending can exceed the configured threshold before the action is executed. Plan your thresholds accordingly. For example, set an alert at 80% to give you time to respond before the 100% action is triggered.
Limitations¶
The following limitations apply to resource budgets for Snowflake Intelligence:
Single-team resources only: Resource budgets apply to the entire Snowflake Intelligence object.
Enforcement latency: Budget enforcement runs on a periodic cycle and may take up to eight hours to enforce the budget after the budget is exceeded. Spending can exceed a threshold during the interval before the action triggers.
Role-based access revocation: To revoke access at a threshold, you must create a dedicated role for the Snowflake Intelligence object. Direct block actions on the object aren’t yet supported.
Monthly period: Budgets operate on a monthly cycle. You can’t configure resource budget periods.
Tag latency: When you change a tag on an object, it can take up to eight hours after the change to be reflected in budgets that use tags. For more information, see Custom budgets.