Config#
relationalai
#class Config(profile: dict)
The Config class is used to provide configurations details to the Model and Provider classes,
allowing you to use RAI without a raiconfig.toml file.
Parameters#
| Name | Type | Description |
|---|---|---|
profile | dict | Dictionary of RAI configuration details. |
Valid Profile Keys#
| Key | Required | Description |
|---|---|---|
"account" | Yes | The Snowflake account name to use. |
"role" | The Snowflake role to use. (Default: "PUBLIC") | |
"warehouse" | Yes | The Snowflake warehouse to use. |
"rai_app_name" | The name of the RAI Native App to use. (Default: "relationalai") | |
"authenticator" | The Snowflake authentication method to use. Must be one of:
| |
"user" | The Snowflake username to use for authentication. | |
"password" | The Snowflake password to use for authentication. | |
"engine" | The name of the RAI engine to use. If missing, an engine of size "engine_size" is created automatically using your Snowflake username as the engine name. | |
"engine_size" | The engine size to use when creating an engine. (Default: "HIGHMEM_X64_S") | |
"debug" | Whether to generate debug logs for use with the RAI debugger. (Default: True) | |
"debug.host" | The host name to use for the RAI debugger. (Default: "localhost") | |
"debug.port" | The port number to use for the RAI debugger. (Default: 8080) |
Methods#
Example#
Use the Config class to use RAI without a raiconfig.toml file, such as in a Snowflake or other cloud notebook environment, or to override configuration details from a raiconfig.toml file:
#import relationalai as rai
# Create a Config object using the default username/password authenticator and
# use it to create a model with a raiconfig.toml file.
cfg = rai.Config({
"user": "<SNOWFLAKE_USER>",
"password": "<SNOWFLAKE_PASSWORD>",
"account": "<SNOWFLAKE_ACCOUNT>",
"role": "<SNOWFLAKE_ROLE>",
"warehouse": "<SNOWFLAKE_WAREHOUSE>",
})
model = rai.Model("MyModel", config=cfg)
# Override the engine_size key from a raiconfig.toml file.
model = rai.Model("MyModel", config=rai.Config({
"engine_size": "HIGHMEM_X64_M",
}))
See the configuration guide for more information on configuring your model’s connection to the RAI Native App.