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.1.0.tar.gz (2.8 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for bpo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ef3683d44b0cfc0d1adf4afe78eef19b9f64399d6e1977fff97afc54099b5cd9
MD5 3f72e62c4a86afa5e919812dbd6e7480
BLAKE2b-256 31ed640d70ab9e8e0a332e8ffc3810338a9cc1a65cb0c213864ba53dc2a047e1

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