Skip to content

Commit

Permalink
feat: add support for Sonnet 3.5 (#387)
Browse files Browse the repository at this point in the history
Co-authored-by: Gabriel Koo <gabriel.koo@macbook>
  • Loading branch information
gabrielkoo and Gabriel Koo authored Jun 20, 2024
1 parent 0806c5c commit fae45aa
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ By using the [Agent functionality](./docs/AGENT.md), your chatbot can automatica

## 🚀 Super-easy Deployment

- In the us-east-1 region, open [Bedrock Model access](https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/modelaccess) > `Manage model access` > Check `Anthropic / Claude 3 Haiku`, `Anthropic / Claude 3 Sonnet` and `Cohere / Embed Multilingual` then `Save changes`.
- In the us-east-1 region, open [Bedrock Model access](https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/modelaccess) > `Manage model access` > Check `Anthropic / Claude 3 Haiku`, `Anthropic / Claude 3 Sonnet`, `Anthropic / Claude 3.5 Sonnet` and `Cohere / Embed Multilingual` then `Save changes`.

<details>
<summary>Screenshot</summary>
Expand Down
2 changes: 2 additions & 0 deletions backend/app/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ def get_model_id(model: str) -> str:
return "anthropic.claude-3-haiku-20240307-v1:0"
elif model == "claude-v3-opus":
return "anthropic.claude-3-opus-20240229-v1:0"
elif model == "claude-v3.5-sonnet":
return "anthropic.claude-3-5-sonnet-20240620-v1:0"
elif model == "mistral-7b-instruct":
return "mistral.mistral-7b-instruct-v0:2"
elif model == "mixtral-8x7b-instruct":
Expand Down
2 changes: 2 additions & 0 deletions backend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class EmbeddingConfig(TypedDict):
},
"claude-v3-haiku": {"input": 0.00025, "output": 0.00125},
"claude-v3-sonnet": {"input": 0.00300, "output": 0.01500},
"claude-v3.5-sonnet": {"input": 0.00300, "output": 0.01500},
"mistral-7b-instruct": {"input": 0.00015, "output": 0.0002},
"mixtral-8x7b-instruct": {"input": 0.00045, "output": 0.0007},
"mistral-large": {"input": 0.008, "output": 0.024},
Expand Down Expand Up @@ -106,6 +107,7 @@ class EmbeddingConfig(TypedDict):
},
"claude-v3-haiku": {"input": 0.00025, "output": 0.00125},
"claude-v3-sonnet": {"input": 0.00300, "output": 0.01500},
"claude-v3.5-sonnet": {"input": 0.00300, "output": 0.01500},
"claude-v3-opus": {"input": 0.01500, "output": 0.07500},
"mistral-7b-instruct": {"input": 0.00015, "output": 0.0002},
"mixtral-8x7b-instruct": {"input": 0.00045, "output": 0.0007},
Expand Down
1 change: 1 addition & 0 deletions backend/app/routes/schemas/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"claude-instant-v1",
"claude-v2",
"claude-v3-sonnet",
"claude-v3.5-sonnet",
"claude-v3-haiku",
"claude-v3-opus",
"mistral-7b-instruct",
Expand Down
1 change: 1 addition & 0 deletions backend/app/usecases/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ def propose_conversation_title(
"claude-v2",
"claude-v3-opus",
"claude-v3-sonnet",
"claude-v3.5-sonnet",
"claude-v3-haiku",
"mistral-7b-instruct",
"mixtral-8x7b-instruct",
Expand Down
2 changes: 1 addition & 1 deletion docs/README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

## 🚀 まずはお試し

- us-east-1 リージョンにて、[Bedrock Model access](https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/modelaccess) > `Manage model access` > `Anthropic / Claude 3 Haiku`, `Anthropic / Claude 3 Sonnet` `Cohere / Embed Multilingual`をチェックし、`Save changes`をクリックします
- us-east-1 リージョンにて、[Bedrock Model access](https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/modelaccess) > `Manage model access` > `Anthropic / Claude 3 Haiku`, `Anthropic / Claude 3 Sonnet`, `Anthropic / Claude 3.5 Sonnet` `Cohere / Embed Multilingual`をチェックし、`Save changes`をクリックします

<details>
<summary>スクリーンショット</summary>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/@types/conversation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export type Model =
| 'claude-v2'
| 'claude-v3-opus'
| 'claude-v3-sonnet'
| 'claude-v3.5-sonnet'
| 'claude-v3-haiku'
| 'mistral-7b-instruct'
| 'mixtral-8x7b-instruct'
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/hooks/useModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const availableModels: {
label: 'Claude 3 (Sonnet)',
supportMediaType: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],
},
{
modelId: 'claude-v3.5-sonnet',
label: 'Claude 3.5 (Sonnet)',
supportMediaType: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],
},
{
modelId: 'claude-v3-opus',
label: 'Claude 3 (Opus)',
Expand Down

0 comments on commit fae45aa

Please sign in to comment.