ModelServing
laktory.models.resources.databricks.ModelServing
¤
Bases: ModelServingBase
Databricks model serving endpoint
Examples:
import io
from laktory import models
model_serving_yaml = '''
name: my-endpoint
config:
served_entities:
- entity_name: my-catalog.my_schema.my_model
entity_version: "1"
workload_size: Small
scale_to_zero_enabled: true
access_controls:
- group_name: role-engineers
permission_level: CAN_QUERY
'''
model_serving = models.resources.databricks.ModelServing.model_validate_yaml(
io.StringIO(model_serving_yaml)
)
References
| BASE | DESCRIPTION |
|---|---|
ai_gateway
|
A block with AI Gateway configuration for the serving endpoint. Note: only external model endpoints are supported as of now.
TYPE:
|
budget_policy_id
|
(Optiona) The Budget Policy ID set for this serving endpoint
TYPE:
|
config
|
The config for the external model, which must match the provider. Note that API keys could be provided either as a reference to the Databricks Secret (parameters without
TYPE:
|
description
|
The description of the model serving endpoint
TYPE:
|
email_notifications
|
A block with Email notification setting
TYPE:
|
name
|
The name of a served model. It must be unique across an endpoint. If not specified, this field will default to
TYPE:
|
rate_limits
|
Block describing rate limits for AI gateway. For details see the description of
TYPE:
|
route_optimized
|
A boolean enabling route optimization for the endpoint. Note: only available for custom models.
TYPE:
|
tags
|
Tags to be attached to the serving endpoint and automatically propagated to billing logs
TYPE:
|
telemetry_config
|
TYPE:
|
timeouts
|
TYPE:
|
| LAKTORY | DESCRIPTION |
|---|---|
access_controls
|
List of access controls
TYPE:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
additional_core_resources |
TYPE:
|
additional_core_resources
property
¤
- permissions
laktory.models.resources.databricks.modelserving.ModelServingAiGateway
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
fallback_config
|
block with configuration for traffic fallback which auto fallbacks to other served entities if the request to a served entity fails with certain error codes, to increase availability
TYPE:
|
guardrails
|
Block with configuration for AI Guardrails to prevent unwanted data and unsafe data in requests and responses. Consists of the following attributes:
TYPE:
|
inference_table_config
|
Block describing the configuration of usage tracking. Consists of the following attributes:
TYPE:
|
rate_limits
|
Block describing rate limits for AI gateway. For details see the description of
TYPE:
|
usage_tracking_config
|
Block with configuration for payload logging using inference tables. For details see the description of
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingAiGatewayFallbackConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
enabled
|
boolean flag specifying if usage tracking is enabled
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingAiGatewayGuardrails
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
input
|
A block with configuration for input guardrail filters:
TYPE:
|
output
|
A block with configuration for output guardrail filters. Has the same structure as
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingAiGatewayGuardrailsInput
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
invalid_keywords
|
(Deprecated) List of invalid keywords. AI guardrail uses keyword or string matching to decide if the keyword exists in the request or response content
TYPE:
|
pii
|
Block with configuration for guardrail PII filter:
TYPE:
|
safety
|
the boolean flag that indicates whether the safety filter is enabled
TYPE:
|
valid_topics
|
(Deprecated) The list of allowed topics. Given a chat request, this guardrail flags the request if its topic is not in the allowed topics
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingAiGatewayGuardrailsInputPii
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
behavior
|
a string that describes the behavior for PII filter. Currently only
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingAiGatewayGuardrailsOutput
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
invalid_keywords
|
(Deprecated) List of invalid keywords. AI guardrail uses keyword or string matching to decide if the keyword exists in the request or response content
TYPE:
|
pii
|
Block with configuration for guardrail PII filter:
TYPE:
|
safety
|
the boolean flag that indicates whether the safety filter is enabled
TYPE:
|
valid_topics
|
(Deprecated) The list of allowed topics. Given a chat request, this guardrail flags the request if its topic is not in the allowed topics
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingAiGatewayGuardrailsOutputPii
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
behavior
|
a string that describes the behavior for PII filter. Currently only
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingAiGatewayInferenceTableConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
catalog_name
|
The name of the catalog in Unity Catalog. NOTE: On update, you cannot change the catalog name if it was already set
TYPE:
|
enabled
|
boolean flag specifying if usage tracking is enabled
TYPE:
|
schema_name
|
The name of the schema in Unity Catalog. NOTE: On update, you cannot change the schema name if it was already set
TYPE:
|
table_name_prefix
|
The prefix of the table in Unity Catalog. NOTE: On update, you cannot change the prefix name if it was already set
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingAiGatewayRateLimits
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
calls
|
Used to specify how many calls are allowed for a key within the renewal_period
TYPE:
|
key
|
Key field for a serving endpoint rate limit. Currently,
TYPE:
|
principal
|
Principal field for a user, user group, or service principal to apply rate limiting to. Accepts a user email, group name, or service principal application ID
TYPE:
|
renewal_period
|
Renewal period field for a serving endpoint rate limit. Currently, only
TYPE:
|
tokens
|
Specifies how many tokens are allowed for a key within the renewal_period
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingAiGatewayUsageTrackingConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
enabled
|
boolean flag specifying if usage tracking is enabled
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
auto_capture_config
|
Configuration for Inference Tables which automatically logs requests and responses to Unity Catalog
TYPE:
|
served_entities
|
A list of served entities for the endpoint to serve. A serving endpoint can have up to 10 served entities
TYPE:
|
served_models
|
(Deprecated, use
TYPE:
|
traffic_config
|
A single block represents the traffic split configuration amongst the served models
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigAutoCaptureConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
catalog_name
|
The name of the catalog in Unity Catalog. NOTE: On update, you cannot change the catalog name if it was already set
TYPE:
|
enabled
|
boolean flag specifying if usage tracking is enabled
TYPE:
|
schema_name
|
The name of the schema in Unity Catalog. NOTE: On update, you cannot change the schema name if it was already set
TYPE:
|
table_name_prefix
|
The prefix of the table in Unity Catalog. NOTE: On update, you cannot change the prefix name if it was already set
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntities
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
burst_scaling_enabled
|
TYPE:
|
entity_name
|
The name of the entity to be served. The entity may be a model in the Databricks Model Registry, a model in the Unity Catalog (UC), or a function of type
TYPE:
|
entity_version
|
The version of the model in Databricks Model Registry to be served or empty if the entity is a
TYPE:
|
environment_vars
|
a map of environment variable names/values that will be used for serving this model. Environment variables may refer to Databricks secrets using the standard syntax:
TYPE:
|
external_model
|
The external model to be served. NOTE: Only one of
TYPE:
|
instance_profile_arn
|
ARN of the instance profile that the served model will use to access AWS resources
TYPE:
|
max_provisioned_concurrency
|
The maximum provisioned concurrency that the endpoint can scale up to. Conflicts with
TYPE:
|
max_provisioned_throughput
|
The maximum tokens per second that the endpoint can scale up to
TYPE:
|
min_provisioned_concurrency
|
The minimum provisioned concurrency that the endpoint can scale down to. Conflicts with
TYPE:
|
min_provisioned_throughput
|
The minimum tokens per second that the endpoint can scale down to
TYPE:
|
name
|
The name of a served model. It must be unique across an endpoint. If not specified, this field will default to
TYPE:
|
provisioned_model_units
|
TYPE:
|
scale_to_zero_enabled
|
Whether the compute resources for the served model should scale down to zero. If
TYPE:
|
workload_size
|
The workload size of the served model. The workload size corresponds to a range of provisioned concurrency that the compute will autoscale between. A single unit of provisioned concurrency can process one request at a time. Valid workload sizes are
TYPE:
|
workload_type
|
The workload type of the served model. The workload type selects which type of compute to use in the endpoint. For deep learning workloads, GPU acceleration is available by selecting workload types like
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModel
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
ai21labs_config
|
AI21Labs Config
TYPE:
|
amazon_bedrock_config
|
Amazon Bedrock Config
TYPE:
|
anthropic_config
|
Anthropic Config
TYPE:
|
cohere_config
|
Cohere Config
TYPE:
|
custom_provider_config
|
Custom Provider Config. Only required if the provider is 'custom'
TYPE:
|
databricks_model_serving_config
|
Databricks Model Serving Config
TYPE:
|
google_cloud_vertex_ai_config
|
Google Cloud Vertex AI Config
TYPE:
|
name
|
The name of a served model. It must be unique across an endpoint. If not specified, this field will default to
TYPE:
|
openai_config
|
OpenAI Config
TYPE:
|
palm_config
|
PaLM Config
TYPE:
|
provider
|
The name of the provider for the external model. Currently, the supported providers are
TYPE:
|
task
|
The task type of the external model
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModelAi21labsConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
ai21labs_api_key
|
The Databricks secret key reference for an AI21Labs API key
TYPE:
|
ai21labs_api_key_plaintext
|
An AI21 Labs API key provided as a plaintext string
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModelAmazonBedrockConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
aws_access_key_id
|
The Databricks secret key reference for an AWS Access Key ID with permissions to interact with Bedrock services
TYPE:
|
aws_access_key_id_plaintext
|
An AWS access key ID with permissions to interact with Bedrock services provided as a plaintext string
TYPE:
|
aws_region
|
The AWS region to use. Bedrock has to be enabled there
TYPE:
|
aws_secret_access_key
|
The Databricks secret key reference for an AWS Secret Access Key paired with the access key ID, with permissions to interact with Bedrock services
TYPE:
|
aws_secret_access_key_plaintext
|
An AWS secret access key paired with the access key ID, with permissions to interact with Bedrock services provided as a plaintext string
TYPE:
|
bedrock_provider
|
The underlying provider in Amazon Bedrock. Supported values (case insensitive) include:
TYPE:
|
instance_profile_arn
|
ARN of the instance profile that the served model will use to access AWS resources
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModelAnthropicConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
anthropic_api_key
|
The Databricks secret key reference for an Anthropic API key
TYPE:
|
anthropic_api_key_plaintext
|
The Anthropic API key provided as a plaintext string
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModelCohereConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
cohere_api_base
|
TYPE:
|
cohere_api_key
|
The Databricks secret key reference for a Cohere API key
TYPE:
|
cohere_api_key_plaintext
|
The Cohere API key provided as a plaintext string
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModelCustomProviderConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
api_key_auth
|
API key authentication for the custom provider API. Conflicts with
TYPE:
|
bearer_token_auth
|
bearer token authentication for the custom provider API. Conflicts with
TYPE:
|
custom_provider_url
|
URL of the custom provider API
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModelCustomProviderConfigApiKeyAuth
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
key
|
Key field for a serving endpoint rate limit. Currently,
TYPE:
|
value
|
The value field for a tag
TYPE:
|
value_plaintext
|
The API Key provided as a plaintext string
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModelCustomProviderConfigBearerTokenAuth
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
token
|
The Databricks secret key reference for a token
TYPE:
|
token_plaintext
|
The token provided as a plaintext string
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModelDatabricksModelServingConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
databricks_api_token
|
The Databricks secret key reference for a Databricks API token that corresponds to a user or service principal with Can Query access to the model serving endpoint pointed to by this external model
TYPE:
|
databricks_api_token_plaintext
|
The Databricks API token that corresponds to a user or service principal with Can Query access to the model serving endpoint pointed to by this external model provided as a plaintext string
TYPE:
|
databricks_workspace_url
|
The URL of the Databricks workspace containing the model serving endpoint pointed to by this external model
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModelGoogleCloudVertexAiConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
private_key
|
The Databricks secret key reference for a private key for the service account that has access to the Google Cloud Vertex AI Service
TYPE:
|
private_key_plaintext
|
The private key for the service account that has access to the Google Cloud Vertex AI Service is provided as a plaintext secret
TYPE:
|
project_id
|
This is the Google Cloud project id that the service account is associated with
TYPE:
|
region
|
This is the region for the Google Cloud Vertex AI Service
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModelOpenaiConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
microsoft_entra_client_id
|
This field is only required for Azure AD OpenAI and is the Microsoft Entra Client ID
TYPE:
|
microsoft_entra_client_secret
|
The Databricks secret key reference for a client secret used for Microsoft Entra ID authentication
TYPE:
|
microsoft_entra_client_secret_plaintext
|
The client secret used for Microsoft Entra ID authentication provided as a plaintext string
TYPE:
|
microsoft_entra_tenant_id
|
This field is only required for Azure AD OpenAI and is the Microsoft Entra Tenant ID
TYPE:
|
openai_api_base
|
This is the base URL for the OpenAI API (default: 'https://api.openai.com/v1'). For Azure OpenAI, this field is required and is the base URL for the Azure OpenAI API service provided by Azure
TYPE:
|
openai_api_key
|
The Databricks secret key reference for an OpenAI or Azure OpenAI API key
TYPE:
|
openai_api_key_plaintext
|
The OpenAI API key using the OpenAI or Azure service provided as a plaintext string
TYPE:
|
openai_api_type
|
This is an optional field to specify the type of OpenAI API to use. For Azure OpenAI, this field is required, and this parameter represents the preferred security access validation protocol. For access token validation, use
TYPE:
|
openai_api_version
|
This is an optional field to specify the OpenAI API version. For Azure OpenAI, this field is required and is the version of the Azure OpenAI service to utilize, specified by a date
TYPE:
|
openai_deployment_name
|
This field is only required for Azure OpenAI and is the name of the deployment resource for the Azure OpenAI service
TYPE:
|
openai_organization
|
This is an optional field to specify the organization in OpenAI or Azure OpenAI
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedEntitiesExternalModelPalmConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
palm_api_key
|
The Databricks secret key reference for a PaLM API key
TYPE:
|
palm_api_key_plaintext
|
The PaLM API key provided as a plaintext string
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigServedModels
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
burst_scaling_enabled
|
TYPE:
|
environment_vars
|
a map of environment variable names/values that will be used for serving this model. Environment variables may refer to Databricks secrets using the standard syntax:
TYPE:
|
instance_profile_arn
|
ARN of the instance profile that the served model will use to access AWS resources
TYPE:
|
max_provisioned_concurrency
|
The maximum provisioned concurrency that the endpoint can scale up to. Conflicts with
TYPE:
|
max_provisioned_throughput
|
The maximum tokens per second that the endpoint can scale up to
TYPE:
|
min_provisioned_concurrency
|
The minimum provisioned concurrency that the endpoint can scale down to. Conflicts with
TYPE:
|
min_provisioned_throughput
|
The minimum tokens per second that the endpoint can scale down to
TYPE:
|
model_name
|
The name of the model in Databricks Model Registry to be served
TYPE:
|
model_version
|
The version of the model in Databricks Model Registry to be served
TYPE:
|
name
|
The name of a served model. It must be unique across an endpoint. If not specified, this field will default to
TYPE:
|
provisioned_model_units
|
TYPE:
|
scale_to_zero_enabled
|
Whether the compute resources for the served model should scale down to zero. If
TYPE:
|
workload_size
|
The workload size of the served model. The workload size corresponds to a range of provisioned concurrency that the compute will autoscale between. A single unit of provisioned concurrency can process one request at a time. Valid workload sizes are
TYPE:
|
workload_type
|
The workload type of the served model. The workload type selects which type of compute to use in the endpoint. For deep learning workloads, GPU acceleration is available by selecting workload types like
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigTrafficConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
routes
|
Each block represents a route that defines traffic to each served entity. Each
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingConfigTrafficConfigRoutes
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
served_entity_name
|
The name of the served entity this route configures traffic for. This needs to match the name of a
TYPE:
|
served_model_name
|
TYPE:
|
traffic_percentage
|
The percentage of endpoint traffic to send to this route. It must be an integer between 0 and 100 inclusive
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingEmailNotifications
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
on_update_failure
|
a list of email addresses to be notified when an endpoint fails to update its configuration or state
TYPE:
|
on_update_success
|
a list of email addresses to be notified when an endpoint successfully updates its configuration or state
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingRateLimits
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
calls
|
Used to specify how many calls are allowed for a key within the renewal_period
TYPE:
|
key
|
Key field for a serving endpoint rate limit. Currently,
TYPE:
|
renewal_period
|
Renewal period field for a serving endpoint rate limit. Currently, only
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingTags
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
key
|
Key field for a serving endpoint rate limit. Currently,
TYPE:
|
value
|
The value field for a tag
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingTelemetryConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
inference_table_config
|
Block describing the configuration of usage tracking. Consists of the following attributes:
TYPE:
|
table_names
|
TYPE:
|
telemetry_profile_id
|
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingTelemetryConfigInferenceTableConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of a served model. It must be unique across an endpoint. If not specified, this field will default to
TYPE:
|
sampling_fraction
|
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingTelemetryConfigTableNames
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
annotations_table
|
TYPE:
|
logs_table
|
TYPE:
|
metrics_table
|
TYPE:
|
traces_table
|
TYPE:
|
laktory.models.resources.databricks.modelserving.ModelServingTimeouts
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
create
|
TYPE:
|
update_
|
TYPE:
|