Drop a Model
Use the drop model operation to remove a loaded model
from the database.
The operation drops the specified embedding or reranking model. Models currently in use by vector tables cannot be dropped. An attempt to do so will raise an error.
You must provide the model name of the model to be dropped.
See the following for an example of using
drop_model:
from oracle_vecdb import OracleVecDB, Configuration
client = OracleVecDB(Configuration(
rest_url="https://<host>/ords/<schema>/_/db-api/stable/vecdb/",
access_token="<bearer-token>", # or username="<user>", password="<pass>"
))
drop_mod_response = client.drop_model(model_name='sample_model')
print(drop_mod_response)If the removal is successful, a JSON response is returned confirming the model deletion:
{
"dropped": "SAMPLE_MODEL",
"message": "Model SAMPLE_MODEL dropped successfully"
}For more information about the drop_model
operation, see Python API Reference.
See how DELETE /vecdb/models/{model_name} can be
used in the following example:
curl -X DELETE \
"https://<host>:<port>/ords/<schema>/_/db-api/stable/vecdb/models/DOC_EMBED_MODEL" \
-H "Accept: application/json" \
# Choose ONE authentication method:
# Option 1: Basic authentication
-u "<user>:<password>"
# Option 2: OAuth Bearer token
# -H "Authorization: Bearer <access_token>"Responses:
- 200 Created – returns a confirmation that the drop was
successful:
{ "message": "Model DOC_EMBED_MODEL dropped successfully" } - 400 - the model is used in a vector table and cannot be deleted.
- 404 - model not found.
For more information about DELETE
/vecdb/models/{model_name}, see REST API Reference.
See how DBMS_VECTOR_DATABASE.DROP_MODEL can be used
in the following example:
dbms_vector_database.drop_model('DOC_EMBED_MODEL');{
"message": "Model DOC_EMBED_MODEL dropped successfully"
}For more information about the PL/SQL implementation, including parameters, see DROP_MODEL.