Skip to main content

CLI to optimize prompts with AWS Bedrock

Project description

Bedrock Prompt Optimizer (bpo)

demo

A CLI wrapper around the Amazon Bedrock Agents Runtime optimize_prompt method, which optimizes prompts for the given model. Checkout available models here.

Installation

To install the Bedrock Prompt Optimizer cli, run:

pip install bpo

Usage

The Bedrock Prompt Optimizer is a CLI. Here's how to use it:

bpo optimize --prompt INPUT_FILE --output OUTPUT_FILE --model-id MODEL_ID --region AWS_REGION

Arguments

  • --prompt: Path to the input prompt file (required)
  • --output: Path to the output file where the optimized prompt will be saved (default: optimized_prompt.txt)
  • --model-id: Bedrock model ID (default: will prompt to select from a list of models)
  • --region: AWS region (default: us-east-1)

Example

bpo optimize --prompt input.txt --model-id amazon.nova-pro-v1:0 --region us-east-1

This command will:

  1. Read the prompt from input.txt
  2. Optimize it
  3. Save the optimized prompt to optimized_prompt.txt

Notes

  • Ensure you have the necessary AWS credentials configured to access the Bedrock service.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bpo-0.3.0.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file bpo-0.3.0.tar.gz.

File metadata

  • Download URL: bpo-0.3.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for bpo-0.3.0.tar.gz
Algorithm Hash digest
SHA256 69a3be329a77c8a9f28e7f579f5a723c4a90776760a4c9aaf9e5c6845ae0ee90
MD5 cb30efda984846189c16fb4b58fc3bde
BLAKE2b-256 2b5072af342b9c2d70aa680c0899fa606125715272847f4fd9d5e30c59ce740d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page