Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
eecfbb4
adds Amazon Bedrock to Inference API management
markjhoy Jul 18, 2024
4524d76
Merge branch 'main' into markjhoy/add_amazon_bedrock_inference_manage…
markjhoy Jul 18, 2024
15b8a03
update icon for amazon_bedrock
markjhoy Jul 23, 2024
084f849
Merge branch 'main' into markjhoy/add_amazon_bedrock_inference_manage…
markjhoy Jul 23, 2024
c67eb88
Merge branch 'main' into markjhoy/add_amazon_bedrock_inference_manage…
markjhoy Jul 24, 2024
295c4f8
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jul 24, 2024
58ef595
misspelled bedrock in test
markjhoy Jul 24, 2024
7ca252b
correct bedrock unit test
markjhoy Jul 24, 2024
b1b39c7
Merge branch 'main' into markjhoy/add_amazon_bedrock_inference_manage…
markjhoy Jul 24, 2024
1b12b2c
Merge branch 'main' into markjhoy/add_amazon_bedrock_inference_manage…
markjhoy Jul 24, 2024
110afee
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jul 24, 2024
39def54
remove model from endpoint_info attributes
markjhoy Jul 25, 2024
67924bf
Merge branch 'main' into markjhoy/add_amazon_bedrock_inference_manage…
markjhoy Jul 25, 2024
8804826
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jul 25, 2024
80b8416
removed unused variable
markjhoy Jul 25, 2024
5cfef3e
Merge branch 'main' into markjhoy/add_amazon_bedrock_inference_manage…
markjhoy Jul 25, 2024
6c2621a
Merge branch 'main' into markjhoy/add_amazon_bedrock_inference_manage…
markjhoy Jul 26, 2024
4867525
Merge branch 'main' into markjhoy/add_amazon_bedrock_inference_manage…
elasticmachine Jul 26, 2024
79fb357
Merge branch 'main' into markjhoy/add_amazon_bedrock_inference_manage…
markjhoy Jul 26, 2024
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 @@ -259,6 +259,16 @@ export type InferenceServiceSettings =
api_key: string;
url: string;
};
}
| {
service: 'amazonbedrock';
service_settings: {
access_key: string;
secret_key: string;
region: string;
provider: string;
model: string;
};
};

export type InferenceAPIConfigResponse = {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,26 @@ describe('RenderEndpoint component tests', () => {
});
});

describe('with amazonbedrock service', () => {
const mockEndpoint = {
model_id: 'amazon-bedrock-1',
service: 'amazonbedrock',
service_settings: {
region: 'us-west-1',
provider: 'AMAZONTITAN',
model: 'model-bedrock-xyz',
},
} as any;

it('renders the component with endpoint details', () => {
render(<EndpointInfo endpoint={mockEndpoint} />);

expect(screen.getByText('amazon-bedrock-1')).toBeInTheDocument();
expect(screen.getByText('model-bedrock-xyz')).toBeInTheDocument();
expect(screen.getByText('region: us-west-1, provider: amazontitan')).toBeInTheDocument();
});
});

describe('for MIT licensed models', () => {
const mockEndpointWithMitLicensedModel = {
model_id: 'model-123',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ function endpointModelAtrributes(endpoint: InferenceAPIConfigResponse) {
return mistralAttributes(endpoint);
case ServiceProviderKeys.googleaistudio:
return googleAIStudioAttributes(endpoint);
case ServiceProviderKeys.amazonbedrock:
return amazonBedrockAttributes(endpoint);
default:
return null;
}
Expand Down Expand Up @@ -175,6 +177,18 @@ function mistralAttributes(endpoint: InferenceAPIConfigResponse) {
.join(', ');
}

function amazonBedrockAttributes(endpoint: InferenceAPIConfigResponse) {
const serviceSettings = endpoint.service_settings;

const region = 'region' in serviceSettings ? serviceSettings.region : undefined;
const provider =
'provider' in serviceSettings ? serviceSettings.provider.toLocaleLowerCase() : undefined;

return [region && `region: ${region}`, provider && `provider: ${provider}`]
.filter(Boolean)
.join(', ');
}

function googleAIStudioAttributes(endpoint: InferenceAPIConfigResponse) {
const serviceSettings = endpoint.service_settings;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import azureAIStudioIcon from '../../../../assets/images/providers/azure_ai_stud
import azureOpenAIIcon from '../../../../assets/images/providers/azure_open_ai.svg';
import googleAIStudioIcon from '../../../../assets/images/providers/google_ai_studio.svg';
import mistralIcon from '../../../../assets/images/providers/mistral.svg';
import amazonBedrockIcon from '../../../../assets/images/providers/amazon_bedrock.svg';
import { ServiceProviderKeys } from '../../types';

interface ServiceProviderProps {
Expand All @@ -27,6 +28,10 @@ interface ServiceProviderRecord {
}

export const SERVICE_PROVIDERS: Record<ServiceProviderKeys, ServiceProviderRecord> = {
[ServiceProviderKeys.amazonbedrock]: {
icon: amazonBedrockIcon,
name: 'Amazon Bedrock',
},
[ServiceProviderKeys.azureaistudio]: {
icon: azureAIStudioIcon,
name: 'Azure AI Studio',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils';
export const INFERENCE_ENDPOINTS_TABLE_PER_PAGE_VALUES = [10, 25, 50, 100];

export enum ServiceProviderKeys {
amazonbedrock = 'amazonbedrock',
azureopenai = 'azureopenai',
azureaistudio = 'azureaistudio',
cohere = 'cohere',
Expand Down