create_engine()#

relationalai.api
create_engine(<engine_name>, <compute_pool_name>, <engine_size>[, <external_integrations>])

Creates a new RelationalAI (RAI) engine within the specified compute pool on Snowpark Container Services. The engine’s size must match the INSTANCE_FAMILY of the compute pool. Requires the eng_admin application role.

Parameters#

NameTypeDescription
<engine_name>STRINGThe name of the engine (case-sensitive).
<compute_pool_name>STRINGThe name of the compute pool that hosts the engine. Must be accessible to the RAI Native App. Supported INSTANCE_FAMILY values are:
- HIGHMEM_X64_S
- HIGHMEM_X64_M
<engine_size>STRINGThe size of the engine. Must be one of the following values:
- "HighMem|S" for compute pools with INSTANCE_FAMILY set to HIGHMEM_X64_S.
- "HighMem|M" for compute pools with INSTANCE_FAMILY set to HIGHMEM_X64_M.
<external_integrations>ARRAY(Optional) An array of external access integrations to enable on the engine.

Example#

Use create_engine() to create a new RAI engine. Ensure the compute pool’s INSTANCE_FAMILY is set to HIGHMEM_X64_S or HIGHMEM_X64_M. The engine’s size must match the compute pool’s INSTANCE_FAMILY, and the native app needs USAGE and MONITOR privileges on the compute pool.

For example, to create a new engine named my_rai_engine in a compute pool named rai_engine_pool_s with size HighMem|S:

-- Create a compute pool, if needed.
CREATE COMPUTE POOL IF NOT EXISTS rai_engine_pool_s
    FOR APPLICATION relationalai
    MIN_NODES = 1
    MAX_NODES = 10
    AUTO_RESUME = TRUE
    AUTO_SUSPEND_SECS = 300
    INSTANCE_FAMILY = HIGHMEM_X64_S;
GRANT USAGE, MONITOR ON COMPUTE POOL rai_engine_pool_s TO APPLICATION relationalai;

-- Create an engine.
CALL relationalai.api.create_engine('my_rai_engine', 'rai_engine_pool_s', 'HighMem|S');

Adjusting the AUTO_SUSPEND_SECS parameter helps balance cost control with availability for engine provisioning. See Cost Management for details on how costs are accrued. Refer to Performance Considerations for more information on engine sizing and how concurrent workloads are handled.

If the engine needs to access external resources, such as AWS S3 or Azure Blob Storage, specify the external integrations to enable on the engine:

CALL relationalai.api.create_engine(
    'my_rai_engine',
    'rai_engine_pool_s',
    'HighMem|S',
    -- Enable existing external integration 'my_external_integration' on the engine.
    ARRAY_CONSTRUCT('my_external_integration')
);

See the Snowflake documentation for more information on creating and using external access integrations.

See Also#