Skip to content

Commit 0b0cfc0

Browse files
Add docs for choreo ai gateway feature
1 parent 8a8f1dc commit 0b0cfc0

File tree

8 files changed

+199
-97
lines changed

8 files changed

+199
-97
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Consume a GenAI Service
2+
3+
## Overview
4+
5+
Choreo is a powerful platform that enables developers to create, deploy, and consume services efficiently. The Choreo Internal Marketplace simplifies API discovery and usage, allowing developers to integrate APIs seamlessly into their applications.
6+
7+
This guide is intended for application developers who wish to consume Gen AI Services published in the Internal Marketplace to build their applications.
8+
9+
## Prerequisites
10+
11+
Before proceeding, ensure you have access to a published Gen AI Service to consume. If you do not have one, please follow the PE documentation to create and deploy a sample Gen AI Service.
12+
13+
## Discover Gen AI Services
14+
15+
1. Navigate to the [Choreo Internal Marketplace](https://console.choreo.dev) and sign in.
16+
2. Select the desired Gen AI Service to view its details.
17+
18+
## Create a connection to a Gen AI Service
19+
20+
Follow these steps to create a connection to a Gen AI Service from your choreo component:
21+
22+
1. In the left navigation menu, click **Connections**. This page lists all the existing connections.
23+
2. Click **+Create**. This opens the Marketplace view where you can browse and search for services.
24+
3. Click the **Services** tab. You can search and apply filters to efficiently find a service.
25+
4. Click on the Gen AI service you want to connect to.
26+
5. Enter a name and a description for the connection.
27+
6. Select an **Access Mode** and **Authentication Scheme** for the connection.
28+
7. Click **Create**.
29+
30+
This creates the connection and displays its details for each environment, along with an inline guide on how to use the connection in your component.

en/developer-docs/docs/integrate-and-manage-external-services/integrate-and-manage-gen-ai-services.md

Lines changed: 0 additions & 95 deletions
This file was deleted.

en/developer-docs/mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ nav:
138138
- Integrate Unit Tests into the Build Pipeline: develop-components/integrate-unit-tests-into-the-build-pipeline.md
139139
- Share and Reuse Components:
140140
- Create a Connection: develop-components/sharing-and-reusing/create-a-connection.md
141+
- Create a connection to a GenAI Service: develop-components/sharing-and-reusing/create-a-connection-to-a-genai-service.md
141142
- Use a Connection in Your Service: develop-components/sharing-and-reusing/use-a-connection-in-your-service.md
142143
- Use a Connection in Your Web Application: develop-components/sharing-and-reusing/use-a-connection-in-your-web-application.md
143144
- Use a Database Connection in Your Component: develop-components/sharing-and-reusing/use-a-database-connection-in-your-component.md
@@ -150,7 +151,6 @@ nav:
150151
- Connect to Remote Dependencies While Developing: develop-components/connect-to-remote-dependencies-while-developing.md
151152
- Integrate and Manage External Services:
152153
- Integrate and Manage Third-Party Services: integrate-and-manage-external-services/integrate-and-manage-third-party-services.md
153-
- Integrate and Manage Generative AI Services: integrate-and-manage-external-services/integrate-and-manage-gen-ai-services.md
154154
- Choreo-Managed Databases and Caches:
155155
- Overview: manage-databases-and-caches/choreo-managed-databases-and-caches.md
156156
- PostgreSQL: manage-databases-and-caches/choreo-managed-postgresql-databases.md
358 KB
Loading
292 KB
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Choreo AI Gateway
2+
3+
As AI adoption accelerates, managing AI APIs effectively has become essential for organizations integrating AI into their applications. Choreo's AI Gateway simplifies this process, providing a seamless way to create, manage, and expose AI APIs with robust security and scalability.
4+
5+
![AI Gateway](../../assets/img/ai-gateway/ai-gateway.png)
6+
7+
Choreo offers built-in support for OpenAI, Azure OpenAI, and Mistral and AWS Bedrock.
8+
9+
With a comprehensive set of capabilities, the AI Gateway ensures secure and efficient AI integration. Key features include:
10+
11+
- AI Vendor Key Configuration: Securely authenticate AI APIs by configuring API keys obtained from the AI vendor.
12+
- Rate Limiting: Protect AI backends by enforcing token-based rate limits to manage resource consumption.
13+
- AI API Observability: Track AI API usage statistics using Analytics solutions. (coming soon)
14+
15+
By leveraging these capabilities, organizations can efficiently integrate, monitor, and scale AI APIs, unlocking the full potential of AI-driven applications.
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# Integrate and Manage Generative AI Services
2+
3+
Generative AI (GenAI) services leverage advanced machine learning models to create original content such as text, images, music, or code, by identifying and learning patterns from existing data. Powered by deep neural networks and other machine learning models, these services can generate human-like outputs in various formats. This versatility makes GenAI ideal for tasks such as content creation, image generation, conversation automation, etc.
4+
5+
Choreo provides native support to integrate GenAI services into applications. Developers can register GenAI services, manage access, and expose them securely through the [Choreo AI Gateway](https://github.com/wso2/choreo-ai-gateway), ensuring enterprise-grade governance and control.
6+
7+
## Register a GenAI Service
8+
9+
When you register a GenAI service in Choreo, all invocations are automatically routed through the Choreo AI Gateway. The gateway enforces:
10+
- Security – Authentication, authorization, and secure transport.
11+
- Rate limiting – Request- and token-based throttling.
12+
- Observability – Metrics, logging, and monitoring for all requests (coming soon)
13+
14+
This ensures consistent, secure, and cost-controlled access to the underlying GenAI provider.
15+
16+
### Scopes of Registration
17+
GenAI services can be registered at two scopes:
18+
19+
- **Organization-level registration**: The service is available across all projects within the organization.
20+
- **Project-level registration**: The service is restricted to the specific project where it is registered.
21+
22+
Once registered, the service is published to the Internal Marketplace, where developers can discover and consume it via Connections.
23+
24+
### Prerequisites
25+
Before registering a GenAI service, obtain the following details from the provider:
26+
27+
- API key
28+
- Service URL
29+
- Any additional credentials (e.g., client secrets, subscription keys)
30+
31+
!!! note
32+
- Register services at the correct scope:
33+
- Use organization-level if the service will be shared across projects.
34+
- Use project-level if usage is limited to a single project.
35+
36+
### Step 1: Select a Service Provider
37+
38+
1. Sign in to the [Choreo Console](https://console.choreo.dev).
39+
2. Select your Organization or Project depending on the required scope.
40+
3. In the left navigation menu, go to **DB & Services → GenAI Services**.
41+
4. Select a service provider:
42+
- **OpenAI**
43+
- **Azure OpenAI**
44+
- **Anthropic Claude**
45+
- **Mistral**
46+
- **AWS Bedrock**
47+
48+
5. Click **Next**.
49+
50+
### Step 2: Provide Service Details
51+
52+
1. Under **Register a GenAI Service**, enter the following details:
53+
54+
- **Name**: The name of the service.
55+
- **Context path**: A unique identifier for the service API within the Choreo AI Gateway.
56+
- **Service URL**: The provider’s endpoint.
57+
- **Summary**: A short description of the service.
58+
59+
2. Click **Next**.
60+
61+
### Step 3: Add Environment Configurations
62+
63+
Under **Add Environment Configurations**, configure backend security and token-based rate limiting for your AI API.
64+
65+
!!! note
66+
- Required configurations vary by provider.
67+
- You must provide valid configurations for all environments to complete registration.
68+
69+
#### Configure Backend Security
70+
71+
1. In the AI API Security section:
72+
73+
- Set the Authorization header.
74+
- Provide the API key or credentials from your provider (e.g., `Authorization: Bearer <token>`).
75+
- Key formats may differ by provider.
76+
77+
![Add environment configurations](../../assets/img/ai-gateway/add-configs.png)
78+
79+
#### Configure Token-Based Rate Limiting
80+
81+
Unlike traditional APIs, LLMs and GenAI services are billed based on token consumption rather than just request count. Token-based rate limiting allows you to:
82+
- Control costs.
83+
- Prevent excessive usage.
84+
- Enforce fair quotas across consumers.
85+
86+
2. In the **Token-Based Rate Limiting** section, configure the following parameters:
87+
- **Time Unit**: Window for quota enforcement (per minute, per hour, per day).
88+
- **Max Prompt Token Count**: Limit for input tokens per request.
89+
- **Max Completion Token Count**: Limit for output tokens per request.
90+
- **Max Total Token Count**: Combined input + output tokens per request.
91+
92+
3. Click **Register**.
93+
94+
The service is now available in the Internal Marketplace.
95+
96+
### View or Update Service Details
97+
98+
1. Sign in to the [Choreo Console](https://console.choreo.dev).
99+
2. Navigate to **DB & Services → GenAI Services**.
100+
3. Select a service to view or edit its details:
101+
102+
- **General Details**: Displays metadata such as name, description, and labels..
103+
- **Service Definition**: Displays the service definition.
104+
- **Environment Configurations**: Displays the security and rate-limiting settings for each environment, along with deployment status.
105+
106+
![View or update service details](../../assets/img/ai-gateway/view-configs.png)
107+
108+
### Add a GenAI Service to the Internal Marketplace
109+
110+
1. Sign in to the [Choreo Console](https://console.choreo.dev).
111+
2. Navigate to **DB & Services → GenAI Services**.
112+
3. Select the service.
113+
4. Click **Add to Marketplace**.
114+
115+
### Remove a GenAI Service from the Internal Marketplace
116+
117+
1. Sign in to the [Choreo Console](https://console.choreo.dev).
118+
2. Navigate to **DB & Services → GenAI Services**.
119+
3. Select the service.
120+
4. Click **Remove from Marketplace**.
121+
122+
The service is removed from the Internal Marketplace, making it unavailable for new Connections. However, existing Connections continue to function until manually removed.
123+
124+
## Manage GenAI Services
125+
126+
### View or Update Service Details
127+
128+
1. Sign in to the [Choreo Console](https://console.choreo.dev).
129+
2. Navigate to **DB & Services → GenAI Services**.
130+
3. Select a service to view or edit its details:
131+
132+
- **General Details**: Displays service metadata. For example, the service name, overview, labels, etc.
133+
- **Service Definition**: Displays the service definition. To update the definition, click **Upload** and select the new definition file.
134+
- **Environment Configurations**: Displays the environment configurations for the service. To update the configurations, expand the environment and update the configurations. You can also view the deployment status of the AI API in the environment.
135+
136+
### Add a GenAI Service to the Internal Marketplace
137+
138+
1. Sign in to the [Choreo Console](https://console.choreo.dev).
139+
2. Navigate to **DB & Services → GenAI Services**.
140+
3. Select the service.
141+
4. Click **Add to Marketplace**.
142+
143+
### Remove a GenAI Service from the Internal Marketplace
144+
145+
1. Sign in to the [Choreo Console](https://console.choreo.dev).
146+
2. Navigate to **DB & Services → GenAI Services**.
147+
3. Select the service.
148+
4. Click **Remove from Marketplace**.
149+
150+
The service is removed from the Internal Marketplace, making it unavailable for new Connections. However, existing Connections continue to function until manually removed.

en/pe-docs/mkdocs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ nav:
134134
- Create Choreo-Managed Kafka Services: db-and-services/message-brokers/create-choreo-managed-kafka-services.md
135135
- Configure a Kafka Service: db-and-services/message-brokers/configure-a-kafka-service.md
136136
- Monitor a Kafka Service: db-and-services/message-brokers/monitor-a-kafka-service.md
137-
- Gen AI Services: db-and-services/external-services/integrate-and-manage-gen-ai-services.md
137+
- Gen AI Services:
138+
- Choreo AI Gateway: db-and-services/ai-gateway/choreo-ai-gateway.md
139+
- Integrate and Manage Generative AI Services: db-and-services/ai-gateway/integrate-and-manage-gen-ai-services.md
138140
- K8s Operations:
139141
- Runtime:
140142
- View Kubernetes Runtime Details: k8s-operations/runtime/view-runtime-details.md

0 commit comments

Comments
 (0)