Skip to content

Commit 0ac8969

Browse files
committed
docs(AWS Bedrock): Add alternative integrations and remove outdated Bedrock models registration
1 parent 08ced90 commit 0ac8969

File tree

2 files changed

+201
-27
lines changed

2 files changed

+201
-27
lines changed

docs/tutorials/integrations/amazon-bedrock.md

Lines changed: 201 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,58 @@ This tutorial is a community contribution and is not supported by the Open WebUI
1111

1212
---
1313

14-
# Integrating Open-WebUI with Amazon Bedrock
14+
# Integrating Open WebUI with Amazon Bedrock
1515

16-
In this tutorial, we'll explore one of the most common and popular approaches to integrate Open-WebUI with Amazon Bedrock.
17-
18-
## Prerequisites
19-
20-
In order to follow this tutorial, you must have the following:
21-
22-
- An active AWS account
23-
- An active AWS Access Key and Secret Key
24-
- IAM permissions in AWS to enable Bedrock models or already enabled models
25-
- Docker installed on your system
16+
In this tutorial, we'll explore the most common and popular approaches to integrate Open WebUI with Amazon Bedrock.
2617

2718
## What is Amazon Bedrock
2819

2920
Direct from AWS' website:
3021

3122
"Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models (FMs) from leading AI companies like AI21 Labs, Anthropic, Cohere, Luma, Meta, Mistral AI, poolside (coming soon), Stability AI, and Amazon through a single API, along with a broad set of capabilities you need to build generative AI applications with security, privacy, and responsible AI. Using Amazon Bedrock, you can easily experiment with and evaluate top FMs for your use case, privately customize them with your data using techniques such as fine-tuning and Retrieval Augmented Generation (RAG), and build agents that execute tasks using your enterprise systems and data sources. Since Amazon Bedrock is serverless, you don't have to manage any infrastructure, and you can securely integrate and deploy generative AI capabilities into your applications using the AWS services you are already familiar with."
3223

33-
To learn more about Bedrock, visit: [Amazon Bedrock's Official Page](https://aws.amazon.com/bedrock/)
24+
To learn more about Bedrock, visit the [Amazon Bedrock official page](https://aws.amazon.com/bedrock/).
25+
26+
# Integration Options
27+
28+
There are multiple OpenAI-compatible ways to connect Open WebUI to AWS Bedrock:
29+
30+
* **Bedrock Access Gateway** (BAG)
31+
* **stdapi.ai**
32+
* **LiteLLM** with its Bedrock provider (LiteLLM is not dedicated to AWS).
33+
* **Bedrock Mantle** - AWS native solution, no installation required
34+
35+
## Feature Comparison
36+
37+
| Capability | Bedrock Access Gateway (BAG) | stdapi.ai | LiteLLM (Bedrock provider) | AWS Bedrock Mantle |
38+
|------------------------------| --- | --- | --- | --- |
39+
| Automatic models discovery |||||
40+
| Chat completion |||||
41+
| Embeddings |||||
42+
| Text to speech |||||
43+
| Speech to text |||||
44+
| Image generation |||||
45+
| Image editing |||||
46+
| Models from multiple regions |||||
47+
| No installation required |||||
48+
| License | MIT | AGPL or Commercial | MIT or Commercial | AWS Service |
3449

3550
# Integration Steps
3651

37-
## Step 1: Verify access to Amazon Bedrock Base Models
52+
## Solution 1: Bedrock Access Gateway (BAG)
3853

39-
Before we can integrate with Bedrock, you first have to verify that you have access to at least one, but preferably many, of the available Base Models. At the time of this writing (Feb 2025), there were 47 base models available. You can see in the screenshot below that I have access to multiple models. You'll know if you have access to a model if it says "✅ Access Granted" next to the model. If you don't have access to any models, you will get an error on the next step.
54+
### Prerequisites
4055

41-
AWS provides good documentation for request accessing / enabling these models in the [Amazon Bedrock's Model Access Docs](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html)
56+
In order to follow this tutorial, you must have the following:
4257

43-
![Amazon Bedrock Base Models](/images/tutorials/amazon-bedrock/amazon-bedrock-base-models.png)
58+
- An active AWS account
59+
- An active AWS Access Key and Secret Key
60+
- IAM permissions in AWS to enable Bedrock models or already enabled models
61+
- Docker installed on your system
4462

45-
## Step 2: Configure the Bedrock Access Gateway
63+
### Step 1: Configure the Bedrock Access Gateway
4664

47-
Now that we have access to at least one Bedrock base model, we need to configure the Bedrock Access Gateway, or BAG. You can think of the BAG as kind of proxy or middleware developed by AWS that wraps around AWS native endpoints/SDK for Bedrock and, in turn, exposes endpoints that are compatible with OpenAI's schema, which is what Open-WebUI requires.
65+
We need to configure the Bedrock Access Gateway, or BAG. You can think of the BAG as kind of proxy or middleware developed by AWS that wraps around AWS native endpoints/SDK for Bedrock and, in turn, exposes endpoints that are compatible with OpenAI's schema, which is what Open-WebUI requires.
4866

4967
For reference, here is a simple mapping between the endpoints:
5068

@@ -75,9 +93,9 @@ You should now be able to access the BAG's swagger page at: http://localhost:800
7593

7694
![Bedrock Access Gateway Swagger](/images/tutorials/amazon-bedrock/amazon-bedrock-proxy-api.png)
7795

78-
## Step 3: Add Connection in Open-WebUI
96+
### Step 2: Add Connection in Open WebUI
7997

80-
Now that you the BAG up-and-running, it's time to add it as a new connection in Open-WebUI.
98+
Now that you the BAG up-and-running, it's time to add it as a new connection in Open WebUI.
8199

82100
- Under the Admin Panel, go to Settings -> Connections.
83101
- Use the "+" (plus) button to add a new connection under the OpenAI
@@ -87,15 +105,171 @@ Now that you the BAG up-and-running, it's time to add it as a new connection in
87105

88106
![Add New Connection](/images/tutorials/amazon-bedrock/amazon-bedrock-proxy-connection.png)
89107

90-
## Step 4: Start using Bedrock Base Models
108+
### Other Helpful Tutorials
91109

92-
You should now see all your Bedrock models available!
110+
These are a few other very helpful tutorials when working to integrate Open WebUI with Amazon Bedrock using the Bedrock Access Gateway.
93111

94-
![Use Bedrock Models](/images/tutorials/amazon-bedrock/amazon-bedrock-models-in-oui.png)
112+
- https://gauravve.medium.com/connecting-open-webui-to-aws-bedrock-a1f0082c8cb2
113+
- https://jrpospos.blog/posts/2024/08/using-amazon-bedrock-with-openwebui-when-working-with-sensitive-data/
95114

96-
## Other Helpful Tutorials
115+
## Solution 2: stdapi.ai
97116

98-
These are a few other very helpful tutorials when working to integrate Open-WebUI with Amazon Bedrock.
117+
[stdapi.ai](https://stdapi.ai/) is an OpenAI-compatible API gateway you deploy in your AWS account, or run locally using Docker.
99118

100-
- https://gauravve.medium.com/connecting-open-webui-to-aws-bedrock-a1f0082c8cb2
101-
- https://jrpospos.blog/posts/2024/08/using-amazon-bedrock-with-openwebui-when-working-with-sensitive-data/
119+
Open WebUI connects to it as if it were OpenAI, and stdapi.ai routes requests to Bedrock and other AWS AI services such as Amazon Polly and Transcribe. It also supports multi-region access to Bedrock, making it easier to reach more models that may only be available in specific AWS regions.
120+
121+
### stdapi.ai Deployment
122+
123+
#### Deploying on AWS
124+
125+
stdapi.ai provides a full Terraform sample that provisions Open WebUI on ECS Fargate, connects it to stdapi.ai, and includes supporting services like Elasticache Valkey, Aurora PostgreSQL with vector extension, SearXNG, and Playwright.
126+
This method handles both the stdapi.ai and Open WebUI configuration:
127+
128+
- [stdapi.ai Documentation - Open WebUI integration](https://stdapi.ai/use_cases_openwebui/)
129+
- [stdapi-ai GitHub - Open WebUI Terraform sample](https://github.com/stdapi-ai/samples/tree/main/getting_started_openwebui)
130+
131+
stdapi.ai also provides documentation and Terraform samples to deploy it independently if you prefer to connect it to an existing Open WebUI instance.
132+
133+
- [stdapi.ai Documentation - Getting started](https://stdapi.ai/operations_getting_started/)
134+
135+
#### Deploying Locally
136+
137+
stdapi.ai also provides a Docker image for local usage.
138+
139+
Here is a minimal command to run it using your AWS access key:
140+
```bash
141+
docker run \
142+
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
143+
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
144+
-e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \
145+
-e AWS_BEDROCK_REGIONS=us-east-1,us-west-2 \
146+
-e ENABLE_DOCS=true \
147+
--rm \
148+
-p 8000:8000 \
149+
ghcr.io/stdapi-ai/stdapi.ai-community:latest
150+
```
151+
The application is now available at http://localhost:8000 (use it as `YOUR_STDAPI_URL` in the Open WebUI configuration below).
152+
153+
The `AWS_BEDROCK_REGIONS` variable lets you select regions where you want to load models, in this case `us-east-1` and `us-west-2`.
154+
155+
If you pass the `ENABLE_DOCS=true` variable, an interactive Swagger documentation page is available at http://localhost:8000/docs.
156+
157+
`API_KEY=my_secret_password` can also be used to set a custom API key for the application (defaults to no API key required). This is highly recommended if the server is reachable from elsewhere. Use this API key as `YOUR_STDAPI_KEY` in the Open WebUI configuration below.
158+
159+
Many other configuration options are available; see [the documentation](https://stdapi.ai/operations_configuration/) for more information.
160+
161+
### Open WebUI Configuration
162+
163+
Open WebUI is configured via environment variables, and you can also set the same values from the Open WebUI admin panel.
164+
165+
Use the same stdapi.ai key for all `*_OPENAI_API_KEY` entries.
166+
167+
#### Core connection (chat + background tasks)
168+
169+
```bash
170+
OPENAI_API_BASE_URL=YOUR_STDAPI_URL/v1
171+
OPENAI_API_KEY=YOUR_STDAPI_KEY
172+
TASK_MODEL_EXTERNAL=amazon.nova-micro-v1:0
173+
```
174+
175+
Use a fast, low-cost chat model for `TASK_MODEL_EXTERNAL`.
176+
177+
#### RAG embeddings
178+
179+
```bash
180+
RAG_EMBEDDING_ENGINE=openai
181+
RAG_OPENAI_API_BASE_URL=YOUR_STDAPI_URL/v1
182+
RAG_OPENAI_API_KEY=YOUR_STDAPI_KEY
183+
RAG_EMBEDDING_MODEL=cohere.embed-v4:0
184+
```
185+
186+
Pick any embedding model you prefer.
187+
188+
#### Image generation
189+
190+
```bash
191+
ENABLE_IMAGE_GENERATION=true
192+
IMAGE_GENERATION_ENGINE=openai
193+
IMAGES_OPENAI_API_BASE_URL=YOUR_STDAPI_URL/v1
194+
IMAGES_OPENAI_API_KEY=YOUR_STDAPI_KEY
195+
IMAGE_GENERATION_MODEL=stability.stable-image-core-v1:1
196+
```
197+
198+
Choose any image generation model you prefer.
199+
200+
#### Image editing
201+
202+
```bash
203+
ENABLE_IMAGE_EDIT=true
204+
IMAGE_EDIT_ENGINE=openai
205+
IMAGES_EDIT_OPENAI_API_BASE_URL=YOUR_STDAPI_URL/v1
206+
IMAGES_EDIT_OPENAI_API_KEY=YOUR_STDAPI_KEY
207+
IMAGE_EDIT_MODEL=stability.stable-image-control-structure-v1:0
208+
```
209+
210+
Pick any image-editing model that supports edits without a mask.
211+
212+
#### Speech to text (STT)
213+
214+
```bash
215+
AUDIO_STT_ENGINE=openai
216+
AUDIO_STT_OPENAI_API_BASE_URL=YOUR_STDAPI_URL/v1
217+
AUDIO_STT_OPENAI_API_KEY=YOUR_STDAPI_KEY
218+
AUDIO_STT_MODEL=amazon.transcribe
219+
```
220+
221+
#### Text to speech (TTS)
222+
223+
```bash
224+
AUDIO_TTS_ENGINE=openai
225+
AUDIO_TTS_OPENAI_API_BASE_URL=YOUR_STDAPI_URL/v1
226+
AUDIO_TTS_OPENAI_API_KEY=YOUR_STDAPI_KEY
227+
AUDIO_TTS_MODEL=amazon.polly-neural
228+
```
229+
230+
If you see inconsistent auto-detection for TTS languages, set a fixed language in stdapi.ai (for example, `DEFAULT_TTS_LANGUAGE=en-US`).
231+
232+
## Solution 3: AWS Bedrock Mantle
233+
234+
[Bedrock Mantle](https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html) is an AWS-native solution that provides an OpenAI-compatible API endpoint for Amazon Bedrock without requiring any additional infrastructure or installation. This makes it the simplest integration option for accessing Bedrock models.
235+
236+
### Key Advantages
237+
238+
- **No installation required** - Uses AWS-managed endpoints directly
239+
- **Simple configuration** - Just requires an API key
240+
- **Native AWS integration** - Fully managed by AWS
241+
242+
### Limitations
243+
244+
- **Chat completion only** - Does not support embeddings, image generation, or other features
245+
- **Subset of models** - Only provides access to a limited selection of Bedrock models (Open weight models)
246+
- **Single region** - Does not support multi-region access
247+
248+
### Prerequisites
249+
250+
- An active AWS account
251+
- An [Amazon Bedrock API key](https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html) (create one from the AWS console)
252+
- IAM permissions to use Bedrock models (recommended: `AmazonBedrockMantleInferenceAccess` IAM policy)
253+
254+
### Configuration
255+
256+
Configure Open WebUI using environment variables:
257+
258+
```bash
259+
OPENAI_API_BASE_URL=https://bedrock.us-east-1.api.aws/v1
260+
OPENAI_API_KEY=your_bedrock_api_key
261+
```
262+
263+
Replace `your_bedrock_api_key` with the [Amazon Bedrock API key](https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html) you created.
264+
265+
Replace `us-east-1` in the URL with your preferred AWS region (e.g., `us-west-2`, `eu-west-1`, etc.).
266+
267+
You can also set the same values from the Open WebUI admin panel.
268+
269+
For more information, see the [Bedrock Mantle documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html).
270+
271+
# Start using Bedrock Base Models
272+
273+
You should now see all your Bedrock models available!
274+
275+
![Use Bedrock Models](/images/tutorials/amazon-bedrock/amazon-bedrock-models-in-oui.png)
Binary file not shown.

0 commit comments

Comments
 (0)