adds haiku 3.5
This commit is contained in:
parent
c67dad1617
commit
5eeb2875b4
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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"],
|
||||
|
|
Loading…
Reference in New Issue