Skip to content

feat: add support to include application inference profiles as models #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 23, 2025

Conversation

theTechie
Copy link
Contributor

@theTechie theTechie commented Apr 3, 2025

New feature support: Add support for listing application defined inference profiles as models

Description of changes:
As AWS uses system defined inference profiles for cross region inference models/profiles, we can also define custom application defined inference profiles based on foundation models.

This gives flexibility to define profiles for different purposes for segregation and cost tracking purposes. I am using it in a project for cost tracking purposes using AWS tags attached to application inference profiles.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@theTechie theTechie changed the title add support to include application inference profiles as models feat: add support to include application inference profiles as models Apr 7, 2025
@theTechie
Copy link
Contributor Author

@daixba can you review this please?

zxkane added 5 commits June 23, 2025 12:01
- Remove complex is_matching_application_profile function
- Implement O(1) lookup using dictionary mapping instead of O(n×m) iteration
- Add comprehensive error handling and input validation
- Add detailed logging for debugging and monitoring
- Improve robustness with defensive programming patterns
- Handle edge cases like missing ARNs, empty models, invalid data structures
- More efficient model ID extraction from ARNs
- Better separation of concerns between system and application profiles
- Remove excessive code formatting changes to improve review readability
- Keep only essential functional improvements for application inference profiles
- Maintain original code style from main branch
- Preserve O(1) lookup optimization with dictionary mapping
- Add basic error handling without verbose logging
- Focus on core functionality: ENABLE_APPLICATION_INFERENCE_PROFILES support
…templates

- Add arn:aws:bedrock:*:*:application-inference-profile/* to IAM policy resources
- Required for invoking application-defined inference profiles
- Update both Lambda (BedrockProxy.template) and Fargate (BedrockProxyFargate.template) templates
- Ensures complete support for Application Inference Profiles feature in PR aws-samples#131
- Add Application Inference Profiles to features list
- Include dedicated section with usage examples for both API and SDK
- Provide sample code for using application inference profile ARNs
- Document benefits: cost tracking, usage monitoring, tag-based cost allocation
- Reference official AWS documentation for profile creation and management
@zxkane zxkane merged commit 0183608 into aws-samples:main Jun 23, 2025
@zxkane
Copy link
Member

zxkane commented Jun 23, 2025

@theTechie Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants