AiGatewayModelService
laktory.models.resources.databricks.AiGatewayModelService
¤
Bases: AiGatewayModelServiceBase
Databricks AI Gateway model service
Stable, Unity Catalog governed endpoint routing inference requests to one or more destinations (Databricks foundation models, provisioned throughput or external model provider services), with rate limits, fallbacks and inference tables.
Examples:
import io
from laktory import models
service_yaml = '''
parent: schemas/dev.ai
model_service_id: customer_support
comment: Routes customer support requests
config:
routing:
destinations:
- name: primary
destination_type: DESTINATION_TYPE_PAY_PER_TOKEN_FOUNDATION_MODEL
pay_per_token_config:
model: models/system.ai.databricks-gpt-5
traffic_percentage: 100
'''
service = models.resources.databricks.AiGatewayModelService.model_validate_yaml(
io.StringIO(service_yaml)
)
| BASE | DESCRIPTION |
|---|---|
comment
|
User-provided description
TYPE:
|
config
|
Destinations, routing, rate limits, and payload logging configuration. Required on Create. On Update, provide this field when
TYPE:
|
model_service_id
|
Name for the model service, e.g. 'my_model_service'
TYPE:
|
parent
|
Parent Unity Catalog schema where the inference table is created, in the form
TYPE:
|
provider_config
|
Configure the provider for management through account provider
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
inference_table
|
Inference table configuration for payload logging
TYPE:
|
rate_limits
|
Rate limits applied to requests routed through this model service
TYPE:
|
routing
|
Routing configuration: destinations and fallback
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigInferenceTable
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
parent
|
Parent Unity Catalog schema where the inference table is created, in the form
TYPE:
|
table_name_prefix
|
Prefix used to form the inference table's registered name. AI Gateway appends
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRateLimits
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
key
|
Scope of the rate limit. Depending on this value, the limit applies to a principal, the service as a whole, or each user by default. Possible values are:
TYPE:
|
principal
|
Principal this limit applies to: user email, group name, or service principal application ID. Required when
TYPE:
|
renewal_period
|
Renewal period. Possible values are:
TYPE:
|
requests
|
Maximum requests allowed in one renewal period. Leave unset for no request limit. Set to
TYPE:
|
tokens
|
Maximum tokens allowed in one renewal period. Leave unset for no token limit. Set to
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRouting
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
destinations
|
Primary routing destinations. At most 10 are allowed. At least one is required on Create. On Update, provide this list when replacing the full
TYPE:
|
fallback
|
Fallback routing applied after a primary destination fails. Fallback destinations are tried in the listed order
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRoutingDestinations
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
destination_type
|
Backing-model category. Provide the matching type-specific configuration and leave the other type-specific configurations unset. Possible values are:
TYPE:
|
external_model_config
|
Configuration for an external model reached through a model provider service
TYPE:
|
name
|
Resource name of the model service. Format:
TYPE:
|
pay_per_token_config
|
Configuration for a pay-per-token Databricks foundation model
TYPE:
|
provisioned_throughput_config
|
Configuration for a provisioned-throughput Databricks foundation model
TYPE:
|
traffic_percentage
|
Percentage of primary traffic sent to this destination, from 0 to 100. Required when there is more than one primary destination, in which case the primary percentages must sum to 100; a single primary destination receives all traffic. Fallback destinations are ordered and do not use this field
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRoutingDestinationsExternalModelConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
model_provider_service
|
Resource name of the governed ModelProviderService that owns provider auth and provider-specific configuration. The referenced ModelProviderService also carries the provider type, so this message does not surface it directly. Format:
TYPE:
|
target
|
Routing target for the destination: the provider-side model selected from the referenced ModelProviderService's
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRoutingDestinationsExternalModelConfigTarget
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
model
|
UC model FQN of the model served by the backing endpoint (e.g.,
TYPE:
|
native_api_types
|
Provider-native API types supported by this model, such as
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRoutingDestinationsPayPerTokenConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
model
|
UC model FQN of the model served by the backing endpoint (e.g.,
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRoutingDestinationsProvisionedThroughputConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
model_serving_endpoint
|
Name of the backing Model Serving endpoint serving the provisioned- throughput foundation model, in the form
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRoutingFallback
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
destinations
|
Primary routing destinations. At most 10 are allowed. At least one is required on Create. On Update, provide this list when replacing the full
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRoutingFallbackDestinations
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
destination_type
|
Backing-model category. Provide the matching type-specific configuration and leave the other type-specific configurations unset. Possible values are:
TYPE:
|
external_model_config
|
Configuration for an external model reached through a model provider service
TYPE:
|
name
|
Resource name of the model service. Format:
TYPE:
|
pay_per_token_config
|
Configuration for a pay-per-token Databricks foundation model
TYPE:
|
provisioned_throughput_config
|
Configuration for a provisioned-throughput Databricks foundation model
TYPE:
|
traffic_percentage
|
Percentage of primary traffic sent to this destination, from 0 to 100. Required when there is more than one primary destination, in which case the primary percentages must sum to 100; a single primary destination receives all traffic. Fallback destinations are ordered and do not use this field
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRoutingFallbackDestinationsExternalModelConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
model_provider_service
|
Resource name of the governed ModelProviderService that owns provider auth and provider-specific configuration. The referenced ModelProviderService also carries the provider type, so this message does not surface it directly. Format:
TYPE:
|
target
|
Routing target for the destination: the provider-side model selected from the referenced ModelProviderService's
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRoutingFallbackDestinationsExternalModelConfigTarget
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
model
|
UC model FQN of the model served by the backing endpoint (e.g.,
TYPE:
|
native_api_types
|
Provider-native API types supported by this model, such as
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRoutingFallbackDestinationsPayPerTokenConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
model
|
UC model FQN of the model served by the backing endpoint (e.g.,
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceConfigRoutingFallbackDestinationsProvisionedThroughputConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
model_serving_endpoint
|
Name of the backing Model Serving endpoint serving the provisioned- throughput foundation model, in the form
TYPE:
|
laktory.models.resources.databricks.aigatewaymodelservice.AiGatewayModelServiceProviderConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
workspace_id
|
Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with
TYPE:
|