|
| 1 | +--- |
| 2 | +title: Bedrust - invoke models on Amazon Bedrock |
| 3 | +minutes_to_complete: 10 |
| 4 | +author: Jason Andrews |
| 5 | + |
| 6 | +draft: true |
| 7 | + |
| 8 | +additional_search_terms: |
| 9 | +- rust |
| 10 | +- aws |
| 11 | + |
| 12 | +layout: installtoolsall |
| 13 | + |
| 14 | +multi_install: false |
| 15 | +multitool_install_part: false |
| 16 | +official_docs: https://github.com/darko-mesaros/bedrust |
| 17 | +test_images: |
| 18 | +- ubuntu:latest |
| 19 | +test_maintenance: true |
| 20 | +tool_install: true |
| 21 | +weight: 1 |
| 22 | +--- |
| 23 | + |
| 24 | +Bedrust is a command line program you can use to easily invoke models on Amazon Bedrock, a managed service that makes it easy for developers to build and scale generative AI applications using foundation models (FMs) from leading AI model providers . |
| 25 | + |
| 26 | +Bedrust is available as Rust source code, and you can build and run it on an Arm Linux computer. |
| 27 | + |
| 28 | +## What should I consider before installing Bedrust? |
| 29 | + |
| 30 | +You will need an AWS account to access Bedrock, which you can create at https://aws.amazon.com. (Click on **Create an AWS Account** in the top right corner. Follow the instructions to register. See the [Creating an AWS account documentation](https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-creating.html) for full instructions.) |
| 31 | + |
| 32 | +To use Bedrust you need to: |
| 33 | + |
| 34 | +- Configure your AWS account credentials to talk to the Bedrock service |
| 35 | +- Enable foundation model access in the Bedrock console |
| 36 | + |
| 37 | +### Configure credentials |
| 38 | + |
| 39 | +To connect to Bedrock, you need to install the [AWS CLI](/install-guides/aws-cli/), generate an access key ID and secret access key, and use the `aws configure` command to enter your credentials. |
| 40 | + |
| 41 | +Refer to [AWS Credentials](/install-guides/aws_access_keys/) for more details. |
| 42 | + |
| 43 | +### Enable model access in Bedrock |
| 44 | + |
| 45 | +To use Bedrock models you need to request access to specific foundation models through the AWS Bedrock console. |
| 46 | + |
| 47 | +In your AWS account, navigate to "Model access" in the Bedrock console and select the models you want to use. |
| 48 | + |
| 49 | +Refer to [Getting started with Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/getting-started.html) for additional documentation. |
| 50 | + |
| 51 | +## How do I download and install Bedrust? |
| 52 | + |
| 53 | +The easiest way to install Bedrust is by using Cargo, the Rust package manager. |
| 54 | + |
| 55 | +### Install Rust |
| 56 | + |
| 57 | +Ensure you have Rust and Cargo installed on your computer. If not, install them using the commands: |
| 58 | + |
| 59 | +```bash |
| 60 | +sudo apt install curl gcc -y |
| 61 | +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| 62 | +source "$HOME/.cargo/env" |
| 63 | +``` |
| 64 | + |
| 65 | +Refer to the [Rust install guide](/install-guides/rust/) for more information. |
| 66 | + |
| 67 | +### Clone the repository and install Bedrust |
| 68 | + |
| 69 | +Get the Bedrust source code: |
| 70 | + |
| 71 | +```bash |
| 72 | +git clone https://github.com/darko-mesaros/bedrust.git |
| 73 | +cd bedrust |
| 74 | +``` |
| 75 | + |
| 76 | +With Rust and Cargo installed, you can install Bedrust: |
| 77 | + |
| 78 | +```bash |
| 79 | +cargo install bedrust |
| 80 | +``` |
| 81 | + |
| 82 | +### Verify the Installation |
| 83 | + |
| 84 | +After installation, confirm that Bedrust is installed and available in your search path by checking the version: |
| 85 | + |
| 86 | +```bash |
| 87 | +bedrust --version |
| 88 | +``` |
| 89 | + |
| 90 | +The output displays the installed version: |
| 91 | + |
| 92 | +```output |
| 93 | +bedrust 0.8.8 |
| 94 | +``` |
| 95 | + |
| 96 | +## How do I configure Bedrust? |
| 97 | + |
| 98 | +You can set the default foundation model you want to use: |
| 99 | + |
| 100 | +```console |
| 101 | +bedrust --init |
| 102 | +``` |
| 103 | + |
| 104 | +Use the menu to select the default model: |
| 105 | + |
| 106 | +```output |
| 107 | +📜 | Initializing Bedrust configuration. |
| 108 | +? Select a default model to use press <enter> to skip › |
| 109 | + meta.llama2-70b-chat-v1 |
| 110 | + meta.llama3-1-405b-instruct-v1:0 |
| 111 | + meta.llama3-1-70b-instruct-v1:0 |
| 112 | + meta.llama3-1-8b-instruct-v1:0 |
| 113 | + cohere.command-text-v14 |
| 114 | + anthropic.claude-v2 |
| 115 | + anthropic.claude-v2:1 |
| 116 | + anthropic.claude-3-opus-20240229-v1:0 |
| 117 | + anthropic.claude-3-sonnet-20240229-v1:0 |
| 118 | + anthropic.claude-3-haiku-20240307-v1:0 |
| 119 | + anthropic.claude-3-5-sonnet-20240620-v1:0 |
| 120 | + anthropic.claude-3-5-sonnet-20241022-v2:0 |
| 121 | + us.anthropic.claude-3-7-sonnet-20250219-v1:0 |
| 122 | + anthropic.claude-3-5-haiku-20241022-v1:0 |
| 123 | + ai21.j2-ultra-v1 |
| 124 | + us.deepseek.r1-v1:0 |
| 125 | + amazon.titan-text-express-v1 |
| 126 | + mistral.mixtral-8x7b-instruct-v0:1 |
| 127 | + mistral.mistral-7b-instruct-v0:2 |
| 128 | + mistral.mistral-large-2402-v1:0 |
| 129 | + mistral.mistral-large-2407-v1:0 |
| 130 | + us.amazon.nova-micro-v1:0 |
| 131 | + us.amazon.nova-lite-v1:0 |
| 132 | + us.amazon.nova-pro-v1:0 |
| 133 | +``` |
| 134 | + |
| 135 | +## How do I use Bedrust? |
| 136 | + |
| 137 | +Just run `bedrust` to invoke the CLI with the default model. |
| 138 | + |
| 139 | +```console |
| 140 | +bedrust |
| 141 | +``` |
| 142 | + |
| 143 | +You will see the prompt and can start asking questions like `how do I install the aws cli?` to see how it works. |
| 144 | + |
| 145 | +```output |
| 146 | +bedrust |
| 147 | +██████╗ ███████╗██████╗ ██████╗ ██╗ ██╗███████╗████████╗ |
| 148 | +██╔══██╗██╔════╝██╔══██╗██╔══██╗██║ ██║██╔════╝╚══██╔══╝ |
| 149 | +██████╔╝█████╗ ██║ ██║██████╔╝██║ ██║███████╗ ██║ |
| 150 | +██╔══██╗██╔══╝ ██║ ██║██╔══██╗██║ ██║╚════██║ ██║ |
| 151 | +██████╔╝███████╗██████╔╝██║ ██║╚██████╔╝███████║ ██║ |
| 152 | +╚═════╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ |
| 153 | +
|
| 154 | +
|
| 155 | +---------------------------------------- |
| 156 | +Currently supported chat commands: |
| 157 | +/c - Clear current chat history |
| 158 | +/s - (BETA) Save chat history |
| 159 | +/r - (BETA) Recall and load a chat history |
| 160 | +/h - (BETA) Export history as HTML(saves in current dir) |
| 161 | +/q - Quit |
| 162 | +---------------------------------------- |
| 163 | +
|
| 164 | +---------------------------------------- |
| 165 | +🤖 | What would you like to know today? |
| 166 | +😎 | Human: |
| 167 | +``` |
| 168 | + |
| 169 | +## How do I change foundation models? |
| 170 | + |
| 171 | +You can use `-m` to change the model: |
| 172 | + |
| 173 | +```console |
| 174 | +bedrust -m nova-micro |
| 175 | +``` |
| 176 | + |
| 177 | +Your queries are now sent to the Amazon Nova Micro model. |
| 178 | + |
| 179 | +## How do I know which models I can use? |
| 180 | + |
| 181 | +Use `--help` to see your models. |
| 182 | + |
| 183 | +```console |
| 184 | +bedrust --help |
| 185 | +``` |
| 186 | + |
| 187 | +The models are printed in the output: |
| 188 | + |
| 189 | +```output |
| 190 | +A command line tool to invoke and work with Large Language models on AWS, using Amazon Bedrock |
| 191 | +
|
| 192 | +Usage: bedrust [OPTIONS] |
| 193 | +
|
| 194 | +Options: |
| 195 | + --init |
| 196 | + -m, --model-id <MODEL_ID> [possible values: llama270b, llama31405b-instruct, llama3170b-instruct, llama318b-instruct, cohere-command, claude-v2, claude-v21, claude-v3-opus, claude-v3-sonnet, claude-v3-haiku, claude-v35-sonnet, claude-v352-sonnet, claude-v37-sonnet, claude-v35-haiku, jurrasic2-ultra, deep-seek-r1, titan-text-express-v1, mixtral8x7b-instruct, mistral7b-instruct, mistral-large, mistral-large2, nova-micro, nova-lite, nova-pro] |
| 197 | + -c, --caption <CAPTION> |
| 198 | + -s, --source <SOURCE> |
| 199 | + -x |
| 200 | + -h, --help Print help |
| 201 | + -V, --version Print version |
| 202 | +``` |
| 203 | + |
| 204 | +The output shows the model strings you can use. Make sure to enable the models you want to use in the Bedrock console. |
| 205 | + |
| 206 | +Bedrust is a quick way to explore many Bedrock models and easily compare them. |
| 207 | + |
| 208 | + |
| 209 | + |
0 commit comments