-
Notifications
You must be signed in to change notification settings - Fork 94
feat(ai-gateway): Vercel provider #5265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tomek-labuk
wants to merge
15
commits into
release/ai-gateway-2.0
Choose a base branch
from
feat/vercel-ai-provider
base: release/ai-gateway-2.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
849d2c2
add tag support
jbaross db00cd6
initial skeleton
jbaross 8658f15
add how-tos
jbaross d221c64
add main provider page
jbaross f18f21c
add vercel as reseller note
jbaross bff9804
correct version numbers of deps
jbaross 2c6e45c
liquid fix for vale
jbaross efc7a1e
add vercel icon svg
jbaross 473e2fc
Merge branch 'main' into feat/vercel-ai-provider
jbaross 4764f23
Merge branch 'main' into feat/vercel-ai-provider
jbaross 116ced5
add yaml files for provider
jbaross e03383e
use correct svg for vercel in ai-providers yaml
jbaross 933344c
copilot fixes
jbaross 657efb0
Merge branch 'release/ai-gateway-2.0' into feat/vercel-ai-provider
jbaross a23dedd
vale fix
jbaross File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1031,6 +1031,8 @@ validators | |
| Valkey | ||
| vararg | ||
| vc | ||
| vercel | ||
| Vercel | ||
| viewport | ||
| viewports | ||
| vLLM | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,6 +215,7 @@ | |
| "upgrade", | ||
| "validation", | ||
| "vault", | ||
| "vercel", | ||
| "versioning", | ||
| "vertex-ai", | ||
| "vllm", | ||
|
|
||
95 changes: 95 additions & 0 deletions
95
app/_how-tos/ai-gateway/set-up-ai-proxy-advanced-with-vercel.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| --- | ||
| title: Set up AI Proxy Advanced with Vercel in {{site.base_gateway}} | ||
| permalink: /how-to/set-up-ai-proxy-advanced-with-vercel/ | ||
| content_type: how_to | ||
| related_resources: | ||
| - text: "{{site.ai_gateway}}" | ||
| url: /ai-gateway/ | ||
| - text: AI Proxy Advanced | ||
| url: /plugins/ai-proxy-advanced/ | ||
|
|
||
| description: Configure the AI Proxy Advanced plugin to create a chat route using Vercel. | ||
|
|
||
| products: | ||
| - gateway | ||
| - ai-gateway | ||
|
|
||
| works_on: | ||
| - on-prem | ||
| - konnect | ||
|
|
||
| min_version: | ||
| gateway: '2.0.0' | ||
|
|
||
| plugins: | ||
| - ai-proxy-advanced | ||
|
|
||
| entities: | ||
| - service | ||
| - route | ||
| - plugin | ||
|
|
||
| tags: | ||
| - ai | ||
| - openai | ||
| - vercel | ||
|
|
||
| tldr: | ||
| q: How do I use the AI Proxy Advanced plugin with Vercel? | ||
| a: Create a Gateway Service and a Route, then enable the AI Proxy Advanced plugin and configure it with the OpenAI provider, a Vercel model, and your Vercel API key. | ||
|
|
||
| tools: | ||
| - deck | ||
|
|
||
| prereqs: | ||
| inline: | ||
| - title: Vercel | ||
| include_content: prereqs/vercel | ||
| icon_url: /assets/icons/vercel.svg | ||
| entities: | ||
| services: | ||
| - example-service | ||
| routes: | ||
| - example-route | ||
|
|
||
| cleanup: | ||
| inline: | ||
| - title: Clean up Konnect environment | ||
| include_content: cleanup/platform/konnect | ||
| icon_url: /assets/icons/gateway.svg | ||
| - title: Destroy the {{site.base_gateway}} container | ||
| include_content: cleanup/products/gateway | ||
| icon_url: /assets/icons/gateway.svg | ||
| --- | ||
|
|
||
| ## Configure the plugin | ||
|
|
||
| To set up AI Proxy Advanced with Vercel, use the `vercel` provider, specify the [model](https://vercel.com/ai-gateway/models) and set the appropriate authentication header and upstream URL. | ||
|
|
||
| In this example, we'll use the `openai/gpt-5.5` model: | ||
|
|
||
| {% entity_examples %} | ||
| entities: | ||
| plugins: | ||
| - name: ai-proxy-advanced | ||
| config: | ||
| targets: | ||
| - route_type: llm/v1/chat | ||
| auth: | ||
| header_name: Authorization | ||
| header_value: Bearer ${api_key} | ||
| model: | ||
| provider: vercel | ||
| name: openai/gpt-5.5 | ||
| options: | ||
| upstream_url: https://ai-gateway.vercel.sh/v1/chat/completions | ||
| max_tokens: 512 | ||
| temperature: 1.0 | ||
| variables: | ||
| api_key: | ||
| value: $VERCEL_API_KEY | ||
| {% endentity_examples %} | ||
|
|
||
| ## Validate | ||
|
|
||
| {% include how-tos/steps/ai-proxy-validate.md %} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| --- | ||
| title: Set up AI Proxy with Vercel in {{site.base_gateway}} | ||
| permalink: /how-to/set-up-ai-proxy-with-vercel/ | ||
| content_type: how_to | ||
| related_resources: | ||
| - text: "{{site.ai_gateway}}" | ||
| url: /ai-gateway/ | ||
| - text: AI Proxy | ||
| url: /plugins/ai-proxy/ | ||
|
|
||
| description: Configure the AI Proxy plugin to create a chat route using Vercel. | ||
|
|
||
| products: | ||
| - gateway | ||
| - ai-gateway | ||
|
|
||
| works_on: | ||
| - on-prem | ||
| - konnect | ||
|
|
||
| min_version: | ||
| gateway: '2.0.0' | ||
|
|
||
|
jbaross marked this conversation as resolved.
|
||
| plugins: | ||
| - ai-proxy | ||
|
|
||
| entities: | ||
| - service | ||
| - route | ||
| - plugin | ||
|
|
||
| tags: | ||
| - ai | ||
| - openai | ||
| - vercel | ||
|
|
||
| tldr: | ||
| q: How do I use the AI Proxy plugin with Vercel? | ||
| a: Create a Gateway Service and a Route, then enable the AI Proxy plugin and configure it with the OpenAI provider, a Vercel model, and your Vercel API key. | ||
|
|
||
| tools: | ||
| - deck | ||
|
|
||
| prereqs: | ||
| inline: | ||
| - title: Vercel | ||
| include_content: prereqs/vercel | ||
| icon_url: /assets/icons/vercel.svg | ||
| entities: | ||
| services: | ||
| - example-service | ||
| routes: | ||
| - example-route | ||
|
|
||
| cleanup: | ||
| inline: | ||
| - title: Clean up Konnect environment | ||
| include_content: cleanup/platform/konnect | ||
| icon_url: /assets/icons/gateway.svg | ||
| - title: Destroy the {{site.base_gateway}} container | ||
| include_content: cleanup/products/gateway | ||
| icon_url: /assets/icons/gateway.svg | ||
| --- | ||
|
|
||
| ## Configure the plugin | ||
|
|
||
| To set up AI Proxy with Vercel, use the `vercel` provider, specify the [model](https://vercel.com/ai-gateway/models) and set the appropriate authentication header and upstream URL. | ||
|
|
||
| In this example, we'll use the `anthropic/claude-opus-4.6` model: | ||
|
|
||
| {% entity_examples %} | ||
| entities: | ||
| plugins: | ||
| - name: ai-proxy | ||
| config: | ||
| route_type: llm/v1/chat | ||
| auth: | ||
| header_name: Authorization | ||
| header_value: Bearer ${api_key} | ||
| model: | ||
| provider: vercel | ||
| name: anthropic/claude-opus-4.6 | ||
| options: | ||
| upstream_url: https://ai-gateway.vercel.sh/v1/chat/completions | ||
| max_tokens: 512 | ||
| temperature: 1.0 | ||
| variables: | ||
| api_key: | ||
| value: $VERCEL_API_KEY | ||
| {% endentity_examples %} | ||
|
|
||
| ## Validate | ||
|
|
||
| {% include how-tos/steps/ai-proxy-validate.md %} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| This tutorial requires a {{ site.vercel}} API key. | ||
|
|
||
| 1. Create a [{{ site.vercel }}](https://vercel.com/) account. | ||
| 1. Click **{{ site.ai_gateway }}** | ||
| 1. Click **API keys**. | ||
| 1. Click **Create API key**. | ||
| 1. In the **Name** field, enter `Kong`. | ||
| 1. Click **Create API key**. | ||
| 1. Click **Copy**. | ||
| 1. Export the key to your environment: | ||
| ```sh | ||
| export DECK_VERCEL_API_KEY='YOUR VERCEL API KEY' | ||
| ``` |
34 changes: 34 additions & 0 deletions
34
app/_kong_plugins/ai-proxy/examples/vercel-chat-route.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
|
|
||
| title: 'Chat route with Vercel' | ||
| description: 'Configure a chat route using the Vercel AI Gateway.' | ||
|
|
||
| weight: 900 | ||
| min_version: | ||
| gateway: '3.14' | ||
| requirements: | ||
| - Vercel account | ||
|
|
||
| config: | ||
| route_type: llm/v1/chat | ||
| auth: | ||
| header_name: Authorization | ||
| header_value: Bearer ${key} | ||
| model: | ||
| provider: vercel | ||
| name: openai/gpt-5.5 | ||
| options: | ||
| upstream_url: https://ai-gateway.vercel.sh/v1/chat/completions | ||
| max_tokens: 512 | ||
| temperature: 1.0 | ||
|
|
||
| variables: | ||
| key: | ||
| value: $VERCEL_API_KEY | ||
| description: The API key to use to connect to Vercel. | ||
|
|
||
| tools: | ||
| - deck | ||
| - admin-api | ||
| - konnect-api | ||
| - kic | ||
| - terraform |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| --- | ||
| title: "Vercel provider" | ||
| layout: reference | ||
| content_type: reference | ||
| description: Reference for supported capabilities for Vercel provider | ||
| breadcrumbs: | ||
| - /ai-gateway/ | ||
| - /ai-gateway/ai-providers/ | ||
|
|
||
| permalink: /ai-gateway/ai-providers/vercel/ | ||
|
|
||
| works_on: | ||
| - on-prem | ||
| - konnect | ||
|
|
||
| products: | ||
| - gateway | ||
| - ai-gateway | ||
|
|
||
| tools: | ||
| - admin-api | ||
| - konnect-api | ||
| - deck | ||
| - kic | ||
| - terraform | ||
|
|
||
| tags: | ||
| - ai | ||
|
|
||
| plugins: | ||
| - ai-proxy-advanced | ||
| - ai-proxy | ||
|
|
||
| min_version: | ||
| gateway: '2.0.0' | ||
|
jbaross marked this conversation as resolved.
|
||
|
|
||
| related_resources: | ||
| - text: "{{site.ai_gateway}}" | ||
| url: /ai-gateway/ | ||
| - text: "{{site.ai_gateway}} plugins" | ||
| url: /plugins/?category=ai | ||
| - text: AI Providers | ||
| url: /ai-gateway/ai-providers/ | ||
|
|
||
| how_to_list: | ||
| config: | ||
| products: | ||
| - ai-gateway | ||
| tags: | ||
| - vercel | ||
| description: true | ||
| view_more: false | ||
| --- | ||
|
|
||
|
|
||
| {% include plugins/ai-proxy/providers/providers.md providers=site.data.plugins.ai-proxy provider_name="Vercel" %} | ||
|
|
||
| ## Configure {{ provider.name }} with AI Proxy | ||
|
|
||
| To use {{ provider.name }} with {{site.ai_gateway}}, configure the [AI Proxy](/plugins/ai-proxy/) or [AI Proxy Advanced](/plugins/ai-proxy-advanced/) plugin. | ||
|
|
||
| Note that, {{ site.vercel }} hosts [models](https://vercel.com/ai-gateway/models) from other providers so in this example we use `openai/gpt-5.5`. | ||
|
|
||
| Here's a minimal configuration for chat completions: | ||
|
|
||
| {% entity_example %} | ||
| type: plugin | ||
| data: | ||
| name: ai-proxy | ||
| config: | ||
| route_type: llm/v1/chat | ||
| auth: | ||
| header_name: Authorization | ||
| header_value: Bearer ${key} | ||
| model: | ||
| provider: vercel | ||
| name: openai/gpt-5.5 | ||
|
|
||
| variables: | ||
| key: | ||
| value: "$VERCEL_API_KEY" | ||
| {% endentity_example %} | ||
|
|
||
| {:.success} | ||
| > For more configuration options and examples, see: | ||
| > - [AI Proxy examples](/plugins/ai-proxy/examples/) | ||
| > - [AI Proxy Advanced examples](/plugins/ai-proxy-advanced/examples/) | ||
|
|
||
| {% include plugins/ai-proxy/providers/how-tos.md %} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.