-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add hub examples directory with some existing examples
- Loading branch information
1 parent
42f38f7
commit 4372249
Showing
12 changed files
with
196 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,18 @@ | ||
description: | | ||
This configuration enables AI Proxy with Anthropic. | ||
Apply this plugin to a route with `"paths[]=~/anthropic-chat$"` configured. | ||
Replace the `<anthropic_key>` with your own API key. | ||
config: | ||
route_type: "llm/v1/chat" | ||
auth: | ||
header_name: "apikey" | ||
header_value: "<anthropic_key>" # add your own Anthropic API key | ||
model: | ||
provider: "anthropic" | ||
name: "claude-2.1" | ||
options: | ||
max_tokens: 512 | ||
temperature: 1.0 | ||
top_p: 256 |
This file contains 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,17 @@ | ||
description: | | ||
This configuration enables AI Proxy with Azure OpenAI Service. | ||
Apply this plugin to a route with `"paths[]=~/azure-chat$"` configured. | ||
Replace the `<azure_ai_access_key>` with your own API key. | ||
config: | ||
route_type: "llm/v1/chat" | ||
auth: | ||
header_name: "api-key" | ||
header_value: "<azure_ai_access_key>" # add your own Azure OpenAI access key | ||
model: | ||
provider: "azure" | ||
name: "gpt-35-turbo" | ||
options: | ||
azure_instance: "ai-proxy-regression" | ||
azure_deployment_id: "kong-gpt-3-5" |
This file contains 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,17 @@ | ||
description: | | ||
This configuration enables AI Proxy with Cohere. | ||
Apply this plugin to a route with `"paths[]=~/cohere-chat$"` configured. | ||
Replace the `<cohere_key>` with your own API key. | ||
config: | ||
route_type: "llm/v1/chat" | ||
auth: | ||
header_name: "Authorization" | ||
header_value: "Bearer <cohere_key>" # add your own Cohere API key | ||
model: | ||
provider: "cohere" | ||
name: "command" | ||
options: | ||
max_tokens: 512 | ||
temperature: 1.0 |
This file contains 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 @@ | ||
description: | | ||
This configuration enables AI Proxy with Llama2. | ||
You need a running Llama2 instance to use this option. | ||
Apply this plugin to a route with `"paths[]=~/llama2-chat$"` configured. | ||
config: | ||
route_type: "llm/v1/chat" | ||
model: | ||
provider: "llama2" | ||
name: "llama2" | ||
llama2_format: "ollama" | ||
upstream_url: "http://llama2-server.local:11434/api/chat" |
This file contains 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,17 @@ | ||
description: | | ||
This configuration enables AI Proxy with Mistral. | ||
You need a running Mistral instance to use this option. | ||
Apply this plugin to a route with `"paths[]=~/mistral-chat$"` configured. | ||
Replace the `<MISTRAL_AI_KEY>` with your own API key. | ||
config: | ||
route_type: "llm/v1/chat" | ||
auth: | ||
header_name: "Authorization" | ||
header_value: "Bearer <MISTRAL_AI_KEY>" | ||
model: | ||
provider: "mistral" | ||
name: "mistral-tiny" | ||
mistral_format: "openai" | ||
upstream_url: "https://api.mistral.ai/v1/chat/completions" |
This file contains 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,17 @@ | ||
description: | | ||
This configuration enables AI Proxy with OpenAI. | ||
Apply this plugin to a route with `"paths[]=~/openai-chat$"` configured. | ||
Replace the `<openai-key>` with your own API key. | ||
config: | ||
route_type: "llm/v1/chat" | ||
auth: | ||
header_name: "Authorization" | ||
header_value: "Bearer <openai_key>" # add your own OpenAI API key | ||
model: | ||
provider: "openai" | ||
name: "gpt-4" | ||
options: | ||
max_tokens: 512 | ||
temperature: 1.0 |
This file contains 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,12 @@ | ||
description: | | ||
Send Kong Gateway logs to Splunk in raw text using the `/services/collector/raw` Splunk endpoint. | ||
Adjust the `http_endpoint` and its secure token in `headers.Authorization` to your own values. | ||
config: | ||
headers: | ||
Authorization: "Splunk 123456" | ||
http_endpoint: "https://example.splunkcloud.com:8088/services/collector/raw" | ||
method: POST | ||
timeout: 3000 | ||
retry_count: 1 |
This file contains 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,15 @@ | ||
description: | | ||
Authenticate headless service consumers using Auth0's identity provider. | ||
This configuration uses the `client_credentials` grant, and requires you to have | ||
an Auth0 API configured with the `openid` scope. Find your `issuer` URL and `audience` | ||
in your Auth0 API configuration. | ||
config: | ||
auth_methods: | ||
- client_credentials | ||
issuer: "https://<auth0 API name>.auth0.com/.well-known/openid-configuration" | ||
audience: "<auth0 API identifier>" | ||
|
||
# Need to re-check this example, it looks incomplete. Does it actually work? | ||
|
This file contains 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,17 @@ | ||
description: | | ||
Authenticate browser clients using an Azure AD identity provider. | ||
Replace the issuer URL, client ID, client secret, redirect URI, | ||
and the custom scope with your own Azure IdP configuration. | ||
config: | ||
issuer: "https://login.microsoftonline.com/YOUR_DIRECTORY_ID/v2.0/.well-known/openid-configuration" | ||
client_id: "YOUR_CLIENT_ID" | ||
client_secret: "YOUR_CLIENT_SECRET" | ||
redirect_uri: "https://example.com/api" | ||
scopes: | ||
- openid | ||
- profile | ||
- "YOUR_CLIENT_ID/.default" | ||
verify_parameters: false |
This file contains 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,20 @@ | ||
description: | | ||
Integrate Kong Gateway and the Curity Identity Server for introspection using the | ||
Phantom Token pattern. | ||
Replace the issuer URL, client ID, and client secret with your own values. | ||
config: | ||
issuer: "https://idsvr.example.com/oauth/v2/oauth-anonymous" | ||
client_id: "YOUR_CLIENT_ID" | ||
client_secret: "YOUR_CLIENT_SECRET" | ||
scopes_required: | ||
- openid | ||
hide_credentials: true | ||
upstream_access_token_header: nil | ||
upstream_headers_claims: | ||
- phantom_token | ||
upstream_headers_names: | ||
- phantom_token | ||
auth_methods: | ||
- introspection |
This file contains 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,14 @@ | ||
description: | | ||
Authenticate browser clients using Google's identity provider. | ||
Replace the issuer URL, client ID, client secret, and redirect URI | ||
with your own Google IdP configuration. | ||
config: | ||
issuer: "https://accounts.google.com/.well-known/openid-configuration" | ||
client_id: "YOUR_CLIENT_ID" | ||
client_secret: "YOUR_CLIENT_SECRET" | ||
redirect_uri: "https://example.com/api" | ||
scopes: | ||
- openid | ||
This file contains 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,19 @@ | ||
description: | | ||
Authenticate browser clients using Okta. | ||
Replace the issuer URL, client ID, client secret, and redirect URI | ||
with your own Okta configuration values. | ||
config: | ||
issuer: "https://YOUR_OKTA_DOMAIN/oauth2/YOUR_AUTH_SERVER/.well-known/openid-configuration" | ||
client_id: "YOUR_CLIENT_ID" | ||
client_secret: "YOUR_CLIENT_SECRET" | ||
redirect_uri: "https://example.com/api" | ||
scopes_claim: | ||
- scp | ||
scopes: | ||
- openid | ||
- profile | ||
auth_methods: | ||
- authorization_code |