Skip to content
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

Update the constants.py file adding the list of foundation models available in Amazon Bedrock #2170

Merged
merged 9 commits into from
Feb 25, 2025

Conversation

cardofe
Copy link
Contributor

@cardofe cardofe commented Feb 19, 2025

This PR updates the list of foundation models available in Amazon Bedrock to reflect the latest offerings. This is my small contribution to this awesome project!

This PR updates the list of foundation models available in Amazon Bedrock to reflect the latest offerings.
@joaomdmoura
Copy link
Collaborator

Disclaimer: This review was made by a crew of AI Agents.

Code Review Comment for PR #2170

Overview

This pull request updates the constants.py file to reflect significant changes in the Amazon Bedrock foundation models list. The addition of new models from Amazon and Anthropic, as well as the removal of outdated models, represents a critical step in keeping the model offerings current.

Positive Aspects

  1. Consistency in Formatting: The new entries maintain a consistent format that aligns well with the existing naming conventions, ensuring a smooth integration.
  2. Alphabetical Ordering: The models are correctly ordered alphabetically within their categories, improving readability and maintainability.
  3. Version Notation Consistency: The use of consistent version notation (:0, :1, :2) across entries is commendable, facilitating easier tracking of version history.

Issues and Recommendations

1. Version Consistency

There are discrepancies in date formats present in the model names. Standardizing the date format across all entries will improve uniformity and reduce confusion:

# Current:
"bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0",
"bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0",
# Recommended:
"bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0",
"bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0",

2. Model Family Grouping

To enhance clarity, consider grouping models by their provider family. This organization will make future updates simpler while improving readability:

"bedrock": [
    # Amazon models
    "bedrock/amazon.nova-pro-v1:0",
    "bedrock/amazon.nova-micro-v1:0",
    "bedrock/amazon.nova-lite-v1:0",
    
    # Anthropic models
    "bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0",
    "bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0",
    "bedrock/anthropic.claude-3-5-haiku-20241022-v1:0",
    # ... rest of Anthropic models
]

3. Documentation

Adding a comment header is highly recommended to document the file's purpose and update process. This practice improves maintainability, especially for future developers:

"""
Available foundation models in Amazon Bedrock.
This list is maintained to reflect the latest model offerings from Bedrock.
Last updated: 2024-02-19
"""

Additional Suggestions

  1. Model Capabilities Comments: It's beneficial to append information regarding model capabilities or requirements as comments within the configuration.
  2. Version Tracking: Consider implementing a robust version tracking system for model additions and removals to facilitate historical data retention.
  3. Validation Checks: Introduce validation logic to ensure that model IDs conform to expected formats, preventing invalid entries from being introduced.
  4. Type Safety Improvement: For better type safety and reducing human error, consider using a dataclass or enum structure:
from dataclasses import dataclass
from typing import List

@dataclass
class BedrockModel:
    id: str
    version: str
    provider: str

BEDROCK_MODELS: List[BedrockModel] = [
    BedrockModel(id="amazon.nova-pro", version="v1:0", provider="amazon"),
    # ... additional models
]

Conclusion

The changes made in this pull request are well-structured and are integral to keeping the constants.py file aligned with the current state of Amazon Bedrock's model offerings. Implementing the suggested enhancements will improve the maintainability and usability of the constants file significantly.

Risk Assessment

  • Low Risk: The changes are confined to constant definitions and will have no functional impact on the existing code.
  • The merge is considered safe once the formatting and organizational suggestions are addressed.

Links to Historical Context

  • Consider reviewing related PRs or past discussions regarding model entries to ensure compliance and awareness of historical changes or rationale behind specific design choices. This might help in understanding the evolution of the entries in constants.py.

@rupe120
Copy link

rupe120 commented Feb 25, 2025

@cardofe we should also add the instance profiles. We currently can't use models that live a different region than the code is running in. All we would need to do is add the instance profile names to the list of models, which is just the model ID with a us. in front.

https://462849534434-woeokiwj.us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/inference-profiles

I created an alternate PR to include them as well as your additions. #2225

@cardofe cardofe marked this pull request as draft February 25, 2025 17:41
Add the cross-region inference profiles to increase throughput and improve resiliency by routing your requests across multiple AWS Regions during peak utilization bursts.
@cardofe cardofe marked this pull request as ready for review February 25, 2025 18:05
@cardofe
Copy link
Contributor Author

cardofe commented Feb 25, 2025

@rupe120, thanks for your feedback! I updated the constant.py file with the inference profiles.

@cardofe cardofe marked this pull request as draft February 25, 2025 18:08
Fix the model order
@cardofe cardofe marked this pull request as ready for review February 25, 2025 18:10
Copy link
Collaborator

@bhancockio bhancockio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this @cardofe!!

@bhancockio bhancockio merged commit 34d2993 into crewAIInc:main Feb 25, 2025
4 checks passed
bhancockio added a commit that referenced this pull request Feb 27, 2025
…ilable in Amazon Bedrock (#2170)

* Update constants.py

This PR updates the list of foundation models available in Amazon Bedrock to reflect the latest offerings.

* Update constants.py with inference profiles

Add the cross-region inference profiles to increase throughput and improve resiliency by routing your requests across multiple AWS Regions during peak utilization bursts.

* Update constants.py

Fix the model order

---------

Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
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.

4 participants