You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concepts/managed-llms/managed-language-models.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Assume you have a web service like the following, which uses the cloud native SD
26
26
27
27
## Deploying OpenAI-compatible apps
28
28
29
-
If you already have an OpenAI-compatible application, Defang makes it easy to deploy on your favourite cloud's managed LLM service. See our [OpenAI Access Gateway](/docs/concepts/openai-access-gateway.md)
29
+
If you already have an OpenAI-compatible application, Defang makes it easy to deploy on your favourite cloud's managed LLM service. See our [OpenAI Access Gateway](/docs/concepts/managed-llms/openai-access-gateway)
Copy file name to clipboardExpand all lines: docs/concepts/managed-llms/openai-access-gateway.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ sidebar_position: 3000
8
8
9
9
Defang makes it easy to deploy on your favourite cloud's managed LLM service with our [OpenAI Access Gateway](https://github.com/DefangLabs/openai-access-gateway). This service sits between your application and the cloud service and acts as a compatibility layer. It handles incoming OpenAI requests, translates those requests to the appropriate cloud-native API, handles the native response, and re-constructs an OpenAI-compatible response.
10
10
11
-
See [our tutorial](/docs/tutorials/deploying-openai-apps-aws-bedrock.mdx/) which describes how to configure the OpenAI Access Gateway for your application
11
+
See [our tutorial](/docs/tutorials/deploying-openai-apps-aws-bedrock/) which describes how to configure the OpenAI Access Gateway for your application
Copy file name to clipboardExpand all lines: docs/providers/aws/aws.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ When using [Managed Postgres](/docs/concepts/managed-storage/managed-postgres.md
72
72
73
73
When using [Managed Redis](/docs/concepts/managed-storage/managed-redis.md), the Defang CLI provisions an ElastiCache Redis cluster in your account.
74
74
75
-
### Managed large language models
75
+
### Managed LLMs
76
76
77
77
Defang offers integration with managed, cloud-native large language model services with the `x-defang-llm` service extension. Add this extension to any services which use the Bedrock SDKs.
Copy file name to clipboardExpand all lines: docs/providers/gcp.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ The Provider builds and deploys your services using [Google Cloud Run](https://c
59
59
60
60
The GCP provider does not currently support storing sensitive config values.
61
61
62
-
### Managed large language models
62
+
### Managed LLMs
63
63
64
64
Defang offers integration with managed, cloud-native large language model services with the `x-defang-llm` service extension. Add this extension to any services which use the Bedrock SDKs.
Copy file name to clipboardExpand all lines: docs/providers/playground.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,6 @@ Overall, the Defang Playground is very similar to deploying to your own cloud ac
20
20
21
21
In essence, the Playground does not support any [managed storage](../concepts/managed-storage) services, ie. `x-defang-postgres` and `x-defang-redis` are ignored when deploying to the Playground. You can however run both Postgres and Redis as regular container services for testing purposes.
22
22
23
-
### Managed large language models
23
+
### Managed LLMs
24
24
25
25
Defang offers integration with managed, cloud-native large language model services with the `x-defang-llm` service extension when deploying to your own cloud account with BYOC. This extension is not supported in the Defang Playground.
title: Deploying your OpenAI application to AWS and using Bedrock
2
+
title: Deploying your OpenAI application to AWS using Bedrock
3
3
sidebar_position: 50
4
4
---
5
5
6
-
# Deploying your OpenAI application to AWS and using Bedrock
6
+
# Deploying your OpenAI application to AWS using Bedrock
7
7
8
8
Let's assume you have an app which is using one of the OpenAI client libraries and you want to deploy your app to AWS so you can leverage Bedrock. This tutorial will show you how Defang makes it easy.
The first step is to add a new service to your compose file. The`defangio/openai-access-gateway`. This service provides an OpenAI compatible interface to AWS Bedrock. It's easy to configure, first you need to add it to your compose file:
27
+
The first step is to add a new service to your compose file: the`defangio/openai-access-gateway`. This service provides an OpenAI compatible interface to AWS Bedrock. It's easy to configure, first you need to add it to your compose file:
31
28
32
29
```diff
33
30
+ llm:
@@ -36,15 +33,21 @@ The first step is to add a new service to your compose file. The `defangio/opena
A few things to note here. First the image is a fork of [aws-samples/bedrock-access-gateway](https://github.com/aws-samples/bedrock-access-gateway), which a few modifications to make it easier to use. The source code is available [here](https://github.com/DefangLabs/openai-access-gateway). Second: the `x-defang-llm` property. Defang uses extensions like this to signal special handling of certain kinds of services. In this case, it signals to Defang that we need to configure the appropriate IAM Roles and Policies to support your application.
41
+
A few things to note here. First the image is a fork of [aws-samples/bedrock-access-gateway](https://github.com/aws-samples/bedrock-access-gateway), with a few modifications to make it easier to use. The source code is available [here](https://github.com/DefangLabs/openai-access-gateway). Second: the `x-defang-llm` property. Defang uses extensions like this to signal special handling of certain kinds of services. In this case, it signals to Defang that we need to configure the appropriate IAM Roles and Policies to support your application.
42
+
43
+
:::warning
44
+
**Your OpenAI key**
45
+
46
+
You no longer need to use your original OpenAI API key. We do recommend using _something_ in its place, but feel free to generate a new secret and set it with `defang config set OPENAI_API_KEY --random`.
47
+
48
+
This is used to authenticate your application service with the openai-access-gateway.
49
+
:::
50
+
48
51
49
52
## Redirecting application traffic
50
53
@@ -54,30 +57,23 @@ Then you need to configure your application to redirect traffic to the openai-ac
You will also need to configure your application to use one of the bedrock models. We recommend configuring an environment variable called `MODEL` like this:
70
-
71
68
## Selecting a model
72
69
70
+
You will also need to configure your application to use one of the bedrock models. We recommend configuring an environment variable called `MODEL` like this:
71
+
73
72
```diff
74
73
services:
75
74
app:
76
75
ports:
77
-
- target: 3000
78
-
published: 3000
79
-
protocol: tcp
80
-
mode: ingress
76
+
- 3000:3000
81
77
environment:
82
78
OPENAI_API_KEY:
83
79
OPENAI_BASE_URL: "http://llm/api/v1"
@@ -86,13 +82,11 @@ You will also need to configure your application to use one of the bedrock model
AWS currently requires access to be manually configured on a per-model basis in each account. See this guide for [how to enable model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html).
92
-
93
-
## Your OpenAI key
94
-
95
-
It's worth noting that you no longer need ot use your original OpenAI API key. We do recommend using _something_ in its place, but feel free to generate a new secret and set it with `defang config set OPENAI_API_KEY`.
0 commit comments