Skip to content

Commit

Permalink
Update to new Claude Sonnet 3.5 version
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcampagnolitg committed Oct 23, 2024
1 parent 60ff628 commit a910e8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
29 changes: 9 additions & 20 deletions src/llm/models/anthropic-vertex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,14 @@ export const ANTHROPIC_VERTEX_SERVICE = 'anthropic-vertex';
export function anthropicVertexLLMRegistry(): Record<string, () => LLM> {
return {
[`${ANTHROPIC_VERTEX_SERVICE}:claude-3-haiku`]: Claude3_Haiku_Vertex,
[`${ANTHROPIC_VERTEX_SERVICE}:claude-3-sonnet`]: Claude3_Sonnet_Vertex,
[`${ANTHROPIC_VERTEX_SERVICE}:claude-3-5-sonnet`]: Claude3_5_Sonnet_Vertex,
[`${ANTHROPIC_VERTEX_SERVICE}:claude-3-opus`]: Claude3_Opus_Vertex,
};
}

export function Claude3_Sonnet_Vertex() {
return new AnthropicVertexLLM(
'Claude 3 Sonnet (Vertex)',
'claude-3-sonnet@20240229',
(input: string) => (input.length * 3) / (1_000_000 * 3.5),
(output: string) => (output.length * 15) / (1_000_000 * 3.5),
);
}

export function Claude3_5_Sonnet_Vertex() {
return new AnthropicVertexLLM(
'Claude 3.5 Sonnet (Vertex)',
'claude-3-5-sonnet@20240620',
'claude-3-5-sonnet-v2@20241022',
(input: string) => (input.length * 3) / (1_000_000 * 3.5),
(output: string) => (output.length * 15) / (1_000_000 * 3.5),
);
Expand All @@ -55,14 +44,14 @@ export function Claude3_Haiku_Vertex() {
);
}

export function Claude3_Opus_Vertex() {
return new AnthropicVertexLLM(
'Claude 3 Opus (Vertex)',
'claude-3-opus@20240229',
(input: string) => (input.length * 15) / (1_000_000 * 3.5),
(output: string) => (output.length * 75) / (1_000_000 * 3.5),
);
}
// export function Claude3_Opus_Vertex() {
// return new AnthropicVertexLLM(
// 'Claude 3 Opus (Vertex)',
// 'claude-3-opus@20240229',
// (input: string) => (input.length * 15) / (1_000_000 * 3.5),
// (output: string) => (output.length * 75) / (1_000_000 * 3.5),
// );
// }

export function ClaudeVertexLLMs(): AgentLLMs {
const hard = Claude3_5_Sonnet_Vertex();
Expand Down
2 changes: 1 addition & 1 deletion src/llm/models/anthropic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function Claude3_Opus() {
export function Claude3_5_Sonnet() {
return new Anthropic(
'Claude 3.5 Sonnet',
'claude-3-5-sonnet-20240620',
'claude-3-5-sonnet-20241022',
(input: string) => (input.length * 3) / (1_000_000 * 3.5),
(output: string) => (output.length * 15) / (1_000_000 * 3.5),
);
Expand Down

0 comments on commit a910e8e

Please sign in to comment.