|
| 1 | +# Integrate and Manage Generative AI Services |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Generative AI (GenAI) services leverage advanced machine learning models to produce original content—such as text, images, music, or code—by learning patterns from existing data. Powered by deep neural networks, these services can generate human-like outputs across multiple formats, making them well-suited for tasks like content creation, image generation, and conversational automation. |
| 6 | + |
| 7 | +Choreo provides native support for integrating GenAI services into applications. Using the Choreo AI Gateway, Platform Engineers and Admins can: |
| 8 | + |
| 9 | +- Register GenAI services in the Choreo AI Gateway. |
| 10 | + |
| 11 | +- Manage access and authentication for GenAI services. |
| 12 | + |
| 13 | +- Enforce governance, security, and cost controls for GenAI services at scale. |
| 14 | + |
| 15 | +## Register a GenAI Service |
| 16 | + |
| 17 | +When you register a GenAI service in Choreo, all requests are routed through the AI Gateway, which enforces: |
| 18 | + |
| 19 | +- Security – Authentication, authorization, and encrypted transport. |
| 20 | + |
| 21 | +- Rate Limiting – Token-based throttling. |
| 22 | + |
| 23 | +- Observability (Coming Soon) – Metrics, logging, and monitoring. |
| 24 | + |
| 25 | +This ensures consistent, secure, and cost-controlled access to the underlying provider. |
| 26 | + |
| 27 | +## Registration Scopes |
| 28 | + |
| 29 | +You can register GenAI services at two levels: |
| 30 | + |
| 31 | +- Organization-level registration – Service is available across all projects in the organization. |
| 32 | + |
| 33 | +- Project-level registration – Service is restricted to the project where it is registered. |
| 34 | + |
| 35 | +Once registered, the service is published to the Internal Marketplace, where developers can discover and consume it via Connections. |
| 36 | + |
| 37 | +## Prerequisites |
| 38 | + |
| 39 | +Before registering a GenAI service, obtain the following from your provider: |
| 40 | + |
| 41 | +- API key |
| 42 | + |
| 43 | +- Service URL |
| 44 | + |
| 45 | +- Any additional credentials (e.g., client secrets, subscription keys) |
| 46 | + |
| 47 | +!!! note |
| 48 | + |
| 49 | + - Choose the correct registration scope: |
| 50 | + |
| 51 | + - Use organization-level if the service will be shared across multiple projects. |
| 52 | + - Use project-level if usage is limited to a single project. |
| 53 | + |
| 54 | +## Registration Steps |
| 55 | + |
| 56 | +### Step 1: Select a Service Provider |
| 57 | + |
| 58 | +1. Sign in to the Choreo Console. |
| 59 | + |
| 60 | +!!! info |
| 61 | + **AI Gateway is only available in the US region.** |
| 62 | + |
| 63 | + - 🇺🇸 **US Region**: [console.choreo.dev](https://console.choreo.dev) |
| 64 | + |
| 65 | +2. Select your Organization or Project, depending on the required scope. |
| 66 | + |
| 67 | +3. In the left navigation menu, go to DB & Services → GenAI Services. |
| 68 | + |
| 69 | +4. Choose a provider from the list: |
| 70 | + |
| 71 | +- OpenAI |
| 72 | + |
| 73 | +- Azure OpenAI |
| 74 | + |
| 75 | +- Anthropic Claude |
| 76 | + |
| 77 | +- Mistral |
| 78 | + |
| 79 | +- AWS Bedrock |
| 80 | + |
| 81 | +5. Click Next. |
| 82 | + |
| 83 | +### Step 2: Provide Service Details |
| 84 | + |
| 85 | +Under **Register a GenAI Service**, enter: |
| 86 | + |
| 87 | +- Name – The service name. |
| 88 | + |
| 89 | +- Context Path – A unique identifier for the API within the AI Gateway. |
| 90 | + |
| 91 | +- Service URL – The provider’s endpoint. |
| 92 | + |
| 93 | +- Summary – A short description of the service. |
| 94 | + |
| 95 | +Click **Next**. |
| 96 | + |
| 97 | +### Step 3: Add Environment Configurations |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +### Configure Backend Security |
| 102 | + |
| 103 | +In **Backend Security**, set the Authorization header. |
| 104 | + |
| 105 | +- Provide the API key or credentials (e.g., Authorization: Bearer <token>). |
| 106 | + |
| 107 | +- Key formats may vary by provider. |
| 108 | + |
| 109 | +### Configure Token-Based Rate Limiting |
| 110 | + |
| 111 | +LLMs and GenAI services are billed based on token usage, not just request count. Token-based rate limiting helps: |
| 112 | + |
| 113 | +- Control costs. |
| 114 | + |
| 115 | +- Prevent excessive usage. |
| 116 | + |
| 117 | +- Enforce fair quotas across consumers. |
| 118 | + |
| 119 | +Set the following parameters: |
| 120 | + |
| 121 | +- Time Unit – Enforcement window (per minute, hour, or day). |
| 122 | + |
| 123 | +- Max Prompt Token Count – Maximum input tokens per request. |
| 124 | + |
| 125 | +- Max Completion Token Count – Maximum output tokens per request. |
| 126 | + |
| 127 | +- Max Total Token Count – Combined input + output tokens per request. |
| 128 | + |
| 129 | +Click **Register**. |
| 130 | + |
| 131 | +The service is now available in the Internal Marketplace, where developers can discover and connect to it. |
| 132 | + |
| 133 | +See the [Developer Docs](https://wso2.com/choreo/docs/develop-components/sharing-and-reusing/create-a-connection-to-a-genai-service/) for instructions on how to consume a GenAI service published in the Internal Marketplace. |
| 134 | + |
| 135 | +## Manage Registered Services |
| 136 | + |
| 137 | +### View or Update Service Details |
| 138 | + |
| 139 | +1. Sign in to the [Choreo Console](https://console.choreo.dev). |
| 140 | + |
| 141 | +2. Navigate to DB & Services → GenAI Services. |
| 142 | + |
| 143 | +3. Select a service to view or edit details: |
| 144 | + |
| 145 | +- General Details – Name, description, and labels. |
| 146 | + |
| 147 | +- Environment Configurations – Backend security and rate limiting. |
| 148 | + |
| 149 | +- Deployment Status – View deployment state for each environment. |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | +### Remove a GenAI Service |
| 154 | + |
| 155 | +1. Sign in to the [Choreo Console](https://console.choreo.dev). |
| 156 | + |
| 157 | +2. Navigate to DB & Services → GenAI Services. |
| 158 | + |
| 159 | +3. Select the service. |
| 160 | + |
| 161 | +4. Click Remove from Marketplace. |
| 162 | + |
| 163 | +The service is removed from the Internal Marketplace and can’t be used for new Connections. Existing Connections remain functional until manually removed. |
0 commit comments