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

Uploaded Source

File details

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

File metadata

  • Download URL: bpo-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 96f746b335460dc50552e78ff4f00d9b9b42c4c7664161d8828daceaf8c65aed
MD5 ea20e1bbbad3e41936ffc4eb38234744
BLAKE2b-256 4da1a240773d30c19a97c99f0bddfc3d4bc892c142ed4dcf0626a7cfc1e4dd84

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