Skip to content

Get Models

This returns information about all the loaded models in cuda and cpu devices.

The /models endpoint provides necessary information relating to models loaded in your devices (cpu or cuda). You can check the currently loaded models, and eject a loaded model to free memory.


GET /models

Example

curl  -XGET http://localhost:8882/models
mq.index('my-index').get_loaded_models()

Response: 200 OK

{"models": [
    {"model_name": "hf/e5-base-v2", "model_device": "cpu"},
    {"model_name": "hf/e5-base-v2", "model_device": "cuda"},
    {"model_name": "open_clip/ViT-B-32/laion2b_s34b_b79k", "model_device": "cpu"},
    {"model_name": "open_clip/ViT-B-32/laion2b_s34b_b79k", "model_device": "cuda"},
    {"model_name": "ViT-B/16", "model_device": "cpu"}]}

For Marqo Cloud, you will need to access the endpoint of your index and replace your_endpoint with this. To do this, visit Find Your Endpoint. You will also need your API Key. To obtain this key visit Find Your API Key.

curl  -XGET your_endpoint/models \
-H 'x-api-key: XXXXXXXXXXXXXXX'
mq.index('my-index').get_loaded_models()

Response: 200 OK

{"models":[{"model_name":"hf/e5-base-v2","model_device":"cpu"}]}
For Marqo Cloud, you will see the model and model device for your specific index specified by your endpoint.