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

[Inference Endpoints View] Adds Alibaba AI Search to Deletion, search and filtering of inference endpoints #190783

Merged
merged 15 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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 @@ -265,6 +265,19 @@ export type InferenceServiceSettings =
url: string;
};
}
| {
service: 'alibabacloud-ai-search';
service_settings: {
sphilipse marked this conversation as resolved.
Show resolved Hide resolved
api_key: string;
service_id: string;
host: string;
workspace: string;
http_schema: 'https' | 'http';
rate_limit: {
requests_per_minute: number;
};
};
}
| {
service: 'amazonbedrock';
service_settings: {
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 @@ -285,6 +285,27 @@ describe('RenderEndpoint component tests', () => {
});
});

describe('with alibabacloudaisearch service', () => {
const mockEndpoint = {
model_id: 'alibabacloud-ai-search-1',
service: 'alibabacloud-ai-search',
service_settings: {
service_id: 'service-123',
host: 'host-123',
workspace: 'default-123',
},
} as any;

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

expect(screen.getByText('alibabacloud-ai-search-1')).toBeInTheDocument();
expect(screen.getByText('service-123')).toBeInTheDocument();
expect(screen.getByText('host-123')).toBeInTheDocument();
expect(screen.getByText('default-123')).toBeInTheDocument();
});
});

describe('for MIT licensed models', () => {
const mockEndpointWithMitLicensedModel = {
inference_id: 'model-123',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ function endpointModelAtrributes(endpoint: InferenceAPIConfigResponse) {
return mistralAttributes(endpoint);
case ServiceProviderKeys.googleaistudio:
return googleAIStudioAttributes(endpoint);
case ServiceProviderKeys.alibabacloudaisearch:
return alibabaCloudAISearchAttributes(endpoint);
case ServiceProviderKeys.amazonbedrock:
return amazonBedrockAttributes(endpoint);
default:
Expand Down Expand Up @@ -167,6 +169,15 @@ function mistralAttributes(endpoint: InferenceAPIConfigResponse) {
.join(', ');
}

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

const rateLimit =
'rate_limit' in serviceSettings ? serviceSettings.rate_limit.requests_per_minute : undefined;

return rateLimit && `rate_limit: ${rateLimit}`;
sphilipse marked this conversation as resolved.
Show resolved Hide resolved
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import azureOpenAIIcon from '../../../../assets/images/providers/azure_open_ai.s
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 alibabaCloudAISearchIcon from '../../../../assets/images/providers/alibaba_cloud_ai_search.svg';
import { ServiceProviderKeys } from '../../types';

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

export const SERVICE_PROVIDERS: Record<ServiceProviderKeys, ServiceProviderRecord> = {
[ServiceProviderKeys.alibabacloudaisearch]: {
icon: alibabaCloudAISearchIcon,
name: 'AlibabaCloud AI Search',
},
[ServiceProviderKeys.amazonbedrock]: {
icon: amazonBedrockIcon,
name: 'Amazon Bedrock',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { TaskTypes } from '../../types';
export const INFERENCE_ENDPOINTS_TABLE_PER_PAGE_VALUES = [10, 25, 50, 100];

export enum ServiceProviderKeys {
alibabacloudaisearch = 'alibabacloud-ai-search',
amazonbedrock = 'amazonbedrock',
azureopenai = 'azureopenai',
azureaistudio = 'azureaistudio',
Expand Down