Skip to content

Commit 7e068df

Browse files
authored
Merge pull request #4 from replicate/add-support-for-manually-setting-a-model-to-staging-status
Add support for manually setting a model to staging status
2 parents bf11d3c + b437be6 commit 7e068df

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-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: 4 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

@@ -10,6 +13,7 @@ export const inferenceModels: InferenceModel[] = [
1013
hfModel: "deepseek-ai/DeepSeek-R1",
1114
providerModel: "deepseek-ai/deepseek-r1",
1215
task: "conversational",
16+
status: "staging",
1317
},
1418
{
1519
hfModel: "black-forest-labs/FLUX.1-dev",

0 commit comments

Comments
 (0)