diff --git a/AdminDashboard/src/Pages/Settings/LlmProviders/Index.tsx b/AdminDashboard/src/Pages/Settings/LlmProviders/Index.tsx index b31d067801..5fdba9845b 100644 --- a/AdminDashboard/src/Pages/Settings/LlmProviders/Index.tsx +++ b/AdminDashboard/src/Pages/Settings/LlmProviders/Index.tsx @@ -13,6 +13,7 @@ import LlmProvider from "Common/Models/DatabaseModels/LlmProvider"; import LlmType from "Common/Types/LLM/LlmType"; import React, { FunctionComponent, ReactElement } from "react"; import DropdownUtil from "Common/UI/Utils/Dropdown"; +import { BILLING_ENABLED } from "Common/UI/Config"; const Settings: FunctionComponent = (): ReactElement => { return ( @@ -83,10 +84,14 @@ const Settings: FunctionComponent = (): ReactElement => { title: "Provider Settings", id: "provider-settings", }, - { - title: "Cost Settings", - id: "cost-settings", - }, + ...(BILLING_ENABLED + ? [ + { + title: "Cost Settings", + id: "cost-settings", + }, + ] + : []), ]} formFields={[ { @@ -160,18 +165,22 @@ const Settings: FunctionComponent = (): ReactElement => { description: "Required for Ollama. Optional for others to use custom endpoints.", }, - { - field: { - costPerMillionTokensInUSDCents: true, - }, - title: "Cost Per Million Tokens (USD Cents)", - stepId: "cost-settings", - fieldType: FormFieldSchemaType.Number, - required: false, - placeholder: "0", - description: - "Cost per million tokens in USD cents. For example, if the cost is $0.01 per 1M tokens, enter 1.", - }, + ...(BILLING_ENABLED + ? [ + { + field: { + costPerMillionTokensInUSDCents: true, + }, + title: "Cost Per Million Tokens (USD Cents)", + stepId: "cost-settings", + fieldType: FormFieldSchemaType.Number, + required: false, + placeholder: "0", + description: + "Cost per million tokens in USD cents. For example, if the cost is $0.01 per 1M tokens, enter 1.", + }, + ] + : []), ]} selectMoreFields={{ apiKey: true, @@ -222,14 +231,18 @@ const Settings: FunctionComponent = (): ReactElement => { type: FieldType.Text, noValueMessage: "-", }, - { - field: { - costPerMillionTokensInUSDCents: true, - }, - title: "Cost (cents/1M)", - type: FieldType.Number, - noValueMessage: "0", - }, + ...(BILLING_ENABLED + ? [ + { + field: { + costPerMillionTokensInUSDCents: true, + }, + title: "Cost (cents/1M)", + type: FieldType.Number, + noValueMessage: "0", + }, + ] + : []), ]} />