GithubHelp home page GithubHelp logo

aws-samples / amazon-bedrock-client-for-mac Goto Github PK

View Code? Open in Web Editor NEW
113.0 6.0 16.0 12.83 MB

The Amazon Bedrock Client for Mac is a Bedrock macOS client built with SwiftUI.

License: MIT No Attribution

Swift 100.00%

amazon-bedrock-client-for-mac's Introduction

Amazon Bedrock Client for Mac

Latest Release Build License: MIT-0 Platform Built with Swift

Overview

The Amazon Bedrock Client for Mac is a macOS demo application built with SwiftUI. It serves as a client interface for AWS Bedrock, allowing users to interact with AWS Bedrock models.

preview

Note Please see the AWS Bedrock Pricing page for details and make sure to understand the costs before using the application.

Main Features

Features Highlights
🌐 Seamless interaction with AWS Bedrock models
πŸ’Œ Real-time message sending and receiving
πŸ“· Support for generating images
πŸ“ Text generation and embedding within the application
πŸ”’ Data encryption for enhanced security at rest and in transit
πŸŒ“ Native support for Dark Mode to reduce eye strain
πŸš€ Fully made in Swift 5 for high performance and reliability

Download

To download the pre-compiled application, click on the following link:

Download Amazon Bedrock Client for Mac

Troubleshooting

1. Amazon Bedrock Client for Mac.app Can't Be Opened

You encounter a message stating "'Amazon Bedrock Client for Mac.app' can't be opened because Apple cannot check it for malicious software."

troubleshooting

Steps to Open the Application:

  1. Open Finder -> Navigate to "Amazon Bedrock Client for Mac.app"
  2. Right-click (or Control-click)
  3. Select Open
  4. Click Open in the dialog

2. Issues with AWS Tokens or "Amazon_Bedrock.BedrockError error 1."

You encounter error messages like "Token has expired" or "The security token included in the request is invalid."

Before proceeding with the following steps, ensure that your ~/.aws/credentials file is correctly configured. The file should include your AWS Access Key ID and Secret Access Key in the following format:

[default]
aws_access_key_id = YOUR_ACCESS_KEY_ID
aws_secret_access_key = YOUR_SECRET_ACCESS_KEY

Steps to Manually Update AWS Credentials from Environment Variables:

  1. Open your Terminal.

  2. Update AWS Credentials: Run the following commands to set your AWS credentials. Replace the environment variable placeholders with your actual credentials if you did not set .

    # change $AWS.. Environment Variable to your one
    aws configure set default.aws_access_key_id $AWS_ACCESS_KEY_ID
    aws configure set default.aws_secret_access_key $AWS_SECRET_ACCESS_KEY

    If you have aws_session_token:

    # change $AWS.. Environment Variable to your one
    aws configure set default.aws_access_key_id $AWS_ACCESS_KEY_ID
    aws configure set default.aws_secret_access_key $AWS_SECRET_ACCESS_KEY
    aws configure set default.aws_session_token $AWS_SESSION_TOKEN

3. Troubleshooting Model Access Issues

If you encounter model access issues, please follow the steps below:

Step 1: Navigate to Amazon Bedrock Console

Go to Amazon Bedrock console. Amazon Bedrock Console

Step 2: Manage Model Access

Click on the 'Manage Model Access' button. Manage Model Access

Step 3: Model Access

Click on the 'Model access' tab. Model Access Tab

Step 4: Edit Model Access

Edit the 'Model access' settings. Check the box next to 'Anthropic' and then click 'Save Changes'. Edit Model Access

Build Instructions

Prerequisites

  • macOS 12 or later
  • Xcode 13 or later
  • AWS Account

Steps

  1. Clone the repository

    git clone https://github.com/aws-samples/amazon-bedrock-client-for-mac.git
  2. Open the project in Xcode

    cd Amazon-Bedrock-Client-for-Mac
    open Amazon\ Bedrock\ Client\ for\ Mac.xcodeproj/
  3. Set up your AWS credentials and configure your AWS settings.

  4. Build and run the application on your Mac.

Usage

  1. Sidebar: Use the sidebar to navigate between your preferences and chats.
  2. Message Bar: Use the message bar at the bottom to send messages to AWS Bedrock.
  3. Alerts: The app provides alerts for various activities and errors, displayed in a pop-up window.

Security

This application was written for demonstration and educational purposes and not for production use. The Security Pillar of the AWS Well-Architected Framework can support you in further adopting the sample into a production deployment in addition to your own established processes.

Contributing

  1. Fork the project.
  2. Create your feature branch ( git checkout -b feature/YourFeature).
  3. Commit your changes ( git commit -am 'Add some feature').
  4. Push to the branch ( git push origin feature/YourFeature).
  5. Open a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

amazon-bedrock-client-for-mac's People

Contributors

amazon-auto avatar didhd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

amazon-bedrock-client-for-mac's Issues

Amazon_Bedrock.BedrockError error 1.

After launching the app or changing region I get the error prompt;

ERROR The operation couldn’t be completed. (Amazon_Bedrock.BedrockError error 1.)

Unable to access API -- AWSBedrockRuntime.AccessDeniedException

Hi, I can access the Bedrock chat in the AWS console, but cannot access Bedrock via this app. Is there something else that needs to be configured in order to get API access?

Error invoking the model: AccessDeniedException(properties: AWSBedrockRuntime.AccessDeniedException.Properties(message: Optional("Your account is not authorized to invoke this API operation.")), httpResponse: Status Code: http_status_403 x-amzn-ErrorType: AccessDeniedException:http://internal.amazon.com/coral/com.amazon.bedrock/, Content-Type: application/json, Content-Length: 74, x-amzn-RequestId: c9507833-2d9a-4f0f-b4c0-08ac3dd223f8, Date: Thu, 26 Oct 2023 20:39:03 GMT, Connection: keep-alive, message: Optional("Your account is not authorized to invoke this API operation."), requestID: nil)

truncated responses

truncated responses, only partial responses, sometimes half of the sentence.
Also, when asking for code examples, it just print the first sentence and the code is missing

Desktop (please complete the following information):

  • OS: [e.g. iOS] Sonoma
  • Version [e.g. 22] 14.3.1
  • Browser [e.g. chrome, safari] Bedrock for Mac

Paste image to the chat from the buffer

Is your feature request related to a problem? Please describe.
Allow pasting images from the buffer to the chat.

Describe the solution you'd like
When you have an image payload in your buffer, you can paste the image directly in the chat of the AWS Bedrock client.

Describe alternatives you've considered
Currently, you can do it manually by pressing the image icon on the chat text box:
image

PDF support

Is your feature request related to a problem? Please describe.
It would be great to support PDF uploading, so we can ask questions about the PDF. Thanks!

Describe the solution you'd like
Support PDF upload.

Describe alternatives you've considered
Copy PDF contents page by page to current client, but it is not convenient.

Additional context
I saw @NathanHazout requested at #19 (comment) as well. πŸ˜ƒ

Significant frontend app lag

Describe the bug
After a long conversation, the UI is extremely laggy, even for non-Bedrock activities. Just resizing the window or trying to enter text in the input field is very slow and delayed.

To Reproduce
Steps to reproduce the behavior:
Engage in a long conversation with a LLM in Bedrock, and observe as basic UI slows to a crawl.

Expected behavior
The length of a chat should not impact the responsiveness of the local client app.

Desktop (please complete the following information):

  • OS: Sonoma 14.4

Bedrock runtime update?

Was this updated for Bedrock runtime update? I get the following error on all models (I do have access):

Error invoking the model: ValidationException(properties: AWSBedrockRuntime.ValidationException.Properties(message: Optional("1 validation error detected: Value 'anthropic.claude-v2:0:100k' at 'modelId' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][-]?)+)")), httpResponse: Status Code: http_status_400 x-amzn-RequestId: a1d2c37b-e82f-438e-b0bd-06c4815cbb58, x-amzn-ErrorType: ValidationException:http://internal.amazon.com/coral/com.amazon.bedrock/, Content-Type: application/json, Date: Thu, 07 Dec 2023 10:44:00 GMT, Connection: keep-alive, Content-Length: 493, message: Optional("1 validation error detected: Value 'anthropic.claude-v2:0:100k' at 'modelId' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][-]?)+)"), requestID: nil)

Detected as Malware

Hi there,

Following the recent update, this app has been identified as malware and cannot be run unless you choose "Bypass malware protection." However, this creates a significant security hazard that I think few people will accept.

I have Sonoma 14.4.1 (23E224)

Do you have any intentions to fix this issue?

Prompt template library

Is your feature request related to a problem? Please describe.
I find myself very often reusing specific prompts to automate tasks during the day (e.g. summarize meeting notes).

Describe the solution you'd like
It would be great to have a very lightweight "library" within the app to store those prompts and have them all in the same place. With this in place, I can just quickly insert a prompt template for a specific task i want to automate and get going, without needing to rewrite the prompt or go to another note-taking app where i have saved prompt templates. It could just be a very simple store of txt documents, even without the need for formatting or markdown.

Describe alternatives you've considered
A separate note-taking app (like Obsidian) where I store prompt templates, which adds overhead to the workflow.

Error when launching the app

Describe the bug
Getting error when launching app

The operation couldn’t be completed. (AwsCommonRuntimeKit.CommonRunTimeError error 0.)

To Reproduce
Steps to reproduce the behavior:

  1. Error appears immediately after app starts

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Screenshot 2024-03-14 at 11 43 18

Desktop (please complete the following information):

  • OS: macOS 13.6.5

400 error when calling titan-image-generator-v1

When I'm authenticated to an account with access to all Bedrock models, when I send a text prompt to titan-image-generator-v1, I get an error:

Error invoking the model: ValidationException(properties: AWSBedrockRuntime.ValidationException.Properties(message: Optional("Malformed input request, please reformat your input and try again.")), httpResponse: Status Code: http_status_400 x-amzn-RequestId: de13b7f8-67fb-4ada-a3cf-9bd40805d05b, Content-Type: application/json, x-amzn-ErrorType: ValidationException:http://internal.amazon.com/coral/com.amazon.bedrock/, Content-Length: 80, Connection: keep-alive, Date: Thu, 07 Dec 2023 22:04:37 GMT, message: Optional("Malformed input request, please reformat your input and try again."), requestID: nil)

Making the same request using the Bedrock image playground works as expected.

Windows or web version

Is your feature request related to a problem? Please describe.
I know this one is for macOS, but our company has many users are using Windows.

Describe the solution you'd like
It would be great to have a client for Windows as well or a web version, which will help more company users to use Amazon Bedrock. Thanks! πŸ˜ƒ

Custom Endpoint Specification

Description

There has been a suggestion regarding the addition of a new feature to the Bedrock mac client that would allow users to specify a custom endpoint in the settings. This request arises from the new developer access privileges that come with higher throttling limits.

Feature Proposal

The ability to customize the endpoint could provide users with more flexibility and control, particularly beneficial for developers who may be working with different environments or require special configurations for their work.

Text input clears when switching between models

Here is a draft GitHub issue text:

Title: Text input clears when switching between models

Description

When using the Bedrock Mac client, I've noticed that any text I've typed into the input box gets cleared if I switch to another model and then switch back.

Steps to reproduce:

  1. Type some text into the input box
  2. Switch to another model
  3. Switch back to the original model

Expected: The text I typed originally should still be in the input box
Actual: The input box is cleared and I've lost the text

This makes it inconvenient if I want to try out a different model but then go back to continue my previous thought/input. The text getting cleared out forces me to retype things.

Proposed Fix

I think the input text state should be preserved when switching between models. Rather than clearing everything out, it would be better if the text was remembered so users don't lose their input.

Some ways this could be implemented:

  • Store the input text in a variable that persists even when the model is changed, hence keeping the state between different models
  • Preserve the input only for a given model, hence when changing between models the text changes and matched the one that was kept for that one
  • Have a confirmation popup when changing models that asks if the user wants to clear the input

Let me know if any other details would be helpful! Losing input text is disruptive to my workflow so I'd appreciate if this could be improved. Will try to contribute as well if timing works.

#1 Amazon Bedrock Client for Mac.app Can't Be Opened

Describe the bug
After using Bedrock for several days, I rebooted the system and decided to start the app.
I got the error message: Amazon Bedrock Client for Mac.app Can't Be Opened

and Amazon bedrock left unexpectedly

Capture d’écran 2024-04-17 aΜ€ 09 13 14

To Reproduce
Steps to reproduce the behavior:

  1. Go to Finder, Application Bedrock
  2. Right click on Bedrock app, open
  3. See error

Expected behavior
Open the app

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] iOS 14.3.1

Copy pasting of output not possible

Describe the bug
Generate some long text e.g. with multiple xml tags.
Copy paste of complete output not possible.

Screenshot 2024-03-26 at 13 11 54

Try to copy paste the full generated output. Only single paragraphs can be selected.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Chat gets stuck due to system errors

Describe the bug
When the system encounters errors such as ThrottlingException or ValidationException, the chat can get stuck indefinitely, preventing the user from continuing the conversation. This occurs because the system does not handle these errors gracefully and does not provide a way for the user to resume the chat once the underlying issue is resolved.

To Reproduce

  1. Send multiple requests to the system, triggering a ThrottlingException. Alternatively expire your default profile to cause an auth error.
  2. Attempt to send a request with multiple "user" roles in a single row, triggering a ValidationException.
  3. Observe that the chat becomes stuck and the user is unable to continue the conversation.

Expected behavior
When the system encounters errors, it should handle them gracefully and provide a way for the user to resume the chat once the underlying issue is resolved. This could involve concatenating the user's previous messages that resulted in errors and allowing the user to continue the conversation.

Additional context
Providing a way for the user to continue the chat after system errors would improve the user experience and prevent frustration when the chat gets stuck. Concatenating the previous messages that resulted in errors could help the user understand the context and pick up where they left off.

image

Allow multiple conversation threads per model

Description

The Bedrock Mac client currently maintains the conversation history within a session when switching between models. However, there is only one linear conversation thread per model.

It would be very useful to have the ability to maintain multiple simultaneous conversation threads for each model. This way, users could switch between different topic threads without losing context.

For example, I may want to discuss topic A with model X, then switch to discuss topic B, and then go back to pick up where I left off in topic A. Currently this is not easily possible.

Proposed Solution

  • Allow users to create separate conversation threads with bookmarks/titles
  • Persist threads for each model, even across app reloads
  • Enable quick switching between active threads for a model

This would enable much more flexibility in conversations and reduce context switching costs.

Additional Details

The immediate conversation history within a session is currently preserved nicely. The limitations are around:

  • Losing history on app restart
  • No support for multiple threaded discussions per model

Please let me know if any other details would help! I'm happy to collaborate on designing and implementing this feature.

Switching Models isn't taking effect.

Describe the bug
I tried to switch from default claude model to a different model to chat.

  • It continues using old model.
  • Sometimes application crashes

App crashes when closing settings popup

Description

When opening the settings popup in the Amazon Bedrock Mac Client app and clicking the close button, the entire app crashes.

Steps to reproduce

  1. Open the Amazon Bedrock Mac Client app
  2. Open the settings popup with command + ,
  3. Click the close button on the settings popup
  4. The entire app crashes

Expected behavior

Closing the settings popup should close the popup without crashing the app.

Actual behavior

Clicking the close button on the settings popup crashes the entire app.

Environment

  • Mac OS version: 13.5.2

Ability to set regions outside of US

Hey,

It does not seem to be possible to choose regions outside of the US and AP. I would specifically need access to the eu-central-1 region via the UI. Could this be added?

Thanks!

Should not be allowed to change model mid-conversation

I started a conversation with Claude, then at the top dropdown changed it to Titan Image Generator.
I didn't actually change the endpoint, but it changed it in the top bar.

I think that to avoid confusion, once a session is started the top bar should become read-only.

Screenshot 2024-02-26 at 15 56 46

Also, it seems that toggling between conversations does not update the top bar, the model name does not reflect the actual model selected for this conversation.

v1.1.7 build is broken

Describe the bug
The latest v1.1.7 build is currently broken:

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://github.com/aws-samples/amazon-bedrock-client-for-mac/releases/tag/v1.1.7
  2. Download DMG file
  3. Try to open Amazon Bedrock executable
  4. See error

Expected behavior
The Amazon Bedrock application opens successfully.

Screenshots
image

Desktop (please complete the following information):

  • OS: 14.3.1 (23D60)
  • Version v1.1.7

Additional context
The executable also triggers malware protection message:
image

Can be skipped by checking "Override Malware Protection" checkbox in "Get Info" page:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.