aws-samples / aws-samples/amazon-nova-samples
[Sample Request] Add Prompt Caching Example with Nova Pro
- Dominant language
- Jupyter Notebook
- Stars
- 452
- Forks
- 266
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to propose and implement a new sample demonstrating prompt caching with the Nova Pro model in AWS Bedrock. This sample will help developers optimize their API calls and manage costs effectively when working with Nova Pro.
### Sample Description
The proposed sample will showcase:
- Explanation of prompt caching and list common use cases
- Prompt caching implementation for Nova Pro
- Cache hit/miss handling
- Latency & cost analysis with and without prompt caching
### Value Proposition
This sample will benefit developers by:
- Demonstrating best practices for deployments with Nova Pro
- Illustrating cost optimization techniques for AWS Bedrock usage
- Providing a reusable pattern for implementing prompt caching
### Implementation Details
I plan to create a Jupyter notebook named `04_nova_pro_prompt_caching.ipynb` (or the next appropriate number in the sequence) that will include:
1. Setup and configuration for AWS Bedrock
2. Implementation of a simple caching mechanism with converse api
3. Examples of cached and non-cached API calls
4. Performance and cost comparisons
5. Best practices and considerations for production use
### Questions
1. Are there any API (invoke, invoke_with_stream, converse..) preferred for this repository?
2. Should the sample include multiple caching strategies (e.g., system prompt, message prompt, tools)?
### Next Steps
I'm willing to implement this sample myself. If this proposal is approved, I'll proceed with creating a pull request with the new notebook.
Let me know if you need any additional information or if you have any suggestions for improving this sample. I'm open to feedback and eager to contribute to this repository.
Contributor guide
Assessment
This issue has not been assessed yet.