Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(ai-gateway): show credential details while models load (#19163)

Tobias Wochinger4c013e7acd37
diff --git a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/GatewayConnectionModelsPage.tsx b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/GatewayConnectionModelsPage.tsx
index 8842e0e57f..1f5f3618df 100644
--- a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/GatewayConnectionModelsPage.tsx
+++ b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/GatewayConnectionModelsPage.tsx
@@ -1,15 +1,12 @@
-import { ArrowLeft, RefreshCw, Trash2 } from "@langfuse/icons";
+import { ArrowLeft } from "@langfuse/icons";
import { Alert } from "@/src/components/design-system/Alert/Alert";
-import { ConfirmationDialogController } from "@/src/components/design-system/ConfirmationDialogController/ConfirmationDialogController";
-import { IconButton } from "@/src/components/design-system/IconButton/IconButton";
import { TextLink } from "@/src/components/design-system/TextLink/TextLink";
import { ConnectionModelsLoadError } from "@/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsLoadError";
-import { ConnectionModelsSkeleton } from "@/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsSkeleton";
+import { ConnectionModelsSkeleton } from "@/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsSkeleton/ConnectionModelsSkeleton";
+import { ConnectionSummary } from "@/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionSummary/ConnectionSummary";
import { GatewayConnectionModelsTable } from "@/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/GatewayConnectionModelsTable/GatewayConnectionModelsTable";
import { useGatewayConnectionModels } from "@/src/features/ai-gateway/components/GatewayConnectionModelsPage/hooks/useGatewayConnectionModels";
-import { isGatewayModelAllowed } from "@/src/features/ai-gateway/fns/isGatewayModelAllowed";
-import { toGatewayAllowedModelsSet } from "@/src/features/ai-gateway/fns/toGatewayAllowedModelsSet";
import { updateGatewayAllowedModels } from "@/src/features/ai-gateway/fns/updateGatewayAllowedModels";
import type { GatewayConnection } from "@/src/features/ai-gateway/types/gatewayProvider";
@@ -38,27 +35,93 @@ export function GatewayConnectionModelsPage({
organizationId,
connectionId,
});
+ const connection = connectionQuery.data;
- if (connectionQuery.isPending || modelsQuery.isPending) {
- return <ConnectionModelsSkeleton />;
- }
- if (connectionQuery.isError || modelsQuery.isError) {
- return (
- <ConnectionModelsLoadError
- organizationId={organizationId}
- retry={retryQueries}
+ return (
+ <div className="flex h-full min-h-0 flex-col gap-4">
+ <ProviderCredentialsLink organizationId={organizationId} />
+ <ConnectionSummary
+ connection={connection}
+ isDeleting={isDeleting}
+ isError={connectionQuery.isError}
+ isRetrying={isRetrying}
+ onDelete={onDelete}
+ onRefresh={retryDiscovery}
+ onRetry={retryQueries}
/>
+ {connection || !connectionQuery.isError ? (
+ <ConnectionModelsBody
+ connection={connection}
+ isSaving={isSaving}
+ modelsQuery={modelsQuery}
+ onRetry={retryQueries}
+ saveAllowedModels={saveAllowedModels}
+ />
+ ) : null}
+ </div>
+ );
+}
+
+function ProviderCredentialsLink({
+ organizationId,
+}: {
+ organizationId: string;
+}) {
+ return (
+ <TextLink
+ path={`/organization/${encodeURIComponent(organizationId)}/settings/ai-gateway-providers`}
+ value="Provider credentials"
+ icon={ArrowLeft}
+ />
+ );
+}
+
+type ConnectionModelsBodyProps = {
+ connection: GatewayConnection | undefined;
+ isSaving: boolean;
+ modelsQuery: ReturnType<typeof useGatewayConnectionModels>["modelsQuery"];
+ onRetry: () => void;
+ saveAllowedModels: (
+ allowedModels: string[] | null,
+ onSuccess?: () => void,
+ ) => void;
+};
+
+function ConnectionModelsBody({
+ connection,
+ isSaving,
+ modelsQuery,
+ onRetry,
+ saveAllowedModels,
+}: ConnectionModelsBodyProps) {
+ if (!connection || modelsQuery.isPending) {
+ return (
+ <div className="flex min-h-0 flex-1 flex-col">
+ <span className="sr-only">Loading models</span>
+ <ConnectionModelsSkeleton />
+ </div>
);
}
- const connection = connectionQuery.data;
- const result = modelsQuery.data;
- const models = result.success ? result.models : [];
- const allowedModelsSet = toGatewayAllowedModelsSet(connection.allowedModels);
- const enabledCount = models.filter((model) =>
- isGatewayModelAllowed(allowedModelsSet, model),
- ).length;
+ if (modelsQuery.isError || !modelsQuery.data) {
+ return <ConnectionModelsLoadError kind="models" retry={onRetry} />;
+ }
+
+ if (!modelsQuery.data.success) {
+ return (
+ <Alert variant="destructive">
+ <Alert.Title>Models could not be loaded</Alert.Title>
+ <Alert.Description>
+ The provider returned a model discovery error. Refresh the provider
+ before changing model access.
+ </Alert.Description>
+ </Alert>
+ );
+ }
+ const models = modelsQuery.data.models;
+ const enableAll = () => saveAllowedModels(null);
+ const disableAll = () => saveAllowedModels([]);
const setModelsEnabled = (
targetModels: string[],
enabled: boolean,
@@ -74,75 +137,15 @@ export function GatewayConnectionModelsPage({
onSuccess,
);
};
- const enableAll = () => saveAllowedModels(null);
- const disableAll = () => saveAllowedModels([]);
- const deleteConnection = () => onDelete(connection);
return (
- <div className="flex h-full min-h-0 flex-col gap-4">
- <ConfirmationDialogController
- title="Delete provider credential"
- text={`Delete “${connection.name}”? Requests will immediately stop using it.`}
- confirmLabel="Delete credential"
- variant="destructive"
- loading={isDeleting}
- onConfirm={deleteConnection}
- >
- {({ openDialog }) => (
- <>
- <TextLink
- path={`/organization/${encodeURIComponent(organizationId)}/settings/ai-gateway-providers`}
- value="Provider credentials"
- icon={ArrowLeft}
- />
- <div className="flex items-center justify-between gap-4">
- <h2 className="text-lg font-bold">{connection.name}</h2>
- <div className="flex -translate-y-px items-center gap-2">
- <IconButton
- icon={RefreshCw}
- label="Refresh provider models"
- variant="outline"
- disabled={isRetrying || isDeleting}
- onClick={retryDiscovery}
- />
- <IconButton
- icon={Trash2}
- label="Delete provider credential"
- variant="outlineDestructive"
- disabled={isDeleting}
- onClick={openDialog}
- />
- </div>
- </div>
- </>
- )}
- </ConfirmationDialogController>
- <div>
- <p className="text-muted-foreground text-sm">
- Only enabled models can be requested through this credential.{" "}
- {enabledCount} of {models.length} enabled.
- </p>
- </div>
- {result.success ? (
- <GatewayConnectionModelsTable
- models={models}
- allowedModels={connection.allowedModels}
- isSaving={isSaving}
- onEnableAll={enableAll}
- onDisableAll={disableAll}
- onSetEnabled={setModelsEnabled}
- />
- ) : (
- <div className="flex flex-col gap-2">
- <Alert variant="destructive">
- <Alert.Title>Models could not be loaded</Alert.Title>
- <Alert.Description>
- The provider returned a model discovery error. Refresh the
- provider before changing model access.
- </Alert.Description>
- </Alert>
- </div>
- )}
- </div>
+ <GatewayConnectionModelsTable
+ models={models}
+ allowedModels={connection.allowedModels}
+ isSaving={isSaving}
+ onEnableAll={enableAll}
+ onDisableAll={disableAll}
+ onSetEnabled={setModelsEnabled}
+ />
);
}
diff --git a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsLoadError.tsx b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsLoadError.tsx
index cd79cdb90e..b128b0403a 100644
--- a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsLoadError.tsx
+++ b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsLoadError.tsx
@@ -1,30 +1,33 @@
-import { ArrowLeft } from "@langfuse/icons";
-
import { Alert } from "@/src/components/design-system/Alert/Alert";
import { Button } from "@/src/components/design-system/Button/Button";
-import { TextLink } from "@/src/components/design-system/TextLink/TextLink";
+
+const loadErrorCopy = {
+ connection: {
+ title: "Provider credential could not be loaded",
+ description: "Retry to manage model access for this credential.",
+ },
+ models: {
+ title: "Provider models could not be loaded",
+ description: "Retry to manage model access for this credential.",
+ },
+} as const;
export type ConnectionModelsLoadErrorProps = {
- organizationId: string;
+ kind: keyof typeof loadErrorCopy;
retry: () => void;
};
export function ConnectionModelsLoadError({
- organizationId,
+ kind,
retry,
}: ConnectionModelsLoadErrorProps) {
+ const copy = loadErrorCopy[kind];
+
return (
<div className="flex flex-col gap-4">
- <TextLink
- path={`/organization/${encodeURIComponent(organizationId)}/settings/ai-gateway-providers`}
- value="Provider credentials"
- icon={ArrowLeft}
- />
<Alert variant="destructive">
- <Alert.Title>Provider models could not be loaded</Alert.Title>
- <Alert.Description>
- Retry to manage model access for this credential.
- </Alert.Description>
+ <Alert.Title>{copy.title}</Alert.Title>
+ <Alert.Description>{copy.description}</Alert.Description>
</Alert>
<div>
<Button text="Retry" variant="secondary" onClick={retry} />
diff --git a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsSkeleton.tsx b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsSkeleton.tsx
deleted file mode 100644
index cc9125beaf..0000000000
--- a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsSkeleton.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { Skeleton } from "@/src/components/ui/skeleton";
-
-export function ConnectionModelsSkeleton() {
- return (
- <div className="flex flex-col gap-4">
- <Skeleton className="h-5 w-36" />
- <Skeleton className="h-7 w-52" />
- <Skeleton className="h-64 w-full" />
- </div>
- );
-}
diff --git a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsSkeleton/ConnectionModelsSkeleton.stories.tsx b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsSkeleton/ConnectionModelsSkeleton.stories.tsx
new file mode 100644
index 0000000000..82aa7791b4
--- /dev/null
+++ b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsSkeleton/ConnectionModelsSkeleton.stories.tsx
@@ -0,0 +1,6 @@
+import preview from "@/.storybook/preview";
+import { ConnectionModelsSkeleton } from "./ConnectionModelsSkeleton";
+
+const meta = preview.meta({ component: ConnectionModelsSkeleton });
+
+export const Loading = meta.story({});
diff --git a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsSkeleton/ConnectionModelsSkeleton.tsx b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsSkeleton/ConnectionModelsSkeleton.tsx
new file mode 100644
index 0000000000..2f9b475632
--- /dev/null
+++ b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsSkeleton/ConnectionModelsSkeleton.tsx
@@ -0,0 +1,16 @@
+import { Skeleton, SkeletonGroup } from "@/src/components/ui/skeleton";
+
+export function ConnectionModelsSkeleton() {
+ return (
+ <SkeletonGroup className="flex min-h-0 flex-1 flex-col gap-3">
+ <div className="flex items-center justify-between gap-3">
+ <Skeleton className="h-8 w-56" />
+ <div className="flex gap-2">
+ <Skeleton className="h-8 w-24" />
+ <Skeleton className="h-8 w-24" />
+ </div>
+ </div>
+ <Skeleton className="min-h-64 w-full flex-1" />
+ </SkeletonGroup>
+ );
+}
diff --git a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionSummary/ConnectionSummary.stories.tsx b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionSummary/ConnectionSummary.stories.tsx
new file mode 100644
index 0000000000..0a62d09137
--- /dev/null
+++ b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionSummary/ConnectionSummary.stories.tsx
@@ -0,0 +1,61 @@
+import type { ComponentProps } from "react";
+import { fn } from "storybook/test";
+
+import preview from "@/.storybook/preview";
+import { ConnectionSummary } from "./ConnectionSummary";
+
+const meta = preview.meta({ component: ConnectionSummary });
+
+const connection = {
+ id: "connection-openai",
+ name: "OpenAI production",
+ provider: "OPENAI",
+ displaySecret: "sk-proj-...7d3a",
+ status: "ENABLED",
+ organizationId: "org-1",
+ createdById: "user-1",
+ allowedModels: null,
+ createdAt: new Date("2026-09-07T12:00:00.000Z"),
+ updatedAt: new Date("2026-09-07T12:00:00.000Z"),
+} satisfies NonNullable<ComponentProps<typeof ConnectionSummary>["connection"]>;
+
+const actions = {
+ isDeleting: false,
+ isError: false,
+ isRetrying: false,
+ onDelete: fn(async () => {}),
+ onRefresh: fn(),
+ onRetry: fn(),
+};
+
+export const AllModels = meta.story({
+ args: { ...actions, connection },
+});
+
+export const SelectedModels = meta.story({
+ args: {
+ ...actions,
+ connection: { ...connection, allowedModels: ["gpt-4o"] },
+ },
+});
+
+export const Anthropic = meta.story({
+ args: {
+ ...actions,
+ connection: {
+ ...connection,
+ id: "connection-anthropic",
+ name: "Anthropic production",
+ provider: "ANTHROPIC",
+ displaySecret: "sk-ant-...91bc",
+ },
+ },
+});
+
+export const Loading = meta.story({
+ args: { ...actions, connection: undefined },
+});
+
+export const LoadError = meta.story({
+ args: { ...actions, connection: undefined, isError: true },
+});
diff --git a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionSummary/ConnectionSummary.tsx b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionSummary/ConnectionSummary.tsx
new file mode 100644
index 0000000000..775ddd17b4
--- /dev/null
+++ b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionSummary/ConnectionSummary.tsx
@@ -0,0 +1,105 @@
+import { RefreshCw, Trash2 } from "@langfuse/icons";
+
+import { ConfirmationDialogController } from "@/src/components/design-system/ConfirmationDialogController/ConfirmationDialogController";
+import { IconButton } from "@/src/components/design-system/IconButton/IconButton";
+import { Skeleton, SkeletonGroup } from "@/src/components/ui/skeleton";
+import { GatewayProviderMark } from "@/src/features/ai-gateway/components/GatewayProviderMark";
+import { ConnectionModelsLoadError } from "@/src/features/ai-gateway/components/GatewayConnectionModelsPage/components/ConnectionModelsLoadError";
+import { providerLabels } from "@/src/features/ai-gateway/constants/providerLabels";
+import { describeGatewayModelAccess } from "@/src/features/ai-gateway/fns/describeGatewayModelAccess";
+import type { GatewayConnection } from "@/src/features/ai-gateway/types/gatewayProvider";
+
+export type ConnectionSummaryProps = {
+ connection: GatewayConnection | undefined;
+ isDeleting: boolean;
+ isError: boolean;
+ isRetrying: boolean;
+ onDelete: (connection: GatewayConnection) => Promise<void>;
+ onRefresh: () => void;
+ onRetry: () => void;
+};
+
+export function ConnectionSummary({
+ connection,
+ isDeleting,
+ isError,
+ isRetrying,
+ onDelete,
+ onRefresh,
+ onRetry,
+}: ConnectionSummaryProps) {
+ if (!connection) {
+ if (isError) {
+ return <ConnectionModelsLoadError kind="connection" retry={onRetry} />;
+ }
+ return (
+ <>
+ <ConnectionDetailsSkeleton />
+ <span className="sr-only">Loading provider credential</span>
+ </>
+ );
+ }
+
+ const access = describeGatewayModelAccess(
+ connection.allowedModels,
+ connection.provider,
+ );
+ const deleteConnection = () => onDelete(connection);
+
+ return (
+ <>
+ <ConfirmationDialogController
+ title="Delete provider credential"
+ text={`Delete “${connection.name}”? Requests will immediately stop using it.`}
+ confirmLabel="Delete credential"
+ variant="destructive"
+ loading={isDeleting}
+ onConfirm={deleteConnection}
+ >
+ {({ openDialog }) => (
+ <div className="flex items-center justify-between gap-4">
+ <div className="flex min-w-0 items-center gap-2">
+ <GatewayProviderMark provider={connection.provider} />
+ <h2
+ className="truncate text-lg font-bold"
+ title={connection.name}
+ >
+ {connection.name}
+ <span className="sr-only">
+ {" "}
+ ({providerLabels[connection.provider]})
+ </span>
+ </h2>
+ </div>
+ <div className="flex shrink-0 -translate-y-px items-center gap-2">
+ <IconButton
+ icon={RefreshCw}
+ label="Refresh provider models"
+ variant="outline"
+ disabled={isRetrying || isDeleting}
+ onClick={onRefresh}
+ />
+ <IconButton
+ icon={Trash2}
+ label="Delete provider credential"
+ variant="outlineDestructive"
+ disabled={isDeleting}
+ onClick={openDialog}
+ />
+ </div>
+ </div>
+ )}
+ </ConfirmationDialogController>
+ <p className="text-muted-foreground text-sm">{access}</p>
+ </>
+ );
+}
+
+function ConnectionDetailsSkeleton() {
+ return (
+ <SkeletonGroup className="flex flex-col gap-3">
+ <Skeleton className="h-7 w-52" />
+ <Skeleton className="h-10 w-full max-w-2xl" />
+ </SkeletonGroup>
+ );
+}
diff --git a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/hooks/useGatewayConnectionModels.ts b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/hooks/useGatewayConnectionModels.ts
index ec82d3fe09..ad840dcead 100644
--- a/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/hooks/useGatewayConnectionModels.ts
+++ b/web/src/features/ai-gateway/components/GatewayConnectionModelsPage/hooks/useGatewayConnectionModels.ts
@@ -1,3 +1,4 @@
+import { gatewayConnectionsPageSize } from "@/src/features/ai-gateway/constants/gatewayConnectionsPageSize";
import { api } from "@/src/utils/api";
export function useGatewayConnectionModels({
@@ -9,7 +10,16 @@ export function useGatewayConnectionModels({
}) {
const utils = api.useUtils();
const input = { orgId: organizationId, id: connectionId };
- const connectionQuery = api.aiGateway.getConnection.useQuery(input);
+ const connectionQuery = api.aiGateway.getConnection.useQuery(input, {
+ placeholderData: () =>
+ utils.aiGateway.listConnections
+ .getInfiniteData({
+ orgId: organizationId,
+ limit: gatewayConnectionsPageSize,
+ })
+ ?.pages.flatMap((page) => page.data)
+ .find((connection) => connection.id === connectionId),
+ });
const modelsQuery = api.aiGateway.getConnectionModels.useQuery(input);
const updateModels = api.aiGateway.updateConnectionModels.useMutation({
onSuccess: async (connection) => {
diff --git a/web/src/features/ai-gateway/components/GatewayProviderMark.tsx b/web/src/features/ai-gateway/components/GatewayProviderMark.tsx
new file mode 100644
index 0000000000..8d77fc9c65
--- /dev/null
+++ b/web/src/features/ai-gateway/components/GatewayProviderMark.tsx
@@ -0,0 +1,21 @@
+import { providerIcons } from "@/src/features/ai-gateway/constants/providerIcons";
+import { providerLabels } from "@/src/features/ai-gateway/constants/providerLabels";
+import type { GatewayProvider } from "@/src/features/ai-gateway/types/gatewayProvider";
+
+export type GatewayProviderMarkProps = {
+ provider: GatewayProvider;
+};
+
+export function GatewayProviderMark({ provider }: GatewayProviderMarkProps) {
+ const ProviderIcon = providerIcons[provider];
+
+ return (
+ <span
+ aria-hidden="true"
+ className="bg-muted flex size-7 shrink-0 items-center justify-center rounded-md border"
+ title={providerLabels[provider]}
+ >
+ <ProviderIcon size="base" />
+ </span>
+ );
+}
diff --git a/web/src/features/ai-gateway/components/GatewayProvidersPage/GatewayProvidersPage.tsx b/web/src/features/ai-gateway/components/GatewayProvidersPage/GatewayProvidersPage.tsx
index db858623a8..5fc9f2e276 100644
--- a/web/src/features/ai-gateway/components/GatewayProvidersPage/GatewayProvidersPage.tsx
+++ b/web/src/features/ai-gateway/components/GatewayProvidersPage/GatewayProvidersPage.tsx
@@ -9,6 +9,7 @@ import { Skeleton } from "@/src/components/ui/skeleton";
import { GatewayConnectionModelsPage } from "@/src/features/ai-gateway/components/GatewayConnectionModelsPage/GatewayConnectionModelsPage";
import { ProviderDialogController } from "@/src/features/ai-gateway/components/GatewayProvidersPage/components/ProviderDialogController/ProviderDialogController";
import { GatewayProvidersTable } from "@/src/features/ai-gateway/components/GatewayProvidersPage/components/GatewayProvidersTable/GatewayProvidersTable";
+import { gatewayConnectionsPageSize } from "@/src/features/ai-gateway/constants/gatewayConnectionsPageSize";
import { buildGatewayModelsUrl } from "@/src/features/ai-gateway/fns/gatewayUrls/buildGatewayModelsUrl";
import { isGatewayModelAllowed } from "@/src/features/ai-gateway/fns/isGatewayModelAllowed";
import { toGatewayAllowedModelsSet } from "@/src/features/ai-gateway/fns/toGatewayAllowedModelsSet";
@@ -26,7 +27,7 @@ export function GatewayProvidersPage({
? router.query.connectionId
: undefined;
const connectionsQuery = api.aiGateway.listConnections.useInfiniteQuery(
- { orgId: organizationId, limit: 100 },
+ { orgId: organizationId, limit: gatewayConnectionsPageSize },
{
enabled: !connectionId,
getNextPageParam: (lastPage) => lastPage.nextCursor ?? undefined,
diff --git a/web/src/features/ai-gateway/components/GatewayProvidersPage/components/GatewayProvidersTable/GatewayProvidersTable.tsx b/web/src/features/ai-gateway/components/GatewayProvidersPage/components/GatewayProvidersTable/GatewayProvidersTable.tsx
index 9697ade8b1..4e3cf2b9bc 100644
--- a/web/src/features/ai-gateway/components/GatewayProvidersPage/components/GatewayProvidersTable/GatewayProvidersTable.tsx
+++ b/web/src/features/ai-gateway/components/GatewayProvidersPage/components/GatewayProvidersTable/GatewayProvidersTable.tsx
@@ -1,12 +1,11 @@
-/* eslint-disable no-nested-ternary */
import { useMemo } from "react";
-import { ListTree, Pencil, RefreshCw, Route, Trash2 } from "@langfuse/icons";
-import { SiAnthropic, SiOpenai } from "@langfuse/icons/si";
+import { ListTree, Pencil, RefreshCw, Trash2 } from "@langfuse/icons";
import { SettingsTable } from "@/src/components/SettingsTable/SettingsTable";
import { createStatusTableColumn } from "@/src/components/design-system/table/columns/createStatusTableColumn";
import { createTextTableColumn } from "@/src/components/design-system/table/columns/createTextTableColumn";
import type { LangfuseColumnDef } from "@/src/components/table/types";
+import { GatewayProviderMark } from "@/src/features/ai-gateway/components/GatewayProviderMark";
import { providerLabels } from "@/src/features/ai-gateway/constants/providerLabels";
import type {
GatewayConnection,
@@ -139,20 +138,9 @@ function ModelCount({
}
function ProviderName({ provider }: { provider: GatewayProvider }) {
- const icon =
- provider === "OPENAI" ? (
- <SiOpenai size="base" aria-hidden="true" />
- ) : provider === "ANTHROPIC" ? (
- <SiAnthropic size="base" aria-hidden="true" />
- ) : (
- <Route size="base" aria-hidden="true" />
- );
-
return (
<div className="flex items-center gap-2">
- <span className="bg-muted flex size-7 items-center justify-center rounded-md border">
- {icon}
- </span>
+ <GatewayProviderMark provider={provider} />
<span>{providerLabels[provider]}</span>
</div>
);
diff --git a/web/src/features/ai-gateway/constants/gatewayConnectionsPageSize.ts b/web/src/features/ai-gateway/constants/gatewayConnectionsPageSize.ts
new file mode 100644
index 0000000000..9ff05a41f3
--- /dev/null
+++ b/web/src/features/ai-gateway/constants/gatewayConnectionsPageSize.ts
@@ -0,0 +1 @@
+export const gatewayConnectionsPageSize = 100;
diff --git a/web/src/features/ai-gateway/fns/describeGatewayModelAccess.ts b/web/src/features/ai-gateway/fns/describeGatewayModelAccess.ts
new file mode 100644
index 0000000000..604a8228be
--- /dev/null
+++ b/web/src/features/ai-gateway/fns/describeGatewayModelAccess.ts
@@ -0,0 +1,15 @@
+import { providerLabels } from "@/src/features/ai-gateway/constants/providerLabels";
+import type { GatewayProvider } from "@/src/features/ai-gateway/types/gatewayProvider";
+
+export function describeGatewayModelAccess(
+ allowedModels: string[] | null,
+ provider: GatewayProvider,
+) {
+ const providerLabel = providerLabels[provider];
+
+ if (allowedModels === null) {
+ return `Gateway keys can call every ${providerLabel} model, including models ${providerLabel} publishes in the future.`;
+ }
+
+ return `Gateway keys can call only the models you selected. Models ${providerLabel} publishes in the future stay off until you enable them here.`;
+}