Using budgets for AI features (shared resources)

A shared resource is a Snowflake resource that is used by more than one business unit or team. AI features (such as AI Functions, Snowflake Intelligence, Cortex Agents, and Cortex Code) are examples of shared resources. You can add these resources to a budget and configure the budget so that credits consumed by them count toward the budget’s spending limit only when selected users consume those credits. This enables tracking and controlling usage across different teams or cost centers.

For example, suppose multiple teams use the same AI function. You can track consumption for each of the teams in separate budgets based on which users are calling the function — one budget for engineering users and another for finance users.

Workflow for tracking consumption by shared resources

Tracking consumption by a shared resource based on the user who is using the resource consists of the following workflow:

  1. Apply a tag-value pair to a user who uses the shared resource.

  2. Add to the budget the tag-value pair that you applied to the user.

  3. Add the shared resource to the budget.

Apply a tag to a user

A tag is a schema-level object that can be applied to another object. When you apply a tag to an object, you can set the tag to a value, thereby creating a tag-value pair.

You can group users into logical units such as cost centers by applying the same tag-value pair to each of the users. The first step in tracking consumption of shared resources is to apply a tag-value pair to every user that belongs to a unit. You can then use a budget to track consumption by these users while ignoring the consumption of the same shared resource by other users.

Use the ALTER USER command to apply a tag to users. Suppose you use the cost_center tag to identify cost centers within your organization, and that the user joe belongs to the cost center finance. To apply the correct tag-value pair to the user, run the following command:

ALTER USER joe SET TAG cost_management.tags.cost_center = 'FINANCE';

Add the user tag to the budget

After tagging all users in the logical unit, you must add the tag-value pair to the budget so it can track consumption by the users. Use the SET_USER_TAGS method to add the tag to the budget.

In the following example, when a shared resource consumes credits, the finance_budget budget will only track consumption by users with the cost_center = 'FINANCE' tag-value pair.

CALL finance_budget!SET_USER_TAGS(
  [
    [(SELECT SYSTEM$REFERENCE('TAG', 'COST_MANAGEMENT.TAGS.COST_CENTER', 'SESSION', 'APPLYBUDGET')),
    'FINANCE']
  ],
  'UNION');

The SET_USER_TAGS method lets you add all of your user tags to the budget at once. It also lets you configure the budget so that usage is included if a user is tagged with any of the user tags (UNION) or configure it so usage is included only if the user is tagged with all of the user tags (INTERSECTION).

In the following example, the my_budget budget tracks consumption when shared resources are acted upon by users tagged with both the tag-value combination cost_center = 'sales' and the tag-value combination project = 'phoenix'.

CALL budget_db.budget_schema.my_budget!SET_USER_TAGS(
  [
    [(SELECT SYSTEM$REFERENCE('TAG', 'cost_mgmt_db.tags.cost_center', 'SESSION', 'APPLYBUDGET')), 'SALES'],
    [(SELECT SYSTEM$REFERENCE('TAG', 'cost_mgmt_db.tags.project', 'SESSION', 'APPLYBUDGET')), 'PHOENIX']
  ],
  'INTERSECTION');

To verify the results of the method, call the GET_BUDGET_SCOPE method.

Add AI features (shared resources) to a budget

After you have configured the users who are using AI features, you must specify which of these features will be tracked by the budget. Use the ADD_SHARED_RESOURCE method to add an AI feature to the budget.

Supported AI feature domains include:

  • AI FUNCTION — Model inference functions

  • CORTEX CODE — Cortex Code workloads (CLI, Snowsight)

  • CORTEX AGENT — Cortex agent-based workflows (domain-level only)

  • SNOWFLAKE INTELLIGENCE — Snowflake Intelligence workloads (domain-level only)

Tip

You can use the SYSTEM$SHOW_BUDGET_SHARED_RESOURCE_CANDIDATES function to return a list of resources that can be added as shared resources to a budget.

Example: Add all AI functions to the budget

CALL finance_budget!ADD_SHARED_RESOURCE('AI FUNCTION');

 

Example: Add the AI_CLASSIFY function to the budget

CALL finance_budget!ADD_SHARED_RESOURCE('AI FUNCTION', 'AI_CLASSIFY');

Creating a budget for AI workloads in Snowsight

You can create and configure budgets for AI workloads directly in Snowsight using a guided user interface.

Note

Using tags to define the scope of a budget is required for shared resources such as AI workloads.

  1. Sign in to Snowsight.

  2. In the navigation menu, select Admin » Cost management.

  3. Select the Budgets tab.

  4. Select + Budget on the top right corner.

  5. On the Basic Information page, complete the required fields.

  6. On the Budget scope page, add the objects that you want to include in the budget.

  7. For setting budgets on AI features (shared resources), move to the Budgets Scope page and update as follows.

    In the Tags on users section:

    • Search for and select relevant tags (for example, cost center or team).

    • This enables tracking activity for tagged users, which is required when monitoring shared resources.

    • Select AI resources to monitor.

    In the Select resources to monitor section, enable one or more of the following:

    • AI Functions

    • Cortex Code

    • Cortex Agents

    • Snowflake Intelligence

  8. Configure AI Functions.

    • By default, all AI functions are selected, and future AI functions are automatically included.

    • You can also choose to selectively choose specific functions (for example, AI_CLASSIFY, AI_COMPLETE). For a complete list, see Snowflake Cortex AI Functions (including LLM functions).

  9. Configure Cortex Code.

    • By default, future Cortex Code interfaces are automatically included.

    • You can also choose to select specific instances (for example, CLI, Snowsight).

  10. Configure domain-level resources.

    • Cortex Agents and Snowflake Intelligence can be selected only at the domain level.

  11. Review your selections.

    Confirm that the correct resources are selected, ensure that any selected tags correctly reflect the intended scope.

  12. Complete the remaining configuration and click Create

Note

  • AI workloads are tracked as shared resources and are attributed based on user activity and applied tags.

  • Selecting All (auto) ensures that new instances for the domain are automatically included as they become available.

Limitations and considerations

  • For AI functions, the budget tracks the AI_SERVICES service type.