|
1 | 1 | ---
|
2 |
| -title: Deploying OpenAI-compatible apps with Defang |
| 2 | +title: OpenAI Access Gateway |
3 | 3 | description: Defang makes it easy to leverage cloud-native managed language models for your OpenAI-compatible application.
|
4 | 4 | sidebar_position: 3000
|
5 | 5 | ---
|
6 | 6 |
|
7 |
| -# Deploying OpenAI-compatible applications to cloud-native managed language models with Defang |
| 7 | +# OpenAI Access Gateway |
8 | 8 |
|
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. |
| 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. |
| 10 | +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 | 11 |
|
11 | 12 | See [our tutorial](/docs/tutorials/deploying-openai-apps-aws-bedrock-gcp-vertex/) which describes how to configure the OpenAI Access Gateway for your application
|
12 | 13 |
|
| 14 | +## Docker Provider Services |
| 15 | + |
| 16 | +As of Docker Compose v2.35 and Docker Desktop v4.41, Compose introduces a new service type called `provider` that allows you to declare platform capabilities required by your application. |
| 17 | +For AI models, you use the `model` type to declare model dependencies. This will expose an OpenAI compatible API for your service. Check the [Docker Model Runner documentation](https://docs.docker.com/compose/how-tos/model-runner/) for more details. |
| 18 | + |
| 19 | +```yaml |
| 20 | +services: |
| 21 | + chat: |
| 22 | + build: . |
| 23 | + depends_on: |
| 24 | + - ai_runner |
| 25 | + |
| 26 | + ai_runner: |
| 27 | + provider: |
| 28 | + type: model |
| 29 | + options: |
| 30 | + model: ai/mistral |
| 31 | + x-defang-llm: true |
| 32 | +``` |
| 33 | +
|
| 34 | +Under the hood, when you use the `model` provider, Defang will deploy the **OpenAI Access Gateway** in a private network. This allows you to use the same code for both local development and cloud deployment. |
| 35 | +The `x-defang-llm` extension is used to configure the appropriate roles and permissions for your service. See the [Managed Language Models](/docs/concepts/managed-llms/managed-language-models/) page for more details. |
| 36 | + |
13 | 37 | ## Current Support
|
14 | 38 |
|
15 | 39 | | Provider | Managed Language Models |
|
16 | 40 | | --- | --- |
|
17 |
| -| [Playground](/docs/providers/playground#managed-services) | ❌ | |
| 41 | +| [Playground](/docs/providers/playground#managed-services) | ✅ | |
18 | 42 | | [AWS Bedrock](/docs/providers/aws#managed-llms) | ✅ |
|
19 | 43 | | [DigitalOcean GenAI](/docs/providers/digitalocean#future-improvements) | ❌ |
|
20 | 44 | | [GCP Vertex AI](/docs/providers/gcp#managed-llms) | ✅ |
|
0 commit comments