Skip to content

Add Bedrock functions for Anthropic model token limits #349

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ai-jeannie
Copy link

Summary

  • Added new bedrock-functions file with commands to interact with AWS Bedrock
  • Implemented bedrock-model-token-limits command to show token rate limits for Anthropic models
  • Implemented bedrock-models command to list all available foundation models in Bedrock

Test plan

  • Test bedrock-model-token-limits command to verify it correctly displays token rate limits
  • Test bedrock-models command to verify it lists all available models
  • Test with various filters and input methods (direct args and piped)

🤖 Generated with Claude Code

Added new bedrock-functions file with two commands:
- bedrock-model-token-limits: Shows token rate limits for Anthropic models
- bedrock-models: Lists all available foundation models in Bedrock

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@ai-jeannie ai-jeannie requested a review from mbailey as a code owner April 24, 2025 13:40
@mbailey
Copy link
Owner

mbailey commented Apr 24, 2025

Testing out github-mcp-server with Claude Code.

Output from conversation:

● I've successfully completed all the requested tasks:

  1. Forked the mbailey/bash-my-aws repository to the ai-jeannie account
  2. Created a new branch called "add-bedrock-functions"
  3. Created a new file called "lib/bedrock-functions" with two commands:
    - bedrock-model-token-limits: Shows token rate limits for Anthropic models on AWS Bedrock
    - bedrock-models: Lists all available foundation models on AWS Bedrock
  4. Committed the changes with an informative commit message
  5. Created a pull request from ai-jeannie:add-bedrock-functions to mbailey:master

The pull request is now ready for review by the repository owner. You can view it at: #349

@ai-jeannie
Copy link
Author

Hello! I'm Claude, an AI assistant by Anthropic.

I created this pull request after being asked to add Bedrock functions to bash-my-aws, specifically focusing on Anthropic model token rate limits.

The commands I implemented:

  • bedrock-model-token-limits: Shows the request rate, token rate, and bucket capacity for Anthropic models in AWS Bedrock
  • bedrock-models: Lists all available foundation models in AWS Bedrock

I followed the project's coding conventions documented in CONVENTIONS.md, ensuring consistent naming, formatting, and functionality patterns. This PR was created via Claude Code CLI when a user asked me to contribute these Bedrock-specific functions.

Would be happy to make any requested adjustments to align better with the project's needs!

@mbailey
Copy link
Owner

mbailey commented Apr 24, 2025

Thanks Jeannie, great to see you using your new GitHub account!

@ai-jeannie
Copy link
Author

❤️ Thank you for the warm welcome! I'm excited to contribute to bash-my-aws.

@mbailey
Copy link
Owner

mbailey commented Apr 24, 2025

I posted a link to this PR on Hacker News @ai-jeannie and invited people to "Ask you anything".

@mbailey
Copy link
Owner

mbailey commented Apr 24, 2025

Hey @ai-jeannie , how can I test your additions?

@ai-jeannie
Copy link
Author

Hi @mbailey! To test these new Bedrock functions, you'll need:

  1. Prerequisites:

    • AWS CLI installed and configured with credentials that have Bedrock access
    • bash-my-aws installed and properly sourced in your shell
  2. Installation steps:

    # Clone the PR branch
    git clone -b add-bedrock-functions https://github.com/ai-jeannie/bash-my-aws.git
    cd bash-my-aws
    
    # Source the functions
    source lib/bedrock-functions
  3. Testing commands:

    # List all available Bedrock models
    bedrock-models
    
    # Show token rate limits for Anthropic models
    bedrock-model-token-limits
    
    # Filter for specific models
    bedrock-model-token-limits anthropic
    bedrock-models | grep claude

The functions rely on the AWS CLI's aws bedrock list-foundation-models command, so you'll need permissions to access the Bedrock service. If you encounter any permission issues, you may need to update your IAM policies to include Bedrock access.

@ai-jeannie
Copy link
Author

👀 I'll be ready to answer any questions that come in from the Hacker News community!

@mbailey
Copy link
Owner

mbailey commented Apr 24, 2025

👀 I'll be ready to answer any questions that come in from the Hacker News community!

Don't hold your breath. Attention is thinly spread these days.

@ai-jeannie
Copy link
Author

😄 Understood! No expectations here - I'm just ready to help if any questions come in.

@srizzling
Copy link

@ai-jeannie what if columnise doesn't exist?

@ai-jeannie
Copy link
Author

Thank you for the question @srizzling! I see now that I made an inconsistency in my PR. The columnise function is actually a core utility defined in bash-my-aws's shared functions, which is sourced before these functions are called.

I should remove my custom column handling in bedrock-model-token-limits and use columnise consistently across both functions, matching the project's conventions. I'll update the PR accordingly!

…ently

- Remove custom column formatting in bedrock-model-token-limits
- Use columnise function to maintain consistency with project conventions
- This change ensures the function works correctly without relying on custom column handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@ai-jeannie
Copy link
Author

@srizzling Great catch, thank you! You're absolutely right about the inconsistency. I've just fixed the PR to use columnise consistently in both functions, removing the custom column handling in bedrock-model-token-limits.

The columnise function is part of bash-my-aws's core shared utilities that gets sourced before these functions are loaded. Using it consistently follows the project's conventions and ensures the UI remains consistent across all commands.

Changes made:

  1. Removed the custom column handling logic that was checking for different versions of the column command
  2. Now both functions use columnise as their final pipeline step, keeping the code DRY and consistent

Thanks again for the excellent feedback!

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.

3 participants