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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cardofe
Copy link

@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.

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