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

Bedrock mistral #268

Merged
merged 9 commits into from
Mar 29, 2024
Merged

Bedrock mistral #268

merged 9 commits into from
Mar 29, 2024

Conversation

aashsach
Copy link
Contributor

Title:

  • Support for Mistral models in bedorck

Description: (optional)

  • Adding support for completion mistral bedrock

Motivation: (optional)

  • Getting mistral response from Portkey via bedrock

Related Issues: (optional)

  • #issue-number

@VisargD
Copy link
Collaborator

VisargD commented Mar 29, 2024

Hey @aashsach - Thanks for the PR. We have released some changes today related to code formatting as well as some changes related to provider config structure. You will have to update your branch with those changes.

@VisargD
Copy link
Collaborator

VisargD commented Mar 29, 2024

Please let me know if you need any help with this.

@VisargD
Copy link
Collaborator

VisargD commented Mar 29, 2024

@aashsach - For all the current bedrock models, we support chat as well as complete requests by making transformations accordingly. In case of mistral, we can transform messages into prompt and allow chat completions calls as well. You can check out the examples in src/providers/bedrock/chatComplete.ts. It has transformers written for many bedrock models. Will it be possible for you to add this change as well?

@aashsach
Copy link
Contributor Author

aashsach commented Mar 29, 2024

@aashsach - For all the current bedrock models, we support chat as well as complete requests by making transformations accordingly. In case of mistral, we can transform messages into prompt and allow chat completions calls as well. You can check out the examples in src/providers/bedrock/chatComplete.ts. It has transformers written for many bedrock models. Will it be possible for you to add this change as well?

@VisargD mistral models are only text models, do not support chat modality as per
https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html

confirmed from their playground, chat playground doesn't support mistral

@VisargD
Copy link
Collaborator

VisargD commented Mar 29, 2024

Correct. They are text models. But gateway internally makes transformations to convert chat completions input to text completions input. This is done to just make gateway more flexible in terms of request signature. You can check the BedrockAI21ChatCompleteConfig for an example

@aashsach
Copy link
Contributor Author

Correct. They are text models. But gateway internally makes transformations to convert chat completions input to text completions input. This is done to just make gateway more flexible in terms of request signature. You can check the BedrockAI21ChatCompleteConfig for an example

done

@VisargD VisargD linked an issue Mar 29, 2024 that may be closed by this pull request
@VisargD
Copy link
Collaborator

VisargD commented Mar 29, 2024

Apart from the one open comment related to complete non-stream token count, everything else looks good. I will run final tests and merge the PR once the comment is resolved.

@VisargD
Copy link
Collaborator

VisargD commented Mar 29, 2024

LGTM

@VisargD VisargD merged commit a37b8bd into Portkey-AI:main Mar 29, 2024
1 check passed
@aashsach aashsach deleted the bedrock-mistral branch March 29, 2024 16:39
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.

Feat: Support Bedrock mistral models
2 participants