TEXT
).
To use the function, provide the model identifier, the request body as serialized JSON, and a LOCATION
that holds AWS credentials.
For setup guidance and end-to-end examples, see Getting started with AI.
Syntax
Parameters
Parameter | Description | Supported input types |
---|---|---|
<model> | The model to invoke. Use a Bedrock model identifier (for example, 'amazon.nova-lite-v1:0' , 'meta.llama3-3-70b-instruct-v1:0' ). The value is forwarded to Bedrock without validation. | TEXT |
<request> | The request body as a serialized JSON string. The structure and fields must follow the syntax for the selected model. | TEXT |
<location> | The name of the LOCATION to use for AWS credentials. Must be a literal constant. See CREATE LOCATION (Amazon Bedrock). | TEXT |
<null_on_error> | Optional. Whether to return NULL instead of raising an error when a Bedrock invocation error occurs. Default FALSE . Must be a literal constant. | BOOL |
Make sure the
request
JSON matches the syntax required by the model you select. See the Amazon Bedrock model parameters documentation for details.Return Type
TEXT
- Returns the raw Bedrock response payload as a JSON string.
- If
<request>
isNULL
, the function returnsNULL
.
LLM Token Budget
The daily LLM token budget for each account is governed by theALTER ACCOUNT SET LLM_TOKEN_BUDGET
command. If your account exceeds its allotted token budget, invocations of AWS_BEDROCK_AI_QUERY
will fail until the budget is increased or the daily limit resets. The current limit and daily usage of the LLM token budget can be viewed in information_schema.quotas.
Counting tokens is done in a “best effort” manner. Some models provide the token count in the response, while others don’t. For those that don’t Firebolt estimates the token count. Supported model list:
Model ID substring | Token count support |
---|---|
amazon.nova | Accurate |
amazon.titan | Accurate |
anthropic.claude | Accurate |
cohere.command | Estimated |
cohere-command-r | Accurate |
deepseek | Estimated |
meta.llama | Accurate |
mistral | Estimated |
LLM token budget accounting is not available in Firebolt Core.
Examples
Create a LOCATION with role ARN
Invoke a model using the LOCATION
Invoking the LLM on multiple values
number | processed |
---|---|
1 | ’ONE’ |
2 | ’TWO’ |
3 | ’THREE’ |
Sentiment analysis
Check your LLM token quota usage
LLM_TOKEN_BUDGET
row to view current usage and limits.