Skip to content

Commit 765fe5c

Browse files
authored
Merge pull request #378 from DefangLabs/linda-model-mapping-readme
Revise model choice for managed LLM samples
2 parents d88cfe4 + 43637ea commit 765fe5c

File tree

4 files changed

+8
-28
lines changed

4 files changed

+8
-28
lines changed

samples/managed-llm-provider/README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ You can configure the `MODEL` and `ENDPOINT_URL` for the LLM separately for loca
1414

1515
Ensure you have enabled model access for the model you intend to use. To do this, you can check your [AWS Bedrock model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html) or [GCP Vertex AI model access](https://cloud.google.com/vertex-ai/generative-ai/docs/control-model-access).
1616

17+
To learn about available LLM models in Defang, please see our [Model Mapping documentation](https://docs.defang.io/docs/concepts/managed-llms/openai-access-gateway#model-mapping).
18+
1719
For more about Managed LLMs in Defang, please see our [Managed LLMs documentation](https://docs.defang.io/docs/concepts/managed-llms/managed-language-models).
1820

1921
### Docker Model Provider
@@ -36,18 +38,6 @@ To run the application locally, you can use the following command:
3638
docker compose -f compose.dev.yaml up --build
3739
```
3840

39-
## Configuration
40-
41-
For this sample, you will need to provide the following [configuration](https://docs.defang.io/docs/concepts/configuration):
42-
43-
> Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you.
44-
45-
### `MODEL`
46-
The Model ID of the LLM you are using for your application. For example, `anthropic.claude-3-haiku-20240307-v1:0`.
47-
```bash
48-
defang config set MODEL
49-
```
50-
5141
## Deployment
5242

5343
> [!NOTE]

samples/managed-llm-provider/compose.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ services:
88
restart: always
99
environment:
1010
- ENDPOINT_URL=http://llm/api/v1/chat/completions # endpoint to the Provider Service
11-
- MODEL=anthropic.claude-3-haiku-20240307-v1:0 # LLM model ID used in the Provider Service
11+
- MODEL=default # LLM model ID used in the Provider Service
12+
# For other models, see https://docs.defang.io/docs/concepts/managed-llms/openai-access-gateway#model-mapping
1213
healthcheck:
1314
test: ["CMD", "python3", "-c", "import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read()", "http://localhost:8000/"]
1415
interval: 30s

samples/managed-llm/README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ You can configure the `MODEL` and `ENDPOINT_URL` for the LLM separately for loca
1717

1818
Ensure you have enabled model access for the model you intend to use. To do this, you can check your [AWS Bedrock model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html) or [GCP Vertex AI model access](https://cloud.google.com/vertex-ai/generative-ai/docs/control-model-access).
1919

20+
To learn about available LLM models in Defang, please see our [Model Mapping documentation](https://docs.defang.io/docs/concepts/managed-llms/openai-access-gateway#model-mapping).
21+
2022
For more about Managed LLMs in Defang, please see our [Managed LLMs documentation](https://docs.defang.io/docs/concepts/managed-llms/managed-language-models).
2123

2224
### Defang OpenAI Access Gateway
@@ -39,18 +41,6 @@ To run the application locally, you can use the following command:
3941
docker compose -f compose.dev.yaml up --build
4042
```
4143

42-
## Configuration
43-
44-
For this sample, you will need to provide the following [configuration](https://docs.defang.io/docs/concepts/configuration):
45-
46-
> Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you.
47-
48-
### `MODEL`
49-
The Model ID of the LLM you are using for your application. For example, `anthropic.claude-3-haiku-20240307-v1:0`.
50-
```bash
51-
defang config set MODEL
52-
```
53-
5444
## Deployment
5545

5646
> [!NOTE]

samples/managed-llm/compose.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ services:
88
restart: always
99
environment:
1010
- ENDPOINT_URL=http://llm/api/v1/chat/completions # endpoint to the gateway service
11-
- MODEL=anthropic.claude-3-haiku-20240307-v1:0 # LLM model ID used for the gateway
11+
- MODEL=default # LLM model ID used for the gateway.
12+
# For other models, see https://docs.defang.io/docs/concepts/managed-llms/openai-access-gateway#model-mapping
1213
- OPENAI_API_KEY=FAKE_TOKEN # the actual value will be ignored when using the gateway, but it should match the one in the llm service
1314
healthcheck:
1415
test: ["CMD", "python3", "-c", "import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read()", "http://localhost:8000/"]
@@ -29,8 +30,6 @@ services:
2930
mode: host
3031
environment:
3132
- OPENAI_API_KEY=FAKE_TOKEN # this value must match the one in the app service
32-
- USE_MODEL_MAPPING=false
33-
- DEBUG=true
3433
# if using GCP for BYOC deployment, add these environment variables:
3534
# - GCP_PROJECT_ID=${GCP_PROJECT_ID}
3635
# - GCP_REGION=${GCP_REGION}

0 commit comments

Comments
 (0)