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

feat(bedrock_httpx.py): Make Bedrock-Cohere calls Async + Command-R support #3586

Merged
merged 14 commits into from
May 12, 2024

Conversation

krrishdholakia
Copy link
Contributor

@krrishdholakia krrishdholakia commented May 11, 2024

Title

Make Bedrock calls Async (by moving to using httpx for bedrock calls), starting with 'cohere'. Will let this bake across next week, before rolling out to other providers (Anthropic, Amazon, Mistral, Stability) and endpoints (image gen, embeddings).

Note: No user-change required

import os
from litellm import completion

os.environ["AWS_ACCESS_KEY_ID"] = ""
os.environ["AWS_SECRET_ACCESS_KEY"] = ""
os.environ["AWS_REGION_NAME"] = ""

response = completion(
  model="bedrock/cohere.command-r-plus-v1:0",
  messages=[{ "content": "Hello, how are you?","role": "user"}]
)

Relevant issues

Closes #3368
Closes #3362

Also removes 'load_dotenv' in all places except __init__.py and proxy_cli.py

Type

🆕 New Feature
🧹 Refactoring
🚄 Infrastructure

Changes

  • new bedrock_httpx.py file
  • cleanup of load_dotenv

Testing

  • test_completion (sync + async)
  • test_streaming (sync + async)

OS Tests (optional but appreciated):

  • Tested on MacOS

Copy link

vercel bot commented May 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2024 4:25am

litellm/tests/test_completion.py Dismissed Show dismissed Hide dismissed
@krrishdholakia krrishdholakia changed the title feat(bedrock_httpx.py): moves to using httpx client for bedrock cohere calls feat(bedrock_httpx.py): Make Bedrock calls Async May 12, 2024
@krrishdholakia krrishdholakia changed the title feat(bedrock_httpx.py): Make Bedrock calls Async feat(bedrock_httpx.py): Make Bedrock-Cohere calls Async May 12, 2024
@krrishdholakia krrishdholakia merged commit 94c9df9 into main May 12, 2024
3 of 7 checks passed
@krrishdholakia krrishdholakia deleted the litellm_bedrock_command_r_support branch May 12, 2024 04:24
@krrishdholakia krrishdholakia changed the title feat(bedrock_httpx.py): Make Bedrock-Cohere calls Async feat(bedrock_httpx.py): Make Bedrock-Cohere calls Async + Command-R support May 12, 2024
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.

[Feature]: Move bedrock calls to being *native* async [Feature]: Command R & R+ on Amazon Bedrock
1 participant