adds haiku 3.5

This commit is contained in:
khanon 2024-11-04 18:20:19 +00:00
parent c67dad1617
commit 5eeb2875b4
5 changed files with 19 additions and 4 deletions

View File

@ -36,6 +36,7 @@ const getModelsResponse = () => {
"claude-2.0",
"claude-2.1",
"claude-3-haiku-20240307",
"claude-3-5-haiku-20241022",
"claude-3-opus-20240229",
"claude-3-opus-latest",
"claude-3-sonnet-20240229",

View File

@ -239,8 +239,14 @@ function maybeReassignModel(req: Request) {
}
break;
case "haiku":
switch (rev) {
case "20241022":
case "latest":
req.body.model = "anthropic.claude-3-5-haiku-20241022-v1:0";
return;
}
case "opus":
// Add after model ids are announced late 2024
// Add after model id is announced never
break;
}
}

View File

@ -40,6 +40,7 @@ function handleModelsRequest(req: Request, res: Response) {
"anthropic.claude-v2",
"anthropic.claude-v2:1",
"anthropic.claude-3-haiku-20240307-v1:0",
"anthropic.claude-3-5-haiku-20241022-v1:0",
"anthropic.claude-3-sonnet-20240229-v1:0",
"anthropic.claude-3-5-sonnet-20240620-v1:0",
"anthropic.claude-3-5-sonnet-20241022-v2:0",

View File

@ -25,10 +25,11 @@ const getModelsResponse = () => {
// https://docs.anthropic.com/en/docs/about-claude/models
const variants = [
"claude-3-haiku@20240307",
"claude-3-5-haiku@20241022",
"claude-3-sonnet@20240229",
"claude-3-opus@20240229",
"claude-3-5-sonnet@20240620",
"claude-3-5-sonnet-v2@20241022"
"claude-3-5-sonnet-v2@20241022",
"claude-3-opus@20240229",
];
const models = variants.map((id) => ({
@ -152,6 +153,7 @@ function maybeReassignModel(req: Request) {
const [_, _cl, instant, _v, major, _sep, minor, _ctx, name, _rev] = match;
// TODO: rework this to function similarly to aws-claude.ts maybeReassignModel
const ver = minor ? `${major}.${minor}` : major;
switch (ver) {
case "3":
@ -165,7 +167,11 @@ function maybeReassignModel(req: Request) {
}
return;
case "3.5":
req.body.model = "claude-3-5-sonnet@20240620";
if (name.includes("sonnet")) {
req.body.model = "claude-3-5-sonnet@20241022";
} else if (name.includes("haiku")) {
req.body.model = "claude-3-5-haiku@20241022";
}
return;
}

View File

@ -20,6 +20,7 @@ const KNOWN_MODEL_IDS: ModuleAliasTuple[] = [
["anthropic.claude-v2", "anthropic.claude-v2:1"],
["anthropic.claude-3-sonnet-20240229-v1:0"],
["anthropic.claude-3-haiku-20240307-v1:0"],
["anthropic.claude-3-5-haiku-20241022-v1:0"],
["anthropic.claude-3-opus-20240229-v1:0"],
["anthropic.claude-3-5-sonnet-20240620-v1:0"],
["anthropic.claude-3-5-sonnet-20241022-v2:0"],