Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Anthropic on Bedrock model provider #939

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ export function ModelProviderConfigureContent({
</DialogTitle>
</DialogHeader>

{modelProvider.id === CommonModelProviderIds.ANTHROPIC && (
{(modelProvider.id === CommonModelProviderIds.ANTHROPIC ||
modelProvider.id ==
CommonModelProviderIds.ANTHROPIC_BEDROCK) && (
<DialogDescription className="px-4">
Note: Anthropic does not have an embeddings model and{" "}
<Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const translateUserFriendlyLabel = (label: string) => {
"OBOT_OLLAMA_MODEL_PROVIDER",
"OBOT_VOYAGE_MODEL_PROVIDER",
"OBOT_GROQ_MODEL_PROVIDER",
"OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER",
];

return fieldsToStrip
Expand Down
17 changes: 16 additions & 1 deletion ui/admin/app/components/model-providers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const CommonModelProviderIds = {
ANTHROPIC: "anthropic-model-provider",
OPENAI: "openai-model-provider",
AZURE_OPENAI: "azure-openai-model-provider",
ANTHROPIC_BEDROCK: "anthropic-bedrock-model-provider",
};

export const ModelProviderLinks = {
Expand All @@ -15,6 +16,8 @@ export const ModelProviderLinks = {
"https://azure.microsoft.com/en-us/explore/",
[CommonModelProviderIds.ANTHROPIC]: "https://www.anthropic.com",
[CommonModelProviderIds.OPENAI]: "https://openai.com/",
[CommonModelProviderIds.ANTHROPIC_BEDROCK]:
"https://aws.amazon.com/bedrock/claude/",
};

export const ModelProviderConfigurationLinks = {
Expand All @@ -41,7 +44,7 @@ export const ModelProviderRequiredTooltips: {
},
[CommonModelProviderIds.AZURE_OPENAI]: {
Endpoint:
"Endpoint for the Azure OpenAI service (eg. https://<resource-name>.<region>.api.cognitive.microsoft.com/)",
"Endpoint for the Azure OpenAI service (e.g. https://<resource-name>.<region>.api.cognitive.microsoft.com/)",
"Client Id":
"Unique identifier for the application when using Azure Active Directory. Can typically be found in App Registrations > [application].",
"Client Secret":
Expand All @@ -53,6 +56,12 @@ export const ModelProviderRequiredTooltips: {
"Resource Group":
"Container that holds related Azure resources. Can typically be found in Azure Portal > Resource Groups > [OpenAI Resource Group] > Overview",
},
[CommonModelProviderIds.ANTHROPIC_BEDROCK]: {
"Access Key ID": "AWS Access Key ID",
"Secret Access Key": "AWS Secret Access Key",
"Session Token": "AWS Session Token",
Region: "AWS Region - make sure that the models you want to use are available in this region: https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html",
},
};

export const ModelProviderSensitiveFields: Record<string, boolean | undefined> =
Expand All @@ -79,4 +88,10 @@ export const ModelProviderSensitiveFields: Record<string, boolean | undefined> =

// Groq
OBOT_GROQ_MODEL_PROVIDER_API_KEY: true,

// Anthropic Bedrock
OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER_ACCESS_KEY_ID: true,
OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER_SECRET_ACCESS_KEY: true,
OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER_SESSION_TOKEN: true,
OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER_REGION: false,
};
1 change: 1 addition & 0 deletions ui/admin/app/routes/_auth.model-providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const sortModelProviders = (modelProviders: ModelProvider[]) => {
CommonModelProviderIds.OPENAI,
CommonModelProviderIds.AZURE_OPENAI,
CommonModelProviderIds.ANTHROPIC,
CommonModelProviderIds.ANTHROPIC_BEDROCK,
CommonModelProviderIds.OLLAMA,
CommonModelProviderIds.VOYAGE,
CommonModelProviderIds.GROQ,
Expand Down
51 changes: 51 additions & 0 deletions ui/admin/public/assets/anthropic_bedrock_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.