- This key is stored locally and only used to make API requests from this extension.
- {!apiConfiguration?.mistralApiKey && (
-
- This key is stored locally and only used to make API requests from this extension.{" "} - {/* {!apiConfiguration?.openRouterApiKey && ( - - (Note: OpenRouter is recommended for high rate - limits, prompt caching, and wider selection of models.) - - )} */} -
-
+ {helpText || "This key is stored locally and only used to make API requests from this extension."}
+ {!value && signupUrl && (
+
+ {message} +
+ ) +} diff --git a/webview-ui/src/components/settings/common/ModelInfoView.tsx b/webview-ui/src/components/settings/common/ModelInfoView.tsx new file mode 100644 index 00000000..aa16abbd --- /dev/null +++ b/webview-ui/src/components/settings/common/ModelInfoView.tsx @@ -0,0 +1,224 @@ +import { VSCodeLink } from "@vscode/webview-ui-toolkit/react" +import { Fragment, useState } from "react" +import { ModelInfo, geminiModels } from "@shared/api" +import { ModelDescriptionMarkdown } from "../OpenRouterModelPicker" +import { + formatPrice, + hasThinkingBudget, + supportsImages, + supportsBrowserUse, + supportsPromptCache, + formatTokenPrice, + formatTokenLimit, +} from "../utils/pricingUtils" + +/** + * Returns an array of formatted tier strings + */ +const formatTiers = ( + tiers: ModelInfo["tiers"], + priceType: "inputPrice" | "outputPrice" | "cacheReadsPrice" | "cacheWritesPrice", +): JSX.Element[] => { + if (!tiers || tiers.length === 0) { + return [] + } + + return tiers + .map((tier, index, arr) => { + const prevLimit = index > 0 ? arr[index - 1].contextWindow : 0 + const price = tier[priceType] + + if (price === undefined) return null + + return ( + + {formatPrice(price)}/million tokens ( + {tier.contextWindow === Number.POSITIVE_INFINITY ? ( + + {">"} {prevLimit.toLocaleString()} + + ) : ( + + {"<="} {tier.contextWindow.toLocaleString()} + + )} + {" tokens)"} + {index < arr.length - 1 &&
+ {infoItems.map((item, index) => (
+
}
+
+ This key is stored locally and only used to make API requests from this extension. +
++ {!apiConfiguration?.openRouterProviderSorting && + "Default behavior is to load balance requests across providers (like AWS, Google Vertex, Anthropic), prioritizing price while considering provider uptime"} + {apiConfiguration?.openRouterProviderSorting === "price" && + "Sort providers by price, prioritizing the lowest cost provider"} + {apiConfiguration?.openRouterProviderSorting === "throughput" && + "Sort providers by throughput, prioritizing the provider with the highest throughput (may increase cost)"} + {apiConfiguration?.openRouterProviderSorting === "latency" && + "Sort providers by response time, prioritizing the provider with the lowest latency"} +
+