Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changelog/128241.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 128241
summary: Adding VoyageAI's v3.5 models
area: Machine Learning
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,32 @@
import org.elasticsearch.xpack.inference.services.voyageai.action.VoyageAIActionVisitor;

import java.net.URI;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

public abstract class VoyageAIModel extends RateLimitGroupingModel {
private static final String DEFAULT_MODEL_FAMILY = "default_model_family";
private static final Map<String, String> MODEL_TO_MODEL_FAMILY = Map.of(
"voyage-multimodal-3",
"embed_multimodal",
"voyage-3-large",
"embed_large",
"voyage-code-3",
"embed_large",
"voyage-3",
"embed_medium",
"voyage-3-lite",
"embed_small",
"voyage-finance-2",
"embed_large",
"voyage-law-2",
"embed_large",
"voyage-code-2",
"embed_large",
"rerank-2",
"rerank_large",
"rerank-2-lite",
"rerank_small"
);
private static final Map<String, String> MODEL_TO_MODEL_FAMILY;

static {
Map<String, String> tempMap = new HashMap<>();
tempMap.put("voyage-3.5", "embed_medium");
tempMap.put("voyage-3.5-lite", "embed_small");
tempMap.put("voyage-multimodal-3", "embed_multimodal");
tempMap.put("voyage-3-large", "embed_large");
tempMap.put("voyage-code-3", "embed_large");
tempMap.put("voyage-3", "embed_medium");
tempMap.put("voyage-3-lite", "embed_small");
tempMap.put("voyage-finance-2", "embed_large");
tempMap.put("voyage-law-2", "embed_large");
tempMap.put("voyage-code-2", "embed_large");
tempMap.put("rerank-2", "rerank_large");
tempMap.put("rerank-2-lite", "rerank_small");

MODEL_TO_MODEL_FAMILY = Collections.unmodifiableMap(tempMap);
}

private final SecureString apiKey;
private final VoyageAIRateLimitServiceSettings rateLimitServiceSettings;
Expand Down