List Embedders and Rankers with the REST APIBeta
Besides LLMs, deepset hosts embedders and rankers. List them programmatically to compare them or to add them to a pipeline.
About This Task
Call the Get Workspace Models endpoint with the category query parameter set to EMBEDDER or RANKER:
GET /api/v2/workspaces/{workspace_id}/models
Without category, the endpoint lists LLMs only, so existing calls return the same results as before.
Prerequisites
- You need an API key. For details, see Generate API Keys.
- You need your workspace ID. For details, see Workspace ID.
List the Models
This request lists the embedders. To list the rankers, set category to RANKER. Replace <WORKSPACE_ID> with your workspace ID and <YOUR_API_KEY> with your Haystack Platform API key:
curl --request GET \
"https://api.cloud.deepset.ai/api/v2/workspaces/<WORKSPACE_ID>/models?category=EMBEDDER" \
--header "Authorization: Bearer <YOUR_API_KEY>"
Read the Response
Embedders and rankers are always connected, because they don't need a provider credential. In addition to the usual model fields, each of them can carry these fields:
category:EMBEDDERorRANKER.components: The pipeline components that run the model, with their type and init parameters as in pipeline YAML. An embedder hastext_embedderanddocument_embedder, and a ranker hasranker. Use them to add the model to a pipeline.stage:EXPERIMENTALfor a model that is still being tried out, orLEGACYfor a model to move away from.details: Properties to compare models on, such asembedding_dimension,max_input_tokens,modalities,languages,mteb_score, andmteb_url. A model only has the properties that are known for it.
LLM responses don't include these fields.
Related Information
Was this page helpful?