Skip to content

Commit 237551c

Browse files
authored
Merge branch 'main' into feature/forecasting/meta_models
2 parents 5f2bf24 + 38992ff commit 237551c

File tree

13 files changed

+170
-67
lines changed

13 files changed

+170
-67
lines changed

ads/aqua/common/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class InferenceContainerTypeFamily(ExtendedEnum):
5858
AQUA_VLLM_LLAMA4_CONTAINER_FAMILY = "odsc-vllm-serving-llama4"
5959
AQUA_TGI_CONTAINER_FAMILY = "odsc-tgi-serving"
6060
AQUA_LLAMA_CPP_CONTAINER_FAMILY = "odsc-llama-cpp-serving"
61+
AQUA_VLLM_OPENAI_CONTAINER_FAMILY = "odsc-vllm-serving-openai"
6162

6263

6364
class CustomInferenceContainerTypeFamily(ExtendedEnum):

ads/aqua/common/utils.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,44 @@ def get_container_params_type(container_type_name: str) -> str:
997997
return UNKNOWN
998998

999999

1000+
def get_container_env_type(container_type_name: Optional[str]) -> str:
1001+
"""
1002+
Determine the container environment type based on the container type name.
1003+
1004+
This function matches the provided container type name against the known
1005+
values of `InferenceContainerType`. The check is case-insensitive and
1006+
allows for partial matches so that changes in container naming conventions
1007+
(e.g., prefixes or suffixes) will still be matched correctly.
1008+
1009+
Examples:
1010+
>>> get_container_env_type("odsc-vllm-serving")
1011+
'vllm'
1012+
>>> get_container_env_type("ODSC-TGI-Serving")
1013+
'tgi'
1014+
>>> get_container_env_type("custom-unknown-container")
1015+
'UNKNOWN'
1016+
1017+
Args:
1018+
container_type_name (Optional[str]):
1019+
The deployment container type name (e.g., "odsc-vllm-serving").
1020+
1021+
Returns:
1022+
str:
1023+
- A matching `InferenceContainerType` value string (e.g., "VLLM", "TGI", "LLAMA-CPP").
1024+
- `"UNKNOWN"` if no match is found or the input is empty/None.
1025+
"""
1026+
if not container_type_name:
1027+
return UNKNOWN
1028+
1029+
needle = container_type_name.strip().casefold()
1030+
1031+
for container_type in InferenceContainerType.values():
1032+
if container_type and container_type.casefold() in needle:
1033+
return container_type.upper()
1034+
1035+
return UNKNOWN
1036+
1037+
10001038
def get_restricted_params_by_container(container_type_name: str) -> set:
10011039
"""The utility function accepts the deployment container type name and returns a set of restricted params
10021040
for that container.

ads/aqua/modeldeployment/config_loader.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class MultiModelConfig(Serializable):
8888
gpu_count (int, optional): Number of GPUs count to this model of this shape.
8989
parameters (Dict[str, str], optional): A dictionary of parameters (e.g., VLLM_PARAMS) to
9090
configure the behavior of a particular GPU shape.
91+
env (Dict[str, Dict[str, str]]): Environment variables grouped by namespace (e.g., "VLLM": {"VAR": "VAL"}).
9192
"""
9293

9394
gpu_count: Optional[int] = Field(
@@ -97,6 +98,10 @@ class MultiModelConfig(Serializable):
9798
default_factory=dict,
9899
description="Key-value pairs for GPU shape parameters (e.g., VLLM_PARAMS).",
99100
)
101+
env: Optional[Dict[str, Dict[str, str]]] = Field(
102+
default_factory=dict,
103+
description="Environment variables grouped by namespace",
104+
)
100105

101106
class Config:
102107
extra = "allow"
@@ -130,6 +135,7 @@ class ConfigurationItem(Serializable):
130135
configure the behavior of a particular GPU shape.
131136
multi_model_deployment (List[MultiModelConfig], optional): A list of multi model configuration details.
132137
shape_info (DeploymentShapeInfo, optional): The shape information to this model for specific CPU shape.
138+
env (Dict[str, Dict[str, str]]): Environment variables grouped by namespace (e.g., "VLLM": {"VAR": "VAL"}).
133139
"""
134140

135141
parameters: Optional[Dict[str, str]] = Field(
@@ -143,6 +149,10 @@ class ConfigurationItem(Serializable):
143149
default_factory=DeploymentShapeInfo,
144150
description="The shape information to this model for specific shape",
145151
)
152+
env: Optional[Dict[str, Dict[str, str]]] = Field(
153+
default_factory=dict,
154+
description="Environment variables grouped by namespace",
155+
)
146156

147157
class Config:
148158
extra = "allow"

ads/aqua/modeldeployment/deployment.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
build_pydantic_error_message,
2828
find_restricted_params,
2929
get_combined_params,
30+
get_container_env_type,
3031
get_container_params_type,
3132
get_ocid_substring,
3233
get_params_list,
@@ -199,7 +200,7 @@ def create(
199200
if create_deployment_details.instance_shape.lower() not in available_shapes:
200201
raise AquaValueError(
201202
f"Invalid Instance Shape. The selected shape '{create_deployment_details.instance_shape}' "
202-
f"is not available in the {self.region} region. Please choose another shape to deploy the model."
203+
f"is not supported in the {self.region} region. Please choose another shape to deploy the model."
203204
)
204205

205206
# Get container config
@@ -381,6 +382,7 @@ def _create(
381382
Tags.AQUA_SERVICE_MODEL_TAG,
382383
Tags.AQUA_FINE_TUNED_MODEL_TAG,
383384
Tags.AQUA_TAG,
385+
Tags.BASE_MODEL_CUSTOM,
384386
]:
385387
if tag in aqua_model.freeform_tags:
386388
tags[tag] = aqua_model.freeform_tags[tag]
@@ -1042,6 +1044,7 @@ def get_deployment_config(self, model_id: str) -> AquaDeploymentConfig:
10421044
config = self.get_config_from_metadata(
10431045
model_id, AquaModelMetadataKeys.DEPLOYMENT_CONFIGURATION
10441046
).config
1047+
10451048
if config:
10461049
logger.info(
10471050
f"Fetched {AquaModelMetadataKeys.DEPLOYMENT_CONFIGURATION} from defined metadata for model: {model_id}."
@@ -1126,7 +1129,7 @@ def get_deployment_default_params(
11261129
model_id: str,
11271130
instance_shape: str,
11281131
gpu_count: int = None,
1129-
) -> List[str]:
1132+
) -> Dict:
11301133
"""Gets the default params set in the deployment configs for the given model and instance shape.
11311134
11321135
Parameters
@@ -1148,6 +1151,7 @@ def get_deployment_default_params(
11481151
11491152
"""
11501153
default_params = []
1154+
default_envs = {}
11511155
config_params = {}
11521156
model = DataScienceModel.from_id(model_id)
11531157
try:
@@ -1157,19 +1161,15 @@ def get_deployment_default_params(
11571161
except ValueError:
11581162
container_type_key = UNKNOWN
11591163
logger.debug(
1160-
f"{AQUA_DEPLOYMENT_CONTAINER_METADATA_NAME} key is not available in the custom metadata field for model {model_id}."
1164+
f"{AQUA_DEPLOYMENT_CONTAINER_METADATA_NAME} key is not available in the "
1165+
f"custom metadata field for model {model_id}."
11611166
)
11621167

1163-
if (
1164-
container_type_key
1165-
and container_type_key in InferenceContainerTypeFamily.values()
1166-
):
1168+
if container_type_key:
11671169
deployment_config = self.get_deployment_config(model_id)
1168-
11691170
instance_shape_config = deployment_config.configuration.get(
11701171
instance_shape, ConfigurationItem()
11711172
)
1172-
11731173
if instance_shape_config.multi_model_deployment and gpu_count:
11741174
gpu_params = instance_shape_config.multi_model_deployment
11751175

@@ -1178,12 +1178,18 @@ def get_deployment_default_params(
11781178
config_params = gpu_config.parameters.get(
11791179
get_container_params_type(container_type_key), UNKNOWN
11801180
)
1181+
default_envs = instance_shape_config.env.get(
1182+
get_container_env_type(container_type_key), {}
1183+
)
11811184
break
11821185

11831186
else:
11841187
config_params = instance_shape_config.parameters.get(
11851188
get_container_params_type(container_type_key), UNKNOWN
11861189
)
1190+
default_envs = instance_shape_config.env.get(
1191+
get_container_env_type(container_type_key), {}
1192+
)
11871193

11881194
if config_params:
11891195
params_list = get_params_list(config_params)
@@ -1196,7 +1202,7 @@ def get_deployment_default_params(
11961202
if params.split()[0] not in restricted_params_set:
11971203
default_params.append(params)
11981204

1199-
return default_params
1205+
return {"data": default_params, "env": default_envs}
12001206

12011207
def validate_deployment_params(
12021208
self,

ads/aqua/modeldeployment/entities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ class CreateModelDeploymentDetails(BaseModel):
233233
None, description="The description of the deployment."
234234
)
235235
model_id: Optional[str] = Field(None, description="The model OCID to deploy.")
236+
236237
models: Optional[List[AquaMultiModelRef]] = Field(
237238
None, description="List of models for multimodel deployment."
238239
)

ads/opctl/operator/lowcode/forecast/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33

44
# Copyright (c) 2023 Oracle and/or its affiliates.
55
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6+
7+
import numpy as np
8+
np.random.seed(42)

ads/opctl/operator/lowcode/forecast/model/automlx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def _build_model(self) -> pd.DataFrame:
158158
summary_frame = model.forecast(
159159
X=X_pred,
160160
periods=horizon,
161-
alpha=1 - (self.spec.confidence_interval_width / 100),
161+
alpha=1 - self.spec.confidence_interval_width,
162162
)
163163

164164
fitted_values = model.predict(data_i.drop(target, axis=1))[

docs/source/release_notes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Release Notes
33
=============
44

5+
2.13.17
6+
-------
7+
Release date: Aug 10, 2025
8+
9+
* AI Quick Actions enhancements.
10+
511
2.13.16
612
-------
713
Release date: Jul 16, 2025

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ build-backend = "flit_core.buildapi"
2121

2222
# Required
2323
name = "oracle_ads" # the install (PyPI) name; name for local build in [tool.flit.module] section below
24-
version = "2.13.16"
24+
version = "2.13.17"
2525

2626
# Optional
2727
description = "Oracle Accelerated Data Science SDK"

tests/unitary/with_extras/aqua/test_data/deployment/aqua_multi_model_deployment_config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
{
22
"configuration": {
33
"BM.GPU.A100-v2.8": {
4+
"env": {},
45
"multi_model_deployment": [
56
{
7+
"env": {},
68
"gpu_count": 1,
79
"parameters": {
810
"VLLM_PARAMS": "--trust-remote-code --max-model-len 32000"
911
}
1012
},
1113
{
14+
"env": {},
1215
"gpu_count": 2,
1316
"parameters": {
1417
"VLLM_PARAMS": "--trust-remote-code --max-model-len 32000"
1518
}
1619
},
1720
{
21+
"env": {},
1822
"gpu_count": 8,
1923
"parameters": {
2024
"VLLM_PARAMS": "--trust-remote-code --max-model-len 32000"
@@ -26,6 +30,7 @@
2630
}
2731
},
2832
"BM.GPU.H100.8": {
33+
"env": {},
2934
"multi_model_deployment": [
3035
{
3136
"gpu_count": 1
@@ -44,6 +49,7 @@
4449
"VM.GPU.A10.2": {
4550
"multi_model_deployment": [
4651
{
52+
"env": {},
4753
"gpu_count": 2,
4854
"parameters": {
4955
"VLLM_PARAMS": "--trust-remote-code --max-model-len 32000"
@@ -52,8 +58,10 @@
5258
]
5359
},
5460
"VM.GPU.A10.4": {
61+
"env": {},
5562
"multi_model_deployment": [
5663
{
64+
"env": {},
5765
"gpu_count": 2,
5866
"parameters": {
5967
"VLLM_PARAMS": "--trust-remote-code --max-model-len 32000"

0 commit comments

Comments
 (0)