Skip to content

Latest commit

 

History

History
88 lines (60 loc) · 2.06 KB

adapters_api.md

File metadata and controls

88 lines (60 loc) · 2.06 KB

DJL Serving Adapters Management API

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:

  1. Register an adapter
  2. Describe an adapter's status
  3. Unregister an adapter
  4. List registered adapters

This is an extension of the Management API and can be accessed the same.

Adapter Management APIs

Register an adapter

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."
}

Describe adapter

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": "..."
  }
]

Unregister an adapter

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"
}

List adapters

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": "..."
    }
  ]
}