Skip to content

Commit a2b0913

Browse files
authored
Rename default rerank model (#138498)
Safety measure to make sure we've the correct default rerank endpoint in place in case #138249 doesn't make it. Endpoint name: `.elastic-rerank-v1` -> `.jina-reranker-v2` Model name: `elastic-rerank-v1` -> `jina-reranker-v2`
1 parent 44e43ce commit a2b0913

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceGetModelsWithElasticInferenceServiceIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void testGetDefaultEndpoints() throws IOException {
5353
assertInferenceIdTaskType(allModels, ".gp-llm-v2-chat_completion", TaskType.CHAT_COMPLETION);
5454
assertInferenceIdTaskType(allModels, ".elser-2-elastic", TaskType.SPARSE_EMBEDDING);
5555
assertInferenceIdTaskType(allModels, ".jina-embeddings-v3", TaskType.TEXT_EMBEDDING);
56-
assertInferenceIdTaskType(allModels, ".elastic-rerank-v1", TaskType.RERANK);
56+
assertInferenceIdTaskType(allModels, ".jina-reranker-v2", TaskType.RERANK);
5757
}
5858

5959
private static void assertInferenceIdTaskType(List<Map<String, Object>> models, String inferenceId, TaskType taskType) {

x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/MockElasticInferenceServiceAuthorizationServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void enqueueAuthorizeAllModelsResponse() {
5151
"task_types": ["embed/text/dense"]
5252
},
5353
{
54-
"model_name": "elastic-rerank-v1",
54+
"model_name": "jina-reranker-v2",
5555
"task_types": ["rerank/text/text-similarity"]
5656
}
5757
]

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/InternalPreconfiguredEndpoints.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public class InternalPreconfiguredEndpoints {
4646
public static final String DEFAULT_MULTILINGUAL_EMBED_MODEL_ID = "jina-embeddings-v3";
4747
public static final String DEFAULT_MULTILINGUAL_EMBED_ENDPOINT_ID = ".jina-embeddings-v3";
4848

49-
// rerank-v1
50-
public static final String DEFAULT_RERANK_MODEL_ID_V1 = "elastic-rerank-v1";
51-
public static final String DEFAULT_RERANK_ENDPOINT_ID_V1 = ".elastic-rerank-v1";
49+
// jina-reranker-v2
50+
public static final String DEFAULT_RERANK_MODEL_ID = "jina-reranker-v2";
51+
public static final String DEFAULT_RERANK_ENDPOINT_ID = ".jina-reranker-v2";
5252

5353
public record MinimalModel(
5454
ModelConfigurations configurations,
@@ -69,7 +69,7 @@ public record MinimalModel(
6969
null
7070
);
7171
private static final ElasticInferenceServiceRerankServiceSettings RERANK_SERVICE_SETTINGS =
72-
new ElasticInferenceServiceRerankServiceSettings(DEFAULT_RERANK_MODEL_ID_V1);
72+
new ElasticInferenceServiceRerankServiceSettings(DEFAULT_RERANK_MODEL_ID);
7373

7474
// A single model name can map to multiple inference endpoints, so we need a String to a List
7575
private static final Map<String, List<MinimalModel>> MODEL_NAME_TO_MINIMAL_MODELS = Map.of(
@@ -125,11 +125,11 @@ public record MinimalModel(
125125
DENSE_TEXT_EMBEDDINGS_SERVICE_SETTINGS
126126
)
127127
),
128-
DEFAULT_RERANK_MODEL_ID_V1,
128+
DEFAULT_RERANK_MODEL_ID,
129129
List.of(
130130
new MinimalModel(
131131
new ModelConfigurations(
132-
DEFAULT_RERANK_ENDPOINT_ID_V1,
132+
DEFAULT_RERANK_ENDPOINT_ID,
133133
TaskType.RERANK,
134134
ElasticInferenceService.NAME,
135135
RERANK_SERVICE_SETTINGS,

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elastic/authorization/PreconfiguredEndpointModelAdapterTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
import static org.elasticsearch.xpack.inference.services.elastic.InternalPreconfiguredEndpoints.DEFAULT_ELSER_ENDPOINT_ID_V2;
3232
import static org.elasticsearch.xpack.inference.services.elastic.InternalPreconfiguredEndpoints.DEFAULT_MULTILINGUAL_EMBED_ENDPOINT_ID;
3333
import static org.elasticsearch.xpack.inference.services.elastic.InternalPreconfiguredEndpoints.DEFAULT_MULTILINGUAL_EMBED_MODEL_ID;
34-
import static org.elasticsearch.xpack.inference.services.elastic.InternalPreconfiguredEndpoints.DEFAULT_RERANK_ENDPOINT_ID_V1;
35-
import static org.elasticsearch.xpack.inference.services.elastic.InternalPreconfiguredEndpoints.DEFAULT_RERANK_MODEL_ID_V1;
34+
import static org.elasticsearch.xpack.inference.services.elastic.InternalPreconfiguredEndpoints.DEFAULT_RERANK_ENDPOINT_ID;
35+
import static org.elasticsearch.xpack.inference.services.elastic.InternalPreconfiguredEndpoints.DEFAULT_RERANK_MODEL_ID;
3636
import static org.elasticsearch.xpack.inference.services.elastic.InternalPreconfiguredEndpoints.DENSE_TEXT_EMBEDDINGS_DIMENSIONS;
3737
import static org.elasticsearch.xpack.inference.services.elastic.InternalPreconfiguredEndpoints.GP_LLM_V2_CHAT_COMPLETION_ENDPOINT_ID;
3838
import static org.elasticsearch.xpack.inference.services.elastic.InternalPreconfiguredEndpoints.GP_LLM_V2_MODEL_ID;
@@ -57,7 +57,7 @@ public class PreconfiguredEndpointModelAdapterTests extends ESTestCase {
5757
null
5858
);
5959
private static final ElasticInferenceServiceRerankServiceSettings RERANK_SETTINGS = new ElasticInferenceServiceRerankServiceSettings(
60-
DEFAULT_RERANK_MODEL_ID_V1
60+
DEFAULT_RERANK_MODEL_ID
6161
);
6262
private static final ElasticInferenceServiceComponents EIS_COMPONENTS = new ElasticInferenceServiceComponents("");
6363

@@ -66,7 +66,7 @@ public void testGetModelsWithValidId() {
6666
DEFAULT_CHAT_COMPLETION_ENDPOINT_ID_V1,
6767
GP_LLM_V2_CHAT_COMPLETION_ENDPOINT_ID,
6868
DEFAULT_ELSER_ENDPOINT_ID_V2,
69-
DEFAULT_RERANK_ENDPOINT_ID_V1,
69+
DEFAULT_RERANK_ENDPOINT_ID,
7070
DEFAULT_MULTILINGUAL_EMBED_ENDPOINT_ID
7171
);
7272
var models = PreconfiguredEndpointModelAdapter.getModels(endpointIds, EIS_COMPONENTS);
@@ -125,7 +125,7 @@ public void testGetModelsWithValidId() {
125125
),
126126
new ElasticInferenceServiceModel(
127127
new ModelConfigurations(
128-
DEFAULT_RERANK_ENDPOINT_ID_V1,
128+
DEFAULT_RERANK_ENDPOINT_ID,
129129
TaskType.RERANK,
130130
ElasticInferenceService.NAME,
131131
RERANK_SETTINGS,

0 commit comments

Comments
 (0)