Skip to content

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

feat(web): link AI Gateway docs from page descriptions (#19575)

Tobias Wochingerd2de2053eb94
diff --git a/web/src/features/ai-gateway/components/GatewayAnalyticsPage/components/GatewayAnalyticsHeader/GatewayAnalyticsHeader.tsx b/web/src/features/ai-gateway/components/GatewayAnalyticsPage/components/GatewayAnalyticsHeader/GatewayAnalyticsHeader.tsx
index a9ba8c6bd3..f600b90213 100644
--- a/web/src/features/ai-gateway/components/GatewayAnalyticsPage/components/GatewayAnalyticsHeader/GatewayAnalyticsHeader.tsx
+++ b/web/src/features/ai-gateway/components/GatewayAnalyticsPage/components/GatewayAnalyticsHeader/GatewayAnalyticsHeader.tsx
@@ -1,6 +1,8 @@
import type { ReactNode } from "react";
import Header from "@/src/components/layouts/header";
+import { Button } from "@/src/components/design-system/Button/Button";
+import { GATEWAY_ANALYTICS_DOCS_URL } from "@/src/features/ai-gateway/constants/gatewayDocsUrls";
export type GatewayAnalyticsHeaderProps = {
/** Filters shown next to the title. */
@@ -11,16 +13,20 @@ export function GatewayAnalyticsHeader({
children,
}: GatewayAnalyticsHeaderProps) {
return (
- <div className="flex flex-wrap items-center gap-3">
- <Header
- title="Gateway analytics"
- className="mb-0!"
- help={{
- description:
- "Cost and usage of requests made through the AI Gateway, read from its ingestion project.",
- }}
- />
- {children}
+ <div className="flex flex-col gap-1">
+ <div className="flex flex-wrap items-center gap-3">
+ <Header title="Gateway analytics" className="mb-0!" />
+ {children}
+ </div>
+ <p className="text-muted-foreground text-sm">
+ Cost and usage of requests made through the AI Gateway, read from its
+ ingestion project.{" "}
+ <Button
+ variant="text"
+ text="How gateway analytics work"
+ href={GATEWAY_ANALYTICS_DOCS_URL}
+ />
+ </p>
</div>
);
}
diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/AGENTS.md b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/AGENTS.md
index be6905f1aa..f18b52f7db 100644
--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/AGENTS.md
+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/AGENTS.md
@@ -6,14 +6,11 @@ Snippets shown after a gateway API key is created, one builder per tab.
The Langfuse docs own this content. These builders are a condensed copy:
-- API: https://langfuse.com/docs/ai-gateway/get-started
+- API: https://langfuse.com/docs/ai-gateway/get-started/first-request
- Claude Code: https://langfuse.com/docs/ai-gateway/coding-agents/claude-code
- Codex: https://langfuse.com/docs/ai-gateway/coding-agents/codex
- OpenCode: https://langfuse.com/docs/ai-gateway/coding-agents/opencode
-- Copilot CLI (no Langfuse page yet, follows GitHub's docs):
- https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models
-- GitHub Copilot app (no Langfuse page yet, follows GitHub's docs):
- https://docs.github.com/en/copilot/how-tos/github-copilot-app/add-llm-models
+- GitHub Copilot CLI and app: https://langfuse.com/docs/ai-gateway/coding-agents/github-copilot
Change the docs first (`langfuse/langfuse-docs`), then mirror the change here.
Do not add steps, paths or env vars that the docs do not describe.
diff --git a/web/src/features/ai-gateway/components/GatewayLaunch/GatewayLaunchDialog.tsx b/web/src/features/ai-gateway/components/GatewayLaunch/GatewayLaunchDialog.tsx
index 6d5c84e308..e646e7eac3 100644
--- a/web/src/features/ai-gateway/components/GatewayLaunch/GatewayLaunchDialog.tsx
+++ b/web/src/features/ai-gateway/components/GatewayLaunch/GatewayLaunchDialog.tsx
@@ -15,6 +15,7 @@ import {
} from "@/src/features/ai-gateway/hooks/useGatewayLaunchEligibility";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
import { GatewayHero } from "@/src/features/ai-gateway/components/GatewayLaunch/GatewayHero";
+import { GATEWAY_DOCS_URL } from "@/src/features/ai-gateway/constants/gatewayDocsUrls";
const copy = {
admin: {
@@ -92,7 +93,7 @@ export function GatewayLaunchDialog({
</div>
<div className="flex shrink-0 items-center justify-between border-t px-8 py-4">
<Link
- href="https://langfuse.com/docs/ai-gateway"
+ href={GATEWAY_DOCS_URL}
target="_blank"
rel="noopener noreferrer"
onClick={() =>
diff --git a/web/src/features/ai-gateway/components/GatewayModelsPage/components/ConnectedGatewayModelsTable/ConnectedGatewayModelsTable.tsx b/web/src/features/ai-gateway/components/GatewayModelsPage/components/ConnectedGatewayModelsTable/ConnectedGatewayModelsTable.tsx
index 894bd03cdb..fb11a86aa8 100644
--- a/web/src/features/ai-gateway/components/GatewayModelsPage/components/ConnectedGatewayModelsTable/ConnectedGatewayModelsTable.tsx
+++ b/web/src/features/ai-gateway/components/GatewayModelsPage/components/ConnectedGatewayModelsTable/ConnectedGatewayModelsTable.tsx
@@ -116,19 +116,17 @@ export function ConnectedGatewayModelsTable({
return (
<div className="flex h-full min-h-0 flex-col gap-4">
- <Header
- title="Gateway models"
- actionButtons={
+ <div>
+ <Header title="Gateway models" />
+ <p className="text-muted-foreground text-sm">
+ These models are enabled and available to use through the AI Gateway.{" "}
<Button
- variant="secondary"
- text="Docs"
+ variant="text"
+ text="How model management works"
href={GATEWAY_MODELS_DOCS_URL}
/>
- }
- />
- <p className="text-muted-foreground text-sm">
- These models are enabled and available to use through the AI Gateway.
- </p>
+ </p>
+ </div>
{failedProviderCount > 0 ? (
<Alert variant="warning">
diff --git a/web/src/features/ai-gateway/components/GatewayNotDeployedNotice/GatewayNotDeployedNotice.tsx b/web/src/features/ai-gateway/components/GatewayNotDeployedNotice/GatewayNotDeployedNotice.tsx
index f6e2db9aa3..80ca570ae9 100644
--- a/web/src/features/ai-gateway/components/GatewayNotDeployedNotice/GatewayNotDeployedNotice.tsx
+++ b/web/src/features/ai-gateway/components/GatewayNotDeployedNotice/GatewayNotDeployedNotice.tsx
@@ -2,8 +2,7 @@ import { Server } from "@langfuse/icons";
import Header from "@/src/components/layouts/header";
import { GatewaySetupEmptyState } from "@/src/features/ai-gateway/components/GatewaySetupEmptyState/GatewaySetupEmptyState";
-
-const SELF_HOSTING_DOCS_URL = "https://langfuse.com/self-hosting";
+import { GATEWAY_SELF_HOSTING_DOCS_URL } from "@/src/features/ai-gateway/constants/gatewayDocsUrls";
export function GatewayNotDeployedNotice() {
return (
@@ -16,8 +15,8 @@ export function GatewayNotDeployedNotice() {
actions={[
{
type: "link",
- label: "Self-hosting docs",
- href: SELF_HOSTING_DOCS_URL,
+ label: "Self-hosting guide",
+ href: GATEWAY_SELF_HOSTING_DOCS_URL,
},
]}
/>
diff --git a/web/src/features/ai-gateway/components/GatewaySetupPage/components/GatewayCredentialsOverview/GatewayCredentialsOverview.tsx b/web/src/features/ai-gateway/components/GatewaySetupPage/components/GatewayCredentialsOverview/GatewayCredentialsOverview.tsx
index 7b74fba02c..9cef6162ea 100644
--- a/web/src/features/ai-gateway/components/GatewaySetupPage/components/GatewayCredentialsOverview/GatewayCredentialsOverview.tsx
+++ b/web/src/features/ai-gateway/components/GatewaySetupPage/components/GatewayCredentialsOverview/GatewayCredentialsOverview.tsx
@@ -5,6 +5,7 @@ import Header from "@/src/components/layouts/header";
import { Alert } from "@/src/components/design-system/Alert/Alert";
import { ConfirmationDialogController } from "@/src/components/design-system/ConfirmationDialogController/ConfirmationDialogController";
import { Button } from "@/src/components/ui/button";
+import { Button as TextButton } from "@/src/components/design-system/Button/Button";
import { Skeleton } from "@/src/components/ui/skeleton";
import { GatewayConnectionModelsPage } from "@/src/features/ai-gateway/components/GatewayConnectionModelsPage/GatewayConnectionModelsPage";
import { IngestionDialogController } from "@/src/features/ai-gateway/components/GatewaySetupPage/components/GatewayCredentialsOverview/components/IngestionDialogController/IngestionDialogController";
@@ -221,7 +222,12 @@ export function GatewayCredentialsOverview({
}
/>
<p className="text-muted-foreground text-sm">
- {GATEWAY_SETUP.description}
+ {GATEWAY_SETUP.description}{" "}
+ <TextButton
+ variant="text"
+ text="How to set up the gateway"
+ href={GATEWAY_SETUP.docsUrl}
+ />
</p>
</div>
<section className="flex min-h-0 flex-1 flex-col">
diff --git a/web/src/features/ai-gateway/components/GatewaySetupPage/components/GatewaySetupContent.tsx b/web/src/features/ai-gateway/components/GatewaySetupPage/components/GatewaySetupContent.tsx
index 88494cc182..4d44630d76 100644
--- a/web/src/features/ai-gateway/components/GatewaySetupPage/components/GatewaySetupContent.tsx
+++ b/web/src/features/ai-gateway/components/GatewaySetupPage/components/GatewaySetupContent.tsx
@@ -1,6 +1,7 @@
import { useState } from "react";
import Header from "@/src/components/layouts/header";
+import { Button } from "@/src/components/design-system/Button/Button";
import { GatewayCredentialsOverview } from "@/src/features/ai-gateway/components/GatewaySetupPage/components/GatewayCredentialsOverview/GatewayCredentialsOverview";
import { ConnectedGatewaySetupGuide } from "@/src/features/ai-gateway/components/GatewaySetupPage/components/ConnectedGatewaySetupGuide";
import { GATEWAY_SETUP } from "@/src/features/ai-gateway/components/GatewaySetupPage/constants/gatewaySetup";
@@ -53,7 +54,12 @@ export function GatewaySetupContent({
<div>
<Header title={GATEWAY_SETUP.title} />
<p className="text-muted-foreground text-sm">
- {GATEWAY_SETUP.description}
+ {GATEWAY_SETUP.description}{" "}
+ <Button
+ variant="text"
+ text="How to set up the gateway"
+ href={GATEWAY_SETUP.docsUrl}
+ />
</p>
</div>
<ConnectedGatewaySetupGuide
diff --git a/web/src/features/ai-gateway/components/GatewaySetupPage/constants/gatewaySetup.ts b/web/src/features/ai-gateway/components/GatewaySetupPage/constants/gatewaySetup.ts
index b8239501a4..240b5f1dc0 100644
--- a/web/src/features/ai-gateway/components/GatewaySetupPage/constants/gatewaySetup.ts
+++ b/web/src/features/ai-gateway/components/GatewaySetupPage/constants/gatewaySetup.ts
@@ -1,6 +1,8 @@
+import { GATEWAY_SETUP_DOCS_URL } from "@/src/features/ai-gateway/constants/gatewayDocsUrls";
+
export const GATEWAY_SETUP = {
title: "Gateway setup",
description:
"Connect provider credentials and choose how gateway traffic is recorded in Langfuse.",
- docsUrl: "https://langfuse.com/docs/ai-gateway",
+ docsUrl: GATEWAY_SETUP_DOCS_URL,
} as const;
diff --git a/web/src/features/ai-gateway/constants/agentSetupInstructions.ts b/web/src/features/ai-gateway/constants/agentSetupInstructions.ts
index 991d2ea5e7..b2b0fd7c41 100644
--- a/web/src/features/ai-gateway/constants/agentSetupInstructions.ts
+++ b/web/src/features/ai-gateway/constants/agentSetupInstructions.ts
@@ -1,15 +1,16 @@
-import { GATEWAY_DOCS_URL } from "./gatewayDocsUrls";
+import {
+ GATEWAY_CODING_AGENTS_DOCS_URL,
+ GATEWAY_FIRST_REQUEST_DOCS_URL,
+} from "./gatewayDocsUrls";
export const GATEWAY_KEY_PLACEHOLDER = "<your-gateway-key>";
export const AGENT_SETUP_DOCS_URLS = {
- api: `${GATEWAY_DOCS_URL}/get-started`,
- "claude-desktop": `${GATEWAY_DOCS_URL}/coding-agents/claude-code#claude-desktop`,
- "claude-code": `${GATEWAY_DOCS_URL}/coding-agents/claude-code#claude-code-cli`,
- codex: `${GATEWAY_DOCS_URL}/coding-agents/codex`,
- opencode: `${GATEWAY_DOCS_URL}/coding-agents/opencode`,
- "copilot-cli":
- "https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models",
- "copilot-desktop":
- "https://docs.github.com/en/copilot/how-tos/github-copilot-app/add-llm-models",
+ api: GATEWAY_FIRST_REQUEST_DOCS_URL,
+ "claude-desktop": `${GATEWAY_CODING_AGENTS_DOCS_URL}/claude-code#claude-desktop`,
+ "claude-code": `${GATEWAY_CODING_AGENTS_DOCS_URL}/claude-code#claude-code-cli`,
+ codex: `${GATEWAY_CODING_AGENTS_DOCS_URL}/codex`,
+ opencode: `${GATEWAY_CODING_AGENTS_DOCS_URL}/opencode`,
+ "copilot-cli": `${GATEWAY_CODING_AGENTS_DOCS_URL}/github-copilot#cli`,
+ "copilot-desktop": `${GATEWAY_CODING_AGENTS_DOCS_URL}/github-copilot#app`,
} as const;
diff --git a/web/src/features/ai-gateway/constants/gatewayDocsUrls.ts b/web/src/features/ai-gateway/constants/gatewayDocsUrls.ts
index a7c6534a26..6939bf111f 100644
--- a/web/src/features/ai-gateway/constants/gatewayDocsUrls.ts
+++ b/web/src/features/ai-gateway/constants/gatewayDocsUrls.ts
@@ -1,4 +1,11 @@
export const GATEWAY_DOCS_URL = "https://langfuse.com/docs/ai-gateway";
-export const GATEWAY_MODELS_DOCS_URL = `${GATEWAY_DOCS_URL}/get-started#add-provider-connections`;
-export const GATEWAY_API_KEYS_DOCS_URL = `${GATEWAY_DOCS_URL}/get-started#create-a-gateway-api-key`;
+export const GATEWAY_SETUP_DOCS_URL = `${GATEWAY_DOCS_URL}/get-started/admin-setup`;
+export const GATEWAY_FIRST_REQUEST_DOCS_URL = `${GATEWAY_DOCS_URL}/get-started/first-request`;
+export const GATEWAY_MODELS_DOCS_URL = `${GATEWAY_DOCS_URL}/features/models`;
+export const GATEWAY_API_KEYS_DOCS_URL = `${GATEWAY_DOCS_URL}/features/api-keys`;
+export const GATEWAY_ANALYTICS_DOCS_URL = `${GATEWAY_DOCS_URL}/features/analytics`;
+export const GATEWAY_CODING_AGENTS_DOCS_URL = `${GATEWAY_DOCS_URL}/coding-agents`;
+
+export const GATEWAY_SELF_HOSTING_DOCS_URL =
+ "https://langfuse.com/self-hosting/configuration/ai-gateway";