Skip to content

Commit a11f349

Browse files
committed
add support for manually setting a model to staging status
1 parent bf11d3c commit a11f349

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ const getModelStatus = async (model: InferenceModel) => {
2121
// Get Replicate model warm/cold statuses in parallel
2222
const statuses = await Promise.all(inferenceModels.map(getModelStatus));
2323

24-
// Add status to each model object
24+
// Set status (unless it's already manually defined on the model object)
2525
const replicateModels = inferenceModels.map((model, index) => ({
2626
...model,
27-
status: statuses[index],
27+
status: model.status ?? statuses[index],
2828
}));
2929

3030
console.log("\n\nReplicate model mappings:");

src/models.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ export interface InferenceModel {
22
hfModel: string;
33
providerModel: string;
44
task: string;
5+
6+
// You can set this to force the value, e.g. to keep a model as 'staging' even if it's
7+
// warm/live on Replicate. If not set, the status will be inferred from the provider model
58
status?: 'live' | 'staging';
69
}
710

0 commit comments

Comments
 (0)