load_model
Use the load model operation to load an embedding or reranking model into the database.
Imports a model from object storage (ONNX format) for use in embedding generation and reranking operations. Once loaded, the model can be used for integrated table embeddings or standalone inference.
Parameters
| Parameter | Type | Value Range | Required | Default | Description | Notes |
|---|---|---|---|---|---|---|
model_name |
str |
Valid model identifier | Yes | No default | Unique name to assign to the loaded model. | Must not already exist in the database schema. |
url |
str |
Cloud URI or public URL | Yes | No default | Object storage URL where the model file is located. Supports Oracle Object Storage URLs and public URLs. | Required. |
model_params |
dict |
Object or NULL | No | None | Optional model loading settings for object storage access and model metadata. | Use credential when the model URL requires a database credential. Use metadata to pass model metadata, such as {"function": "regression"} for a reranking model. |
debug_flags |
dict |
Object or NULL | No | None | Debug or tracing flags for detailed logging. | Optional; omit unless diagnostics are needed. |
model_params fields
| Field | Type | Value Range | Required | Description | Notes |
|---|---|---|---|---|---|
credential |
str |
Valid credential name | No | Database credential used to access the object storage URL. | Provide when the model URL is private or requires object storage authentication. Omit for public or pre-authenticated URLs. |
metadata |
dict |
Object or NULL | No | A JSON description of the metadata describing the model. The metadata must, at minimum, describe the machine learning function supported by the model. The model’s metadata parameters are described in JSON Metadata Parameters for ONNX Models. | For reranking models, include "function": "regression" in metadata. |
Raises Exception – InvalidModelNameFormatError may be raised when the model name is invalid. The operation can also fail if the model already exists or the URL is inaccessible.
Load an embedding model from Oracle Object Storage
response = client.load_model(
model_name='all-MiniLM-L6-v2',
url='https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace/b/bucket/o/model.onnx'
)
print(response)
Load a reranking model from Oracle Object Storage
response = client.load_model(
model_name='reranker_model',
url='https://objectstorage.example.com/models/reranker_quantized.onnx',
model_params={'metadata': {'function': 'regression'}}
)
print(response)
Verify model was loaded
models = client.list_models()
print([item.model_name for item in models.items or []])
Return type ModelResponse
Returns JSON response confirming model was loaded successfully. Example response:
{
"model_name": "SAMPLE_MODEL",
"algorithm": "ONNX",
"mining_function": "EMBEDDING",
"creation_date": "2026-03-12T11:27:21Z",
"attributes": [
{
"name": "DATA",
"value": "TEXT",
"data_type": "VARCHAR2",
"data_length": 32767
},
{
"name": "ORA$ONNXTARGET",
"value": "VECTOR",
"data_type": "VECTOR",
"data_length": 1593,
"vector_info": "VECTOR(384,FLOAT32)"
}
]
}