-
Notifications
You must be signed in to change notification settings - Fork 609
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
added support for bedrock/claude3 #781
Changes from 6 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,8 @@ def __init__(self): | |
assert litellm_token, "LITELLM_TOKEN is required" | ||
os.environ["LITELLM_TOKEN"] = litellm_token | ||
litellm.use_client = True | ||
if get_settings().get("LITELLM.DROP_PARAMS", None): | ||
litellm.drop_params = get_settings().litellm.drop_params | ||
if get_settings().get("OPENAI.ORG", None): | ||
litellm.organization = get_settings().openai.org | ||
if get_settings().get("OPENAI.API_TYPE", None): | ||
|
@@ -68,6 +70,7 @@ def __init__(self): | |
) | ||
if get_settings().get("AWS.BEDROCK_REGION", None): | ||
litellm.AmazonAnthropicConfig.max_tokens_to_sample = 2000 | ||
litellm.AmazonAnthropicClaude3Config.max_tokens = 2000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In litellm, a separate Config class is created for AmazonAnthropicClaude3 Similar to the following pull request, the value of max_tokens is hardcoded. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discussion: |
||
self.aws_bedrock_client = boto3.client( | ||
service_name="bedrock-runtime", | ||
region_name=get_settings().aws.bedrock_region, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AmazonAnthropicClaude3Config
does not supporttemperature
parameterhttps://github.com/BerriAI/litellm/blob/1b93ada827c652eed5f4d8ac05b222b10222b80d/litellm/llms/bedrock.py#L79-L87
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion:
Another approach could be to set the temperature only if the model is bedrock's claude3 within the chat_completion function.