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. A model only has the properties that are known for it:embedding_dimension: The length of the vectors the embedder returns.max_input_tokens: The longest input the model reads, in tokens.modalities: The kinds of input the model accepts, for exampletext.languages: The languages the model supports, as ISO 639-1 codes such asenorde, ormultilingualfor a model trained on about 100 languages.mteb_score: The model's Retrieval score on the MTEB leaderboard, benchmark MTEB(Multilingual, v2), as a percentage. Higher is better.mteb_url: The MTEB leaderboard view the score comes from.
LLM responses don't include these fields.
Related Information
Was this page helpful?