Skip to content

Commit a2e98a5

Browse files
aaronvgcursoragent
andauthored
Add vercel ai gateway to docs (#2453)
# Pull Request Template Thanks for taking the time to fill out this pull request! ## Issue Reference Please link to any related issues - [x] This PR fixes/closes #BAML-477 ## Changes Please describe the changes proposed in this pull request This PR adds documentation for the Vercel AI Gateway, explaining how to use it with the existing `openai-generic` provider by setting the `base_url` to `https://ai-gateway.vercel.sh/v1`. Changes include: - A new documentation page: `fern/03-reference/baml/clients/providers/vercel-ai-gateway.mdx` - Updates to `fern/docs.yml` to include the new page in the navigation and add a redirect. - Updates to `fern/03-reference/baml/clients/providers/openai-generic.mdx` and `fern/snippets/client-constructor.mdx` to list Vercel AI Gateway as a supported `openai-generic` provider. ## Testing Please describe how you tested these changes - [ ] Unit tests added/updated - [x] Manual testing performed - Verified the new documentation page renders correctly. - Confirmed the new page is accessible via the sidebar navigation. - Checked that links from `openai-generic.mdx` and `client-constructor.mdx` correctly point to the new Vercel AI Gateway page. - [ ] Tested in [environment] ## Screenshots If applicable, add screenshots to help explain your changes [Add screenshots here...] ## PR Checklist Please ensure you've completed these items - [x] I have read and followed the contributing guidelines - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings ## Additional Notes Add any other context about the PR here This PR addresses the request to add support for the Vercel AI Gateway by documenting its compatibility with the `openai-generic` provider, as suggested in the original issue. --- <a href="https://cursor.com/background-agent?bcId=bc-80e809f0-4deb-43da-8699-2edccd6866ed"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"> <img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"> </picture> </a> <a href="https://cursor.com/agents?id=bc-80e809f0-4deb-43da-8699-2edccd6866ed"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"> <img alt="Open in Web" src="https://cursor.com/open-in-web.svg"> </picture> </a> <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Adds documentation for Vercel AI Gateway usage with `openai-generic` provider, including a new page and updates to navigation and existing docs. > > - **Documentation**: > - Adds `vercel-ai-gateway.mdx` to document Vercel AI Gateway usage with `openai-generic` by setting `base_url` to `https://ai-gateway.vercel.sh/v1`. > - Updates `docs.yml` to include the new page in navigation and add a redirect. > - Updates `openai-generic.mdx` and `client-constructor.mdx` to list Vercel AI Gateway as a supported `openai-generic` provider. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for f07b012. You can [customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN --> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent d9da7e0 commit a2e98a5

4 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎fern/03-reference/baml/clients/providers/openai-generic.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ A non-exhaustive list of providers you can use with `openai-generic`:
3232
| LM Studio | [LM Studio](/ref/llm-client-providers/lmstudio) |
3333
| Ollama | [Ollama](/ref/llm-client-providers/ollama) |
3434
| OpenRouter | [OpenRouter](/ref/llm-client-providers/openrouter) |
35+
| Vercel AI Gateway | [Vercel AI Gateway](/ref/llm-client-providers/vercel-ai-gateway) |
3536
| Tinfoil | [Tinfoil](/ref/llm-client-providers/tinfoil) |
3637
| TogetherAI | [TogetherAI](/ref/llm-client-providers/together) |
3738
| Unify AI | [Unify AI](/ref/llm-client-providers/unify) |
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: vercel-ai-gateway
3+
---
4+
5+
[Vercel AI Gateway](https://vercel.com/docs/ai-gateway/openai-compat) supports the OpenAI-compatible API, so you can use the [`openai-generic`](/docs/snippets/clients/providers/openai) provider with an overridden `base_url`.
6+
7+
```baml BAML
8+
client<llm> VercelClient {
9+
provider "openai-generic"
10+
options {
11+
base_url "https://ai-gateway.vercel.sh/v1"
12+
api_key env.VERCEL_AI_GATEWAY_TOKEN
13+
// Example models routed via the gateway
14+
// model "anthropic/claude-3-5-sonnet-latest"
15+
// model "openai/gpt-4o-mini"
16+
}
17+
}
18+
```
19+
20+
See the Vercel docs for details on configuring providers and models behind your gateway: [Vercel AI Gateway (OpenAI compatible)](https://vercel.com/docs/ai-gateway/openai-compat).
21+

‎fern/docs.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,9 @@ navigation:
793793
- page: "OpenRouter (openai-generic)"
794794
slug: openrouter
795795
path: 03-reference/baml/clients/providers/openrouter.mdx
796+
- page: "Vercel AI Gateway (openai-generic)"
797+
slug: vercel-ai-gateway
798+
path: 03-reference/baml/clients/providers/vercel-ai-gateway.mdx
796799
- page: "Tinfoil (openai-generic)"
797800
slug: tinfoil
798801
path: 03-reference/baml/clients/providers/tinfoil.mdx
@@ -1156,6 +1159,8 @@ redirects:
11561159
destination: "/ref/llm-client-providers/ollama"
11571160
- source: "/ref/llm-client-providers/openai-generic-openrouter"
11581161
destination: "/ref/llm-client-providers/openrouter"
1162+
- source: "/ref/llm-client-providers/openai-generic-vercel-ai-gateway"
1163+
destination: "/ref/llm-client-providers/vercel-ai-gateway"
11591164
- source: "/ref/llm-client-providers/openai-generic-togetherai"
11601165
destination: "/ref/llm-client-providers/together"
11611166
- source: "/ref/llm-client-providers/openai-generic-unify-ai"

‎fern/snippets/client-constructor.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ A non-exhaustive list of providers you can use with `openai-generic`:
2727
| LM Studio | [LM Studio](/ref/llm-client-providers/lmstudio) |
2828
| Ollama | [Ollama](/ref/llm-client-providers/ollama) |
2929
| OpenRouter | [OpenRouter](/ref/llm-client-providers/openrouter) |
30+
| Vercel AI Gateway | [Vercel AI Gateway](/ref/llm-client-providers/vercel-ai-gateway) |
3031
| TogetherAI | [TogetherAI](/ref/llm-client-providers/together) |
3132
| Unify AI | [Unify AI](/ref/llm-client-providers/unify) |
3233
| vLLM | [vLLM](/ref/llm-client-providers/vllm) |

0 commit comments

Comments
 (0)