Note that this API is experimental and is subject to change. Using it requires the environment variable feature flag ENABLE_ADAPTERS_PREVIEW
.
DJL Serving provides a set of API allow user to manage adapters at runtime:
This is an extension of the Management API and can be accessed the same.
POST /models/{modelName}/adapters
- name - The adapter name.
- src - The adapter src. It currently requires a file, but eventually an id or URL can be supported depending on the model handler.
curl -X POST "http://localhost:8080/models/adaptecho/adapters?name=a1&src=..."
{
"status": "Adapter \"a1\" registered."
}
GET /models/{model_name}/adapters/{adapter_name}
Use the Describe Adapter API to get the status of an adapter:
curl http://localhost:8080/models/adaptecho/adapters/a1
[
{
"name": "a1",
"src": "..."
}
]
DELETE /models/{model_name}/adapters/{adapter_name}
Use the Unregister Adapter API to free up system resources:
curl -X DELETE http://localhost:8080/models/adaptecho/adapters/a1
{
"status": "Adapter \"a1\" unregistered"
}
GET /models/{model_name}/adapters
- limit - (optional) the maximum number of items to return. It is passed as a query parameter. The default value is
100
. - next_page_token - (optional) queries for next page. It is passed as a query parameter. This value is return by a previous API call.
Use the Adapters API to query current registered adapters:
curl "http://localhost:8080/models/adaptecho/adapters"
This API supports pagination:
curl "http://localhost:8080/models/adaptecho/adapters?limit=2&next_page_token=0"
{
"adapters": [
{
"name": "a1",
"src": "..."
}
]
}