Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 929076f

Browse files
authored
Add information for on-demand model switching in Bedrock (#1648)
1 parent 56c4346 commit 929076f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

content/en/references/configuration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ This section covers configuration options that are specific to certain AWS servi
9595
| Variable | Example Values | Description |
9696
| - | - | - |
9797
| `BEDROCK_PREWARM` | `0` (default) \| `1` | Pre-warm the Bedrock engine directly on LocalStack startup instead of on demand. |
98-
| `DEFAULT_BEDROCK_MODEL` | `smollm2:360m` (default) | The model to use to handle text model invocations in Bedrock. Any text-based model available for Ollama is usable. |
98+
| `DEFAULT_BEDROCK_MODEL` | `smollm2:360m` (default) | The model that is used initially to handle text model invocations in Bedrock. Any text-based model available for Ollama is usable. |
99+
| `BEDROCK_PULL_MODELS` | `deepseek-r1,mistral` \' '' (default) | A list of models that should get pulled into the model cache on startup. `DEFAULT_BEDROCK_MODEL` is automatically in there |
99100

100101
### BigData (EMR, Athena, Glue)
101102

content/en/user-guide/aws/bedrock/index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ The startup of the Bedrock engine can take some time.
2929
Per default, we only start it once you send a request to one of the `bedrock-runtime` APIs.
3030
However, if you want to start the engine when localstack starts to avoid long wait times on your first request you can set the flag `BEDROCK_PREWARM`.
3131

32+
On startup, the `DEFAULT_BEDROCK_MODEL` is pulled from the Ollama library and loaded into memory.
33+
However, you can define an additional list of models in `BEDROCK_PULL_MODELS` to pull additional models when the Bedrock engine starts up.
34+
This way you avoid long wait times when switching between models on demand with requests.
35+
3236
### List available foundation models
3337

3438
You can view all available foundation models using the [`ListFoundationModels`](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListFoundationModels.html) API.
@@ -140,6 +144,20 @@ For example, to use the Mistral model, set the environment variable while starti
140144
$ DEFAULT_BEDROCK_MODEL=mistral localstack start
141145
{{< / command >}}
142146

147+
You can also define models directly in the request, by setting the `model-id` parameter to `ollama.<ollama-model-id>`.
148+
For example, if you want to access `deepseek-r1`, you can do it like this:
149+
150+
{{< command >}}
151+
$ awslocal bedrock-runtime converse \
152+
--model-id "ollama.deepseek-r1" \
153+
--messages '[{
154+
"role": "user",
155+
"content": [{
156+
"text": "Say Hello!"
157+
}]
158+
}]'
159+
{{< / command >}}
160+
143161
## Troubleshooting
144162

145163
Users of Docker Desktop on macOS or Windows might run into the issue of Bedrock becoming unresponsive after some usage.

0 commit comments

Comments
 (0)