Skip to content

fix: handle model check for finetune/batches #1020

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

Merged
merged 2 commits into from
Apr 11, 2025
Merged
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
13 changes: 12 additions & 1 deletion src/providers/bedrock/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ const AWS_GET_METHODS: endpointStrings[] = [
'retrieveFinetune',
];

// Endpoints that does not require model parameter
const BEDROCK_NO_MODEL_ENDPOINTS: endpointStrings[] = [
'listFinetunes',
'retrieveFinetune',
'cancelFinetune',
'listBatches',
'retrieveBatch',
'getBatchOutput',
'cancelBatch',
];

const ENDPOINTS_TO_ROUTE_TO_S3 = [
'retrieveFileContent',
'getBatchOutput',
Expand Down Expand Up @@ -185,7 +196,7 @@ const BedrockAPIConfig: BedrockAPIConfigInterface = {
return `/model-invocation-job/${batchId}/stop`;
}
const { model, stream } = gatewayRequestBody;
if (!model) {
if (!model && !BEDROCK_NO_MODEL_ENDPOINTS.includes(fn as endpointStrings)) {
throw new GatewayError('Model is required');
}
let mappedFn: string = fn;
Expand Down