Browse Source

Add Haiku 3.5 to Anthropic, Bedrock, Vertex

Saoud Rizwan 1 year ago
parent
commit
48cdfa9874
2 changed files with 29 additions and 5 deletions
  1. 3 5
      src/api/providers/anthropic.ts
  2. 26 0
      src/shared/api.ts

+ 3 - 5
src/api/providers/anthropic.ts

@@ -28,6 +28,7 @@ export class AnthropicHandler implements ApiHandler {
 		switch (modelId) {
 			// 'latest' alias does not support cache_control
 			case "claude-3-5-sonnet-20241022":
+			case "claude-3-5-haiku-20241022":
 			case "claude-3-opus-20240229":
 			case "claude-3-haiku-20240307": {
 				/*
@@ -78,11 +79,8 @@ export class AnthropicHandler implements ApiHandler {
 						// https://github.com/anthropics/anthropic-sdk-typescript/commit/c920b77fc67bd839bfeb6716ceab9d7c9bbe7393
 						switch (modelId) {
 							case "claude-3-5-sonnet-20241022":
-								return {
-									headers: {
-										"anthropic-beta": "prompt-caching-2024-07-31",
-									},
-								}
+							case "claude-3-5-haiku-20241022":
+							case "claude-3-opus-20240229":
 							case "claude-3-haiku-20240307":
 								return {
 									headers: { "anthropic-beta": "prompt-caching-2024-07-31" },

+ 26 - 0
src/shared/api.ts

@@ -66,6 +66,16 @@ export const anthropicModels = {
 		cacheWritesPrice: 3.75, // $3.75 per million tokens
 		cacheReadsPrice: 0.3, // $0.30 per million tokens
 	},
+	"claude-3-5-haiku-20241022": {
+		maxTokens: 8192,
+		contextWindow: 200_000,
+		supportsImages: false,
+		supportsPromptCache: true,
+		inputPrice: 1.0,
+		outputPrice: 5.0,
+		cacheWritesPrice: 1.25,
+		cacheReadsPrice: 0.1,
+	},
 	"claude-3-opus-20240229": {
 		maxTokens: 4096,
 		contextWindow: 200_000,
@@ -102,6 +112,14 @@ export const bedrockModels = {
 		inputPrice: 3.0,
 		outputPrice: 15.0,
 	},
+	"anthropic.claude-3-5-haiku-20241022-v1:0": {
+		maxTokens: 8192,
+		contextWindow: 200_000,
+		supportsImages: false,
+		supportsPromptCache: false,
+		inputPrice: 1.0,
+		outputPrice: 5.0,
+	},
 	"anthropic.claude-3-5-sonnet-20240620-v1:0": {
 		maxTokens: 8192,
 		contextWindow: 200_000,
@@ -167,6 +185,14 @@ export const vertexModels = {
 		inputPrice: 3.0,
 		outputPrice: 15.0,
 	},
+	"claude-3-5-haiku@20241022": {
+		maxTokens: 8192,
+		contextWindow: 200_000,
+		supportsImages: false,
+		supportsPromptCache: false,
+		inputPrice: 1.0,
+		outputPrice: 5.0,
+	},
 	"claude-3-opus@20240229": {
 		maxTokens: 4096,
 		contextWindow: 200_000,