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

Documentation for locally running #34

Open
aaronbolton opened this issue Aug 2, 2024 · 7 comments
Open

Documentation for locally running #34

aaronbolton opened this issue Aug 2, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@aaronbolton
Copy link

I would like to locally host the docker container and pass the relevant environment variables, is this possible and do you have a list of the variables names which would be needed to allow access to AWS and any other mandatory config?

@aaronbolton aaronbolton added the enhancement New feature or request label Aug 2, 2024
@lucasopedroso
Copy link

I tried to run it locally too, but without success.

@oscarfrank
Copy link

@aaronbolton @lucasopedroso

You can successfully run the Bedrock Access Gateway by setting the necessary AWS and environment variables when launching the Docker container. Here's how I got it to work:
First off, note that the application uses the boto3 library (AWS SDK for Python). Boto3 employs a credential discovery mechanism, searching for credentials in the following order:
a) Environment variables: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
b) Shared credential file (/.aws/credentials)
c) AWS config file (
/.aws/config)

Running the Docker Container:
To ensure proper credential access, launch the Docker container with the required environment variables as shown:

docker run -d --name bedrock_proxy \
  -e AWS_ACCESS_KEY_ID=your_access_key \
  -e AWS_SECRET_ACCESS_KEY=your_secret \
  -e AWS_REGION=aws_region \
  -p 8081:80 \
  bedrock-proxy

Remember to change your environmental variable accordingly, port and all.

Integration with Open-WebUI:
When configuring the model in Open-WebUI or similar interfaces, use the following endpoint: http://YOUR_IP:8081/api/v1

Replace 'YOUR_IP' with the appropriate IP address or hostname of your server.

Authentication:
Use 'bedrock' as the password when prompted for authentication.

I hope this helps.

@aaronbolton
Copy link
Author

perfect thankyou

@oscarfrank
Copy link

You're welcome. Remember to add the --restart flag to keep the docker container persistent when the server is rebooted.
For example, docker run -d --restart always --name bedrock and so on.

@aaronbolton
Copy link
Author

Thank you for the help, I've put it in a compose file next to my OpenWebUI container so I don't need to expose the port externally as well

@laurentiu-danielg
Copy link

Trying to run this locally.

Cloned the repo and build the _ecs Dockerfile.

Tryed to docker run it with the above parameters:

docker run -d --name bedrock_proxy \
  -e AWS_ACCESS_KEY_ID=your_access_key \
  -e AWS_SECRET_ACCESS_KEY=your_secret \
  -e AWS_REGION=aws_region \
  -p 8081:80 \
  bedrock-proxy

but for some reason when trying to curl I get:

curl http://localhost:8000/api/v1 curl: (56) Recv failure: Connection reset by peer

Logs are not very helpful:

INFO] (rapid) exec '/var/runtime/bootstrap' (cwd=/var/task, handler=)

@aaronbolton
Copy link
Author

Your mapping port 8081 to 80 and then curling port 8000 you will need to curl 8081

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

No branches or pull requests

4 participants