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

Amazon Bedrock support #228

Open
sandrich opened this issue Feb 3, 2025 · 0 comments
Open

Amazon Bedrock support #228

sandrich opened this issue Feb 3, 2025 · 0 comments

Comments

@sandrich
Copy link

sandrich commented Feb 3, 2025

It would be amazing to enable Amazon Bedrock support, rather than OpenAI. This would allow to access many other models including Anthropic Claude.

I tried to setup Bedrock Access Gateway which essentially is an OpenAI API proxy which translates into Bedrock API calls

https://github.com/aws-samples/bedrock-access-gateway

It requires the env variables OPENAI_BASE_URL and OPENAI_API_KEY

Example query using curl against the proxy

curl $OPENAI_BASE_URL/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "us.anthropic.claude-3-5-sonnet-20241022-v2:0",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'
{"id":"chatcmpl-fb7f646e","created":1738607696,"model":"us.anthropic.claude-3-5-sonnet-20241022-v2:0","system_fingerprint":"fp","choices":[{"index":0,"finish_reason":"stop","logprobs":null,"message":{"role":"assistant","content":"Hi! How can I help you today?"}}],"object":"chat.completion","usage":{"prompt_tokens":9,"completion_tokens":12,"total_tokens":21}}
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

No branches or pull requests

1 participant