Add AI Gateway integration docs#2059
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds 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)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
docs/integrations/agent-frameworks/mastra.mddocs/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?'); |
There was a problem hiding this comment.
🎯 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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
📒 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)
| const envSchema = z.object({ | ||
| LOGFIRE_GATEWAY_API_KEY: z.string(), | ||
| }); |
There was a problem hiding this comment.
📐 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.mdRepository: 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.mdRepository: 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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
| - **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 |
There was a problem hiding this comment.
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>
| - **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. |
There was a problem hiding this comment.
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>
| - [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. |
| - [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 |
There was a problem hiding this comment.
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>
| - 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 |
18fea2e to
784ad87
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (18)
docs/nav.jsondocs/reference/advanced/gateway/agent-frameworks.mddocs/reference/advanced/gateway/integrations/agno.mddocs/reference/advanced/gateway/integrations/genkit.mddocs/reference/advanced/gateway/integrations/google-adk.mddocs/reference/advanced/gateway/integrations/haystack.mddocs/reference/advanced/gateway/integrations/instructor.mddocs/reference/advanced/gateway/integrations/langchain.mddocs/reference/advanced/gateway/integrations/llamaindex.mddocs/reference/advanced/gateway/integrations/mastra.mddocs/reference/advanced/gateway/integrations/microsoft-agent-framework.mddocs/reference/advanced/gateway/integrations/openai-agents-sdk.mddocs/reference/advanced/gateway/integrations/openai-sdk.mddocs/reference/advanced/gateway/integrations/semantic-kernel.mddocs/reference/advanced/gateway/integrations/smolagents.mddocs/reference/advanced/gateway/integrations/strands-agents.mddocs/reference/advanced/gateway/integrations/vercel-ai-sdk.mddocs/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. |
There was a problem hiding this comment.
📐 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.
| [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. |
There was a problem hiding this comment.
📐 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.
| [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. |
There was a problem hiding this comment.
📐 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.
| [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
There was a problem hiding this comment.
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
|
|
||
| # 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. |
There was a problem hiding this comment.
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>
| [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. |
…ramework-gateway-docs # Conflicts: # docs/nav.json
There was a problem hiding this comment.
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
📒 Files selected for processing (20)
docs/nav.jsondocs/reference/advanced/gateway/embeddings.mddocs/reference/advanced/gateway/index.mddocs/reference/advanced/gateway/integrations/agno.mddocs/reference/advanced/gateway/integrations/genkit.mddocs/reference/advanced/gateway/integrations/google-adk.mddocs/reference/advanced/gateway/integrations/haystack.mddocs/reference/advanced/gateway/integrations/index.mddocs/reference/advanced/gateway/integrations/instructor.mddocs/reference/advanced/gateway/integrations/langchain.mddocs/reference/advanced/gateway/integrations/llamaindex.mddocs/reference/advanced/gateway/integrations/mastra.mddocs/reference/advanced/gateway/integrations/microsoft-agent-framework.mddocs/reference/advanced/gateway/integrations/openai-agents-sdk.mddocs/reference/advanced/gateway/integrations/openai-sdk.mddocs/reference/advanced/gateway/integrations/semantic-kernel.mddocs/reference/advanced/gateway/integrations/smolagents.mddocs/reference/advanced/gateway/integrations/strands-agents.mddocs/reference/advanced/gateway/integrations/vercel-ai-sdk.mddocs/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
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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.
| ## 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. |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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.
Summary:
Checks: