Skip to content

Add AI Gateway integration docs#2059

Open
ddanielcruzz wants to merge 10 commits into
mainfrom
codex/agent-framework-gateway-docs
Open

Add AI Gateway integration docs#2059
ddanielcruzz wants to merge 10 commits into
mainfrom
codex/agent-framework-gateway-docs

Conversation

@ddanielcruzz

@ddanielcruzz ddanielcruzz commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary:

  • Adds an AI Gateway integrations overview with setup guidance for gateway keys and routes.
  • Adds one integration page per supported framework or SDK under AI Gateway > Integrations.
  • Groups TypeScript, JavaScript, Python, Go, and .NET examples on the same framework page instead of splitting by language.
  • Updates docs navigation so AI Gateway has nested Integrations entries for each page.

Checks:

  • uv run prek --files docs/nav.json docs/reference/advanced/gateway/agent-frameworks.md docs/reference/advanced/gateway/integrations/*.md

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds an AI Gateway integrations overview and navigation subgroup covering multiple frameworks and SDKs. New reference pages document gateway configuration, API-key setup, OpenAI-compatible or provider-native routes, runnable examples, verification steps, and troubleshooting for Agno, Genkit, Google ADK, Haystack, Instructor, LangChain, LlamaIndex, Mastra, Microsoft Agent Framework, OpenAI SDKs, Semantic Kernel, Smolagents, Strands Agents, Vercel AI SDK, and VoltAgent. Existing gateway links now use canonical absolute paths.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding AI Gateway integration docs.
Description check ✅ Passed The description matches the changeset, covering the integrations overview, per-framework pages, and navigation updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/agent-framework-gateway-docs

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/integrations/agent-frameworks/mastra.md`:
- Line 169: The agent lookup in the Mastra examples uses the wrong identifier,
so update the calls to match the registered id used in the setup code. In the
relevant snippets around the getAgent usage, replace the mismatched weatherAgent
lookup with the registered weather-agent id, and apply the same correction in
the gateway example so both examples resolve the same agent consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 193c5756-4fee-4f61-87dc-68c68039c2b0

📥 Commits

Reviewing files that changed from the base of the PR and between d8deada and d13f857.

📒 Files selected for processing (2)
  • docs/integrations/agent-frameworks/mastra.md
  • docs/integrations/agent-frameworks/vercel-ai-sdk.md
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • pydantic/logfire (manual)
  • pydantic/pydantic-ai (manual)
  • pydantic/pydantic (auto-detected)


async function main() {
try {
const result = await mastra.getAgent('weatherAgent').generate('What is the weather in London?');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use the registered agent id here.

Both snippets register the agent as id: 'weather-agent', but getAgent('weatherAgent') looks up a different identifier. Copied code will fail to resolve the agent.

💡 Suggested fix
-    const result = await mastra.getAgent('weatherAgent').generate('What is the weather in London?');
+    const result = await mastra.getAgent('weather-agent').generate('What is the weather in London?');

Apply the same replacement in the gateway example too.

Also applies to: 291-291

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/integrations/agent-frameworks/mastra.md` at line 169, The agent lookup
in the Mastra examples uses the wrong identifier, so update the calls to match
the registered id used in the setup code. In the relevant snippets around the
getAgent usage, replace the mismatched weatherAgent lookup with the registered
weather-agent id, and apply the same correction in the gateway example so both
examples resolve the same agent consistently.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/integrations/agent-frameworks/mastra.md">

<violation number="1">
P1: The agent's weather tool won't work: `execute: async ({ context })` destructures `context` from the tool's input data, but the inputSchema defines `{ city }`, so `context` is `undefined` and `context.city` collapses at runtime. The first parameter is the validated input fields directly (`inputData: TSchemaIn`); the execution context is the second parameter. Change to `execute: async ({ city }) => ({ city, tempC: 21 })`.</violation>

<violation number="2">
P2: The example no longer flushes telemetry before exit. Short-lived scripts that make one agent call and exit immediately risk losing all trace data because the OTLP batch exporter may not have sent the spans before the process terminates. Add `await mastra.observability.flush()` before `console.log()` or in a `finally` block, and mention the flush requirement in the Common pitfalls section so readers don't copy a silently broken pattern.</violation>
</file>

<file name="docs/integrations/agent-frameworks/vercel-ai-sdk.md">

<violation number="1">
P1: TypeScript/ESM syntax error: `import` declarations cannot follow a statement. The code block shows `import * as logfire from '...'`, then `logfire.configure(...)`, then more `import { ... } from 'ai'`. This will fail to parse with tsx, ts-node, or any TypeScript compiler. Move all imports to the top of the file before any statements.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/reference/advanced/gateway/agent-frameworks.md`:
- Around line 31-33: The gateway docs use inconsistent environment variable
names between the agent-frameworks page and the gateway index page; choose a
single canonical name and update both references to match, or explicitly
document why `LOGFIRE_GATEWAY_API_KEY` and `PYDANTIC_AI_GATEWAY_API_KEY` differ.
Update the env schema example in the gateway docs and the corresponding mention
in the index page so readers see one consistent gateway API key variable name
throughout.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b86febdf-a969-4c78-a32e-9f07acabc9fa

📥 Commits

Reviewing files that changed from the base of the PR and between 5b8246f and 747c73f.

📒 Files selected for processing (1)
  • docs/reference/advanced/gateway/agent-frameworks.md
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • pydantic/logfire (manual)
  • pydantic/pydantic-ai (manual)
  • pydantic/pydantic (auto-detected)

Comment on lines +31 to +33
const envSchema = z.object({
LOGFIRE_GATEWAY_API_KEY: z.string(),
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'File outline:\n'
ast-grep outline docs/reference/advanced/gateway/agent-frameworks.md --view expanded || true

printf '\nSearch env var names in logfire docs:\n'
rg -n "LOGFIRE_GATEWAY_API_KEY|PYDANTIC_AI_GATEWAY_API_KEY|GATEWAY_API_KEY" docs . || true

printf '\nRelevant file snippet:\n'
sed -n '1,120p' docs/reference/advanced/gateway/agent-frameworks.md

Repository: pydantic/logfire

Length of output: 10786


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Matches in logfire repo:\n'
rg -n "LOGFIRE_GATEWAY_API_KEY|PYDANTIC_AI_GATEWAY_API_KEY|GATEWAY_API_KEY" .

printf '\nNearby context around the reviewed file:\n'
sed -n '1,120p' docs/reference/advanced/gateway/agent-frameworks.md

Repository: pydantic/logfire

Length of output: 7516


Use one gateway env var name across the docs. This page uses LOGFIRE_GATEWAY_API_KEY, while docs/reference/advanced/gateway/index.md still uses PYDANTIC_AI_GATEWAY_API_KEY; pick one and update both pages, or call out why they differ.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/reference/advanced/gateway/agent-frameworks.md` around lines 31 - 33,
The gateway docs use inconsistent environment variable names between the
agent-frameworks page and the gateway index page; choose a single canonical name
and update both references to match, or explicitly document why
`LOGFIRE_GATEWAY_API_KEY` and `PYDANTIC_AI_GATEWAY_API_KEY` differ. Update the
env schema example in the gateway docs and the corresponding mention in the
index page so readers see one consistent gateway API key variable name
throughout.

Source: Linked repositories

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread docs/reference/advanced/gateway/agent-frameworks.md Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 7 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/reference/advanced/gateway/index.md">

<violation number="1" location="docs/reference/advanced/gateway/index.md:165">
P2: Absolute link points to a path that doesn't exist in the docs site structure. The page is at `/logfire/reference/advanced/gateway/agent-frameworks/`, not `/logfire/manage/ai-gateway/agent-frameworks/`. With `absolute_links: warn` in mkdocs.yml this will produce a build warning. Either use a relative markdown link (`./agent-frameworks.md`) or the correct absolute path.</violation>
</file>

<file name="docs/comparisons/index.md">

<violation number="1" location="docs/comparisons/index.md:55">
P1: The updated AI gateway link `/logfire/manage/ai-gateway/` points to a URL path that doesn't correspond to any page in the documentation. The gateway overview is located at `docs/reference/advanced/gateway/index.md` (nav slug `reference/advanced/gateway/index`), which would be served at `/logfire/reference/advanced/gateway/` on the deployed site. This change introduces a broken link that will 404 for readers. Update the link to the correct absolute path, e.g. `/logfire/reference/advanced/gateway/`.</violation>
</file>

<file name="docs/faq.md">

<violation number="1" location="docs/faq.md:53">
P2: Link targets `/logfire/manage/ai-gateway/` but no content exists at that path — it's a production-site URL, not a local doc reference. The rest of the gateway docs use relative paths (`reference/advanced/gateway/index.md`, etc.). Use a relative path like `reference/advanced/gateway/index.md` to match the mkdocs nav structure and work in local builds.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread docs/comparisons/index.md Outdated
- **Want exceptional Python, TS/JS, Rust support** - While also supporting other languages via OTel
- **Want evals both ways** - [code-first evals with pydantic-evals](https://pydantic.dev/docs/logfire/evaluate/datasets/?utm_source=comparison_docs) that test any Python function, plus a [web UI for datasets, experiments, and live production monitoring](https://pydantic.dev/docs/logfire/evaluate/evals/?utm_source=comparison_docs)
- **Want the full AI engineering loop in one place** - [prompt management](https://pydantic.dev/docs/logfire/prompt-management/?utm_source=comparison_docs), a playground, and an [AI gateway](../reference/advanced/gateway/index.md) with key management and spending controls, next to your traces
- **Want the full AI engineering loop in one place** - [prompt management](https://pydantic.dev/docs/logfire/prompt-management/?utm_source=comparison_docs), a playground, and an [AI gateway](/logfire/manage/ai-gateway/) with key management and spending controls, next to your traces

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The updated AI gateway link /logfire/manage/ai-gateway/ points to a URL path that doesn't correspond to any page in the documentation. The gateway overview is located at docs/reference/advanced/gateway/index.md (nav slug reference/advanced/gateway/index), which would be served at /logfire/reference/advanced/gateway/ on the deployed site. This change introduces a broken link that will 404 for readers. Update the link to the correct absolute path, e.g. /logfire/reference/advanced/gateway/.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/comparisons/index.md, line 55:

<comment>The updated AI gateway link `/logfire/manage/ai-gateway/` points to a URL path that doesn't correspond to any page in the documentation. The gateway overview is located at `docs/reference/advanced/gateway/index.md` (nav slug `reference/advanced/gateway/index`), which would be served at `/logfire/reference/advanced/gateway/` on the deployed site. This change introduces a broken link that will 404 for readers. Update the link to the correct absolute path, e.g. `/logfire/reference/advanced/gateway/`.</comment>

<file context>
@@ -52,7 +52,7 @@ Logfire is a great fit when you:
 - **Want exceptional Python, TS/JS, Rust support** - While also supporting other languages via OTel
 - **Want evals both ways** - [code-first evals with pydantic-evals](https://pydantic.dev/docs/logfire/evaluate/datasets/?utm_source=comparison_docs) that test any Python function, plus a [web UI for datasets, experiments, and live production monitoring](https://pydantic.dev/docs/logfire/evaluate/evals/?utm_source=comparison_docs)
-- **Want the full AI engineering loop in one place** - [prompt management](https://pydantic.dev/docs/logfire/prompt-management/?utm_source=comparison_docs), a playground, and an [AI gateway](../reference/advanced/gateway/index.md) with key management and spending controls, next to your traces
+- **Want the full AI engineering loop in one place** - [prompt management](https://pydantic.dev/docs/logfire/prompt-management/?utm_source=comparison_docs), a playground, and an [AI gateway](/logfire/manage/ai-gateway/) with key management and spending controls, next to your traces
 - **Prefer SQL-based querying** - Familiar PostgreSQL syntax over proprietary query languages
 - **Value simple, predictable pricing** - $2/million spans, scales to billions of spans per month
</file context>
Suggested change
- **Want the full AI engineering loop in one place** - [prompt management](https://pydantic.dev/docs/logfire/prompt-management/?utm_source=comparison_docs), a playground, and an [AI gateway](/logfire/manage/ai-gateway/) with key management and spending controls, next to your traces
- **Want the full AI engineering loop in one place** - [prompt management](https://pydantic.dev/docs/logfire/prompt-management/?utm_source=comparison_docs), a playground, and an [AI gateway](/logfire/reference/advanced/gateway/) with key management and spending controls, next to your traces


## See also

- [Using the gateway with agent frameworks](/logfire/manage/ai-gateway/agent-frameworks/) — route framework model calls through the gateway.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Absolute link points to a path that doesn't exist in the docs site structure. The page is at /logfire/reference/advanced/gateway/agent-frameworks/, not /logfire/manage/ai-gateway/agent-frameworks/. With absolute_links: warn in mkdocs.yml this will produce a build warning. Either use a relative markdown link (./agent-frameworks.md) or the correct absolute path.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/reference/advanced/gateway/index.md, line 165:

<comment>Absolute link points to a path that doesn't exist in the docs site structure. The page is at `/logfire/reference/advanced/gateway/agent-frameworks/`, not `/logfire/manage/ai-gateway/agent-frameworks/`. With `absolute_links: warn` in mkdocs.yml this will produce a build warning. Either use a relative markdown link (`./agent-frameworks.md`) or the correct absolute path.</comment>

<file context>
@@ -162,6 +162,6 @@ Or run just the proxy and configure a tool manually with `logfire gateway serve`
 ## See also
 
-- [Using the gateway with agent frameworks](./agent-frameworks.md) — route framework model calls through the gateway.
+- [Using the gateway with agent frameworks](/logfire/manage/ai-gateway/agent-frameworks/) — route framework model calls through the gateway.
 - [Prompt Management: Access and Prerequisites](../prompt-management/plan-requirements.md) — prompt runs execute through the gateway and spend gateway budget.
 - [Cost & Usage](../../../logfire-costs.md) — plan tiers and how usage is billed.
</file context>
Suggested change
- [Using the gateway with agent frameworks](/logfire/manage/ai-gateway/agent-frameworks/) — route framework model calls through the gateway.
- [Using the gateway with agent frameworks](/logfire/reference/advanced/gateway/agent-frameworks/) — route framework model calls through the gateway.

Comment thread docs/faq.md Outdated
- [Evals](guides/web-ui/evals.md): datasets, experiments, and [live production monitoring](guides/web-ui/live-evals.md) in the web UI, powered by code-first [pydantic-evals](https://github.com/pydantic/pydantic-evals)
- [Prompt management](reference/advanced/prompt-management/index.md) with versioning, labeled rollouts, and a playground
- An [AI Gateway](reference/advanced/gateway/index.md) with unified key management, spending limits, and provider failover
- An [AI Gateway](/logfire/manage/ai-gateway/) with unified key management, spending limits, and provider failover

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Link targets /logfire/manage/ai-gateway/ but no content exists at that path — it's a production-site URL, not a local doc reference. The rest of the gateway docs use relative paths (reference/advanced/gateway/index.md, etc.). Use a relative path like reference/advanced/gateway/index.md to match the mkdocs nav structure and work in local builds.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/faq.md, line 53:

<comment>Link targets `/logfire/manage/ai-gateway/` but no content exists at that path — it's a production-site URL, not a local doc reference. The rest of the gateway docs use relative paths (`reference/advanced/gateway/index.md`, etc.). Use a relative path like `reference/advanced/gateway/index.md` to match the mkdocs nav structure and work in local builds.</comment>

<file context>
@@ -50,7 +50,7 @@ Yes: Logfire is _built_ for AI observability, and it's better at it because it s
 - [Evals](guides/web-ui/evals.md): datasets, experiments, and [live production monitoring](guides/web-ui/live-evals.md) in the web UI, powered by code-first [pydantic-evals](https://github.com/pydantic/pydantic-evals)
 - [Prompt management](reference/advanced/prompt-management/index.md) with versioning, labeled rollouts, and a playground
-- An [AI Gateway](reference/advanced/gateway/index.md) with unified key management, spending limits, and provider failover
+- An [AI Gateway](/logfire/manage/ai-gateway/) with unified key management, spending limits, and provider failover
 
 **Better debugging:** When your AI agent fails, you don't just see the LLM error. You see the database timeout that caused it, the API rate limit that preceded it, and the user request that started it all.
</file context>
Suggested change
- An [AI Gateway](/logfire/manage/ai-gateway/) with unified key management, spending limits, and provider failover
- An [AI Gateway](reference/advanced/gateway/index.md) with unified key management, spending limits, and provider failover

@ddanielcruzz
ddanielcruzz force-pushed the codex/agent-framework-gateway-docs branch from 18fea2e to 784ad87 Compare July 9, 2026 20:13
@ddanielcruzz ddanielcruzz changed the title Add gateway examples for agent frameworks Add AI Gateway integration docs Jul 9, 2026
@ddanielcruzz
ddanielcruzz changed the base branch from claude/agent-frameworks-logfire-docs-sgi9cc to main July 9, 2026 20:13

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/reference/advanced/gateway/integrations/genkit.md`:
- Line 8: The first sentence in the Genkit integration page uses “AI” before
spelling it out, so update the opening wording in the Genkit documentation to
expand the acronym on first use. Adjust the introductory sentence in this page
so “AI” appears as “artificial intelligence” (or equivalent) before any later
use of “AI,” keeping the rest of the Genkit and LOGFIRE_GATEWAY_API_KEY guidance
unchanged.

In `@docs/reference/advanced/gateway/integrations/microsoft-agent-framework.md`:
- Line 8: The opening sentence uses acronyms before defining them, so update the
intro in Microsoft Agent Framework documentation to spell out “software
development kit” and “artificial intelligence” at first use. Keep the same
meaning, but revise the first sentence in this page so the expanded forms appear
before SDK and AI are used later.

In `@docs/reference/advanced/gateway/integrations/semantic-kernel.md`:
- Line 8: The opening sentence in Semantic Kernel docs uses acronyms before
spelling them out; update the first mention in the intro to expand SDK and AI on
first use. Adjust the sentence around the Microsoft Semantic Kernel description
so it reads with the full terms before any abbreviations, following the docs/
first-use acronym rule. Keep the rest of the gateway setup guidance unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 62a779fd-f4e9-4452-a902-2d6379cbde72

📥 Commits

Reviewing files that changed from the base of the PR and between 18fea2e and 784ad87.

📒 Files selected for processing (18)
  • docs/nav.json
  • docs/reference/advanced/gateway/agent-frameworks.md
  • docs/reference/advanced/gateway/integrations/agno.md
  • docs/reference/advanced/gateway/integrations/genkit.md
  • docs/reference/advanced/gateway/integrations/google-adk.md
  • docs/reference/advanced/gateway/integrations/haystack.md
  • docs/reference/advanced/gateway/integrations/instructor.md
  • docs/reference/advanced/gateway/integrations/langchain.md
  • docs/reference/advanced/gateway/integrations/llamaindex.md
  • docs/reference/advanced/gateway/integrations/mastra.md
  • docs/reference/advanced/gateway/integrations/microsoft-agent-framework.md
  • docs/reference/advanced/gateway/integrations/openai-agents-sdk.md
  • docs/reference/advanced/gateway/integrations/openai-sdk.md
  • docs/reference/advanced/gateway/integrations/semantic-kernel.md
  • docs/reference/advanced/gateway/integrations/smolagents.md
  • docs/reference/advanced/gateway/integrations/strands-agents.md
  • docs/reference/advanced/gateway/integrations/vercel-ai-sdk.md
  • docs/reference/advanced/gateway/integrations/voltagent.md
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • pydantic/logfire (manual)
  • pydantic/pydantic-ai (manual)
  • pydantic/pydantic (auto-detected)
✅ Files skipped from review due to trivial changes (13)
  • docs/reference/advanced/gateway/integrations/openai-agents-sdk.md
  • docs/reference/advanced/gateway/integrations/voltagent.md
  • docs/reference/advanced/gateway/integrations/haystack.md
  • docs/reference/advanced/gateway/integrations/instructor.md
  • docs/reference/advanced/gateway/integrations/llamaindex.md
  • docs/reference/advanced/gateway/integrations/vercel-ai-sdk.md
  • docs/reference/advanced/gateway/integrations/strands-agents.md
  • docs/reference/advanced/gateway/integrations/smolagents.md
  • docs/reference/advanced/gateway/integrations/openai-sdk.md
  • docs/reference/advanced/gateway/integrations/google-adk.md
  • docs/reference/advanced/gateway/integrations/agno.md
  • docs/reference/advanced/gateway/integrations/langchain.md
  • docs/reference/advanced/gateway/agent-frameworks.md


# Genkit

[Genkit](https://genkit.dev/) is Google's open-source framework for building AI-powered applications. To route its model calls through the Logfire AI Gateway, use Genkit's OpenAI-compatible plugin pointed at the gateway URL and set `LOGFIRE_GATEWAY_API_KEY` to a key from the Gateway **API Keys** tab.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Expand “AI” on first use.

AI appears before it is spelled out.

Suggested wording
-[Genkit](https://genkit.dev/) is Google's open-source framework for building AI-powered applications.
+[Genkit](https://genkit.dev/) is Google's open-source framework for building artificial intelligence (AI)-powered applications.

As per path instructions, "In public documentation pages under docs/, spell out acronyms at first use on each page."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[Genkit](https://genkit.dev/) is Google's open-source framework for building AI-powered applications. To route its model calls through the Logfire AI Gateway, use Genkit's OpenAI-compatible plugin pointed at the gateway URL and set `LOGFIRE_GATEWAY_API_KEY` to a key from the Gateway **API Keys** tab.
[Genkit](https://genkit.dev/) is Google's open-source framework for building artificial intelligence (AI)-powered applications. To route its model calls through the Logfire AI Gateway, use Genkit's OpenAI-compatible plugin pointed at the gateway URL and set `LOGFIRE_GATEWAY_API_KEY` to a key from the Gateway **API Keys** tab.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/reference/advanced/gateway/integrations/genkit.md` at line 8, The first
sentence in the Genkit integration page uses “AI” before spelling it out, so
update the opening wording in the Genkit documentation to expand the acronym on
first use. Adjust the introductory sentence in this page so “AI” appears as
“artificial intelligence” (or equivalent) before any later use of “AI,” keeping
the rest of the Genkit and LOGFIRE_GATEWAY_API_KEY guidance unchanged.

Source: Path instructions


# Microsoft Agent Framework

[Microsoft Agent Framework](https://learn.microsoft.com/en-us/agent-framework/) is Microsoft's SDK for building multi-agent AI applications. To route its model calls through the Logfire AI Gateway, configure its OpenAI chat completion client with the gateway URL and set `LOGFIRE_GATEWAY_API_KEY` to a key from the Gateway **API Keys** tab.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Expand the first acronyms in the opening sentence.

SDK and AI appear before they are spelled out.

Suggested wording
-[Microsoft Agent Framework](https://learn.microsoft.com/en-us/agent-framework/) is Microsoft's SDK for building multi-agent AI applications.
+[Microsoft Agent Framework](https://learn.microsoft.com/en-us/agent-framework/) is Microsoft's software development kit (SDK) for building multi-agent artificial intelligence (AI) applications.

As per path instructions, "In public documentation pages under docs/, spell out acronyms at first use on each page."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[Microsoft Agent Framework](https://learn.microsoft.com/en-us/agent-framework/) is Microsoft's SDK for building multi-agent AI applications. To route its model calls through the Logfire AI Gateway, configure its OpenAI chat completion client with the gateway URL and set `LOGFIRE_GATEWAY_API_KEY` to a key from the Gateway **API Keys** tab.
[Microsoft Agent Framework](https://learn.microsoft.com/en-us/agent-framework/) is Microsoft's software development kit (SDK) for building multi-agent artificial intelligence (AI) applications. To route its model calls through the Logfire AI Gateway, configure its OpenAI chat completion client with the gateway URL and set `LOGFIRE_GATEWAY_API_KEY` to a key from the Gateway **API Keys** tab.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/reference/advanced/gateway/integrations/microsoft-agent-framework.md` at
line 8, The opening sentence uses acronyms before defining them, so update the
intro in Microsoft Agent Framework documentation to spell out “software
development kit” and “artificial intelligence” at first use. Keep the same
meaning, but revise the first sentence in this page so the expanded forms appear
before SDK and AI are used later.

Source: Path instructions


# Semantic Kernel

[Microsoft Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/) is Microsoft's SDK for integrating AI models into your applications. To route its model calls through the Logfire AI Gateway, configure an OpenAI-compatible chat completion service with the gateway URL and set `LOGFIRE_GATEWAY_API_KEY` to a key from the Gateway **API Keys** tab.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Expand the first acronyms in the opening sentence.

SDK and AI appear before they are spelled out.

Suggested wording
-[Microsoft Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/) is Microsoft's SDK for integrating AI models into your applications.
+[Microsoft Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/) is Microsoft's software development kit (SDK) for integrating artificial intelligence (AI) models into your applications.

As per path instructions, "In public documentation pages under docs/, spell out acronyms at first use on each page."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[Microsoft Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/) is Microsoft's SDK for integrating AI models into your applications. To route its model calls through the Logfire AI Gateway, configure an OpenAI-compatible chat completion service with the gateway URL and set `LOGFIRE_GATEWAY_API_KEY` to a key from the Gateway **API Keys** tab.
[Microsoft Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/) is Microsoft's software development kit (SDK) for integrating artificial intelligence (AI) models into your applications. To route its model calls through the Logfire AI Gateway, configure an OpenAI-compatible chat completion service with the gateway URL and set `LOGFIRE_GATEWAY_API_KEY` to a key from the Gateway **API Keys** tab.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/reference/advanced/gateway/integrations/semantic-kernel.md` at line 8,
The opening sentence in Semantic Kernel docs uses acronyms before spelling them
out; update the first mention in the intro to expand SDK and AI on first use.
Adjust the sentence around the Microsoft Semantic Kernel description so it reads
with the full terms before any abbreviations, following the docs/ first-use
acronym rule. Keep the rest of the gateway setup guidance unchanged.

Source: Path instructions

Copy-only pass on the AI Gateway integration pages to match the voice
already used in the gateway overview:

- Drop spelled-out acronyms ("software development kit (SDK)", "large
  language model (LLM)", "retrieval-augmented generation (RAG)") — the
  sibling docs write SDK/LLM/RAG bare.
- Remove the verbatim "set LOGFIRE_GATEWAY_API_KEY to a key from..."
  clause repeated on every page; the env var is shown in each code
  block and in the overview's "Before you start".
- Drop "popular" from the LangChain description.
- Overview: note the EU gateway host and tighten the URL paragraph.

Claude-Session: https://claude.ai/code/session_01QSWKYbQCiNKsL8RdAZhQBN

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 16 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/reference/advanced/gateway/integrations/instructor.md">

<violation number="1" location="docs/reference/advanced/gateway/integrations/instructor.md:8">
P3: The description paragraph uses a different sentence structure than the other 15 integration pages, which consistently follow an imperative "To route its model calls through the Logfire AI Gateway, configure/set up X..." pattern. Consider aligning this description with that established convention for consistency.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread docs/reference/advanced/gateway/integrations/smolagents.md Outdated

# Instructor

[Instructor](https://python.useinstructor.com/) is a Python library for extracting structured, typed data from LLM responses — you describe the shape of the data you want and Instructor handles the rest. Because Instructor wraps a standard OpenAI client, routing through the gateway means configuring that underlying client with the gateway URL, using a key from the Gateway **API Keys** tab.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The description paragraph uses a different sentence structure than the other 15 integration pages, which consistently follow an imperative "To route its model calls through the Logfire AI Gateway, configure/set up X..." pattern. Consider aligning this description with that established convention for consistency.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/reference/advanced/gateway/integrations/instructor.md, line 8:

<comment>The description paragraph uses a different sentence structure than the other 15 integration pages, which consistently follow an imperative "To route its model calls through the Logfire AI Gateway, configure/set up X..." pattern. Consider aligning this description with that established convention for consistency.</comment>

<file context>
@@ -5,7 +5,7 @@ description: "Route Instructor model calls through the Logfire AI Gateway."
 # Instructor
 
-[Instructor](https://python.useinstructor.com/) is a Python library for extracting structured, typed data from large language model (LLM) responses — you describe the shape of the data you want and Instructor handles the rest. Because Instructor wraps a standard OpenAI client, routing through the gateway is just a matter of configuring that underlying client with the gateway URL. Set `LOGFIRE_GATEWAY_API_KEY` to a key from the Gateway **API Keys** tab before running this example.
+[Instructor](https://python.useinstructor.com/) is a Python library for extracting structured, typed data from LLM responses — you describe the shape of the data you want and Instructor handles the rest. Because Instructor wraps a standard OpenAI client, routing through the gateway means configuring that underlying client with the gateway URL, using a key from the Gateway **API Keys** tab.
 
 ```python title="instructor-gateway.py" skip-run="true" skip-reason="external-connection"
</file context>
Suggested change
[Instructor](https://python.useinstructor.com/) is a Python library for extracting structured, typed data from LLM responses — you describe the shape of the data you want and Instructor handles the rest. Because Instructor wraps a standard OpenAI client, routing through the gateway means configuring that underlying client with the gateway URL, using a key from the Gateway **API Keys** tab.
[Instructor](https://python.useinstructor.com/) is a Python library for extracting structured, typed data from LLM responses — you describe the shape of the data you want and Instructor handles the rest. To route its model calls through the Logfire AI Gateway, configure the underlying OpenAI client with the gateway URL, using a key from the Gateway **API Keys** tab.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/reference/advanced/gateway/integrations/index.md`:
- Line 14: Replace deployment-specific `/logfire` documentation links with
source-relative `.md` links at
docs/reference/advanced/gateway/integrations/index.md lines 14, 26, and 54;
docs/reference/advanced/gateway/embeddings.md lines 8, 51, and 125; and
docs/reference/advanced/gateway/index.md line 165. Use the corresponding targets
`../index.md#enable-the-gateway`, `../index.md#connect-an-sdk`, `../index.md`,
`index.md#providers`, `index.md#connect-an-sdk`, `index.md`, and `embeddings.md`
respectively.

In `@docs/reference/advanced/gateway/integrations/smolagents.md`:
- Around line 14-15: Add the `smolagents[openai]` installation prerequisite
before the example in the Smolagents integration documentation, ensuring the
required OpenAI extra is explicitly installed alongside the existing project and
gateway setup instructions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ce47902b-7ed2-4612-868a-977c9690185b

📥 Commits

Reviewing files that changed from the base of the PR and between d12158a and 1e02c1a.

📒 Files selected for processing (20)
  • docs/nav.json
  • docs/reference/advanced/gateway/embeddings.md
  • docs/reference/advanced/gateway/index.md
  • docs/reference/advanced/gateway/integrations/agno.md
  • docs/reference/advanced/gateway/integrations/genkit.md
  • docs/reference/advanced/gateway/integrations/google-adk.md
  • docs/reference/advanced/gateway/integrations/haystack.md
  • docs/reference/advanced/gateway/integrations/index.md
  • docs/reference/advanced/gateway/integrations/instructor.md
  • docs/reference/advanced/gateway/integrations/langchain.md
  • docs/reference/advanced/gateway/integrations/llamaindex.md
  • docs/reference/advanced/gateway/integrations/mastra.md
  • docs/reference/advanced/gateway/integrations/microsoft-agent-framework.md
  • docs/reference/advanced/gateway/integrations/openai-agents-sdk.md
  • docs/reference/advanced/gateway/integrations/openai-sdk.md
  • docs/reference/advanced/gateway/integrations/semantic-kernel.md
  • docs/reference/advanced/gateway/integrations/smolagents.md
  • docs/reference/advanced/gateway/integrations/strands-agents.md
  • docs/reference/advanced/gateway/integrations/vercel-ai-sdk.md
  • docs/reference/advanced/gateway/integrations/voltagent.md
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • pydantic/logfire (manual)
  • pydantic/pydantic-ai (manual)
  • pydantic/platform (auto-detected)
  • pydantic/pydantic (auto-detected)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/reference/advanced/gateway/integrations/google-adk.md

Comment thread docs/reference/advanced/gateway/integrations/index.md
Comment thread docs/reference/advanced/gateway/integrations/smolagents.md Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 21 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/reference/advanced/gateway/integrations/instructor.md">

<violation number="1" location="docs/reference/advanced/gateway/integrations/instructor.md:24">
P2: The `hl_lines="15-16"` annotation highlights the closing parentheses `)` instead of the `api_key` and `base_url` configuration lines. The annotation should be `hl_lines="13-14"` to highlight the actual OpenAI client settings, matching the pattern used by other Python integration pages (e.g., OpenAI SDK uses `hl_lines="6-7"`, LangChain uses `hl_lines="14-15"`).</violation>
</file>

<file name="docs/reference/advanced/gateway/index.md">

<violation number="1" location="docs/reference/advanced/gateway/index.md:165">
P3: The new absolute link `/logfire/manage/ai-gateway/embeddings/` breaks consistency with the other two links in the same "See also" section, which still use relative paths (`../prompt-management/plan-requirements.md` and `../../../logfire-costs.md`). Either use absolute URLs for all three or use relative paths for all three.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic


Set the wrapped OpenAI client's `api_key` to your gateway key and `base_url` to the OpenAI-compatible gateway route. Copy the route and a supported model name from the Gateway **Connect** tab.

```python title="instructor-gateway.py" hl_lines="15-16" skip-run="true" skip-reason="external-connection"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The hl_lines="15-16" annotation highlights the closing parentheses ) instead of the api_key and base_url configuration lines. The annotation should be hl_lines="13-14" to highlight the actual OpenAI client settings, matching the pattern used by other Python integration pages (e.g., OpenAI SDK uses hl_lines="6-7", LangChain uses hl_lines="14-15").

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/reference/advanced/gateway/integrations/instructor.md, line 24:

<comment>The `hl_lines="15-16"` annotation highlights the closing parentheses `)` instead of the `api_key` and `base_url` configuration lines. The annotation should be `hl_lines="13-14"` to highlight the actual OpenAI client settings, matching the pattern used by other Python integration pages (e.g., OpenAI SDK uses `hl_lines="6-7"`, LangChain uses `hl_lines="14-15"`).</comment>

<file context>
@@ -1,13 +1,27 @@
+
+Set the wrapped OpenAI client's `api_key` to your gateway key and `base_url` to the OpenAI-compatible gateway route. Copy the route and a supported model name from the Gateway **Connect** tab.
+
+```python title="instructor-gateway.py" hl_lines="15-16" skip-run="true" skip-reason="external-connection"
 import os
 
</file context>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hl_lines counts every source line in the fenced block, including blank lines. In the current snippet, api_key and base_url are lines 15 and 16. Lines 13 and 14 are client = instructor.from_openai( and OpenAI(, so changing this to 13-14 would highlight the wrong lines. Keeping 15-16.

Comment thread docs/reference/advanced/gateway/integrations/smolagents.md Outdated
## See also

- [Embeddings](embeddings.md): discover and call embedding models through the gateway.
- [Embeddings](/logfire/manage/ai-gateway/embeddings/): discover and call embedding models through the gateway.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The new absolute link /logfire/manage/ai-gateway/embeddings/ breaks consistency with the other two links in the same "See also" section, which still use relative paths (../prompt-management/plan-requirements.md and ../../../logfire-costs.md). Either use absolute URLs for all three or use relative paths for all three.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/reference/advanced/gateway/index.md, line 165:

<comment>The new absolute link `/logfire/manage/ai-gateway/embeddings/` breaks consistency with the other two links in the same "See also" section, which still use relative paths (`../prompt-management/plan-requirements.md` and `../../../logfire-costs.md`). Either use absolute URLs for all three or use relative paths for all three.</comment>

<file context>
@@ -162,6 +162,6 @@ Or run just the proxy and configure a tool manually with `logfire gateway serve`
 ## See also
 
-- [Embeddings](embeddings.md): discover and call embedding models through the gateway.
+- [Embeddings](/logfire/manage/ai-gateway/embeddings/): discover and call embedding models through the gateway.
 - [Prompt Management: Access and Prerequisites](../prompt-management/plan-requirements.md): prompt runs execute through the gateway and spend gateway budget.
 - [Cost & Usage](../../../logfire-costs.md): plan tiers and how usage is billed.
</file context>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping this absolute link intentionally. The AI Gateway pages are remapped by unified-docs to /logfire/manage/ai-gateway/..., while the source tree lives under reference/advanced/gateway. The other links target different remapped sections, so matching their Markdown syntax is not a correctness requirement. Using the canonical public route here avoids linking to the source-derived route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants