Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 8, 2024
2 parents a1d4885 + aff1d7e commit 2e45a1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/api/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function getModels(remoteModelRes: OpenAIListModelResponse) {

if (config.disableGPT4) {
remoteModelRes.data = remoteModelRes.data.filter(
(m) => !m.id.startsWith("gpt-4"),
(m) => !m.id.startsWith("gpt-4") || m.id.startsWith("gpt-4o-mini"),
);
}

Expand Down
10 changes: 8 additions & 2 deletions app/config/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,16 @@ export const getServerSideConfig = () => {

if (disableGPT4) {
if (customModels) customModels += ",";
customModels += DEFAULT_MODELS.filter((m) => m.name.startsWith("gpt-4"))
customModels += DEFAULT_MODELS.filter(
(m) => m.name.startsWith("gpt-4") && !m.name.startsWith("gpt-4o-mini"),
)
.map((m) => "-" + m.name)
.join(",");
if (defaultModel.startsWith("gpt-4")) defaultModel = "";
if (
defaultModel.startsWith("gpt-4") &&
!defaultModel.startsWith("gpt-4o-mini")
)
defaultModel = "";
}

const isStability = !!process.env.STABILITY_API_KEY;
Expand Down

0 comments on commit 2e45a1e

Please sign in to comment.