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

Add MistralAILLM #293

Merged
merged 12 commits into from
Feb 2, 2024
Merged

Add MistralAILLM #293

merged 12 commits into from
Feb 2, 2024

Conversation

plaguss
Copy link
Contributor

@plaguss plaguss commented Jan 24, 2024

Description

This PR integrates Mistral AI API as a new LLM.

The new MistralAILLM is a wrapper over their python client.

Closes #153

@plaguss plaguss added the team: ml A tag for the ML team. label Jan 24, 2024
@plaguss plaguss added this to the 0.5.0 milestone Jan 24, 2024
@plaguss
Copy link
Contributor Author

plaguss commented Jan 24, 2024

Docs are work in progress

pyproject.toml Outdated Show resolved Hide resolved
src/distilabel/llm/mistralai.py Outdated Show resolved Hide resolved
src/distilabel/llm/mistralai.py Outdated Show resolved Hide resolved
src/distilabel/llm/mistralai.py Show resolved Hide resolved
src/distilabel/llm/mistralai.py Show resolved Hide resolved
src/distilabel/llm/mistralai.py Show resolved Hide resolved
output = []
for response in responses:
chat_completion = response.choices[0]
try:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this might be missing in some other implementations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will take a look, but maybe this is a special behaviour of this API, it doesn't deal with num_generations in the same way as OpenAI does, so it's easier to grab that choice

src/distilabel/utils/imports.py Outdated Show resolved Hide resolved
tests/llm/test_mistralai.py Outdated Show resolved Hide resolved
@davidberenstein1957 davidberenstein1957 changed the title Add MistralAI API feat: add MistralAI API Jan 24, 2024
@plaguss
Copy link
Contributor Author

plaguss commented Jan 24, 2024

There's a version conflict with httpx between argilla and mistralai but works fine when testing that locally. Not sure of the best way to solve this

@plaguss
Copy link
Contributor Author

plaguss commented Jan 24, 2024

Related to argilla-io/argilla#4531

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated
@@ -42,6 +42,7 @@ vertexai = ["google-cloud-aiplatform >= 1.38.0"]
together = ["together"]
argilla = ["argilla >= 1.22.0", "sentence-transformers >= 2.0.0", "textdescriptives >= 2.0.0"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we pin Argilla to a higher version here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a higher version than argilla>=1.22 right now?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I mean when we merge the httpx bumped version

@plaguss
Copy link
Contributor Author

plaguss commented Jan 26, 2024

This should be ready once we have argilla-io/argilla#4531 merged

@alvarobartt alvarobartt modified the milestones: 0.6.0, 0.5.0 Feb 2, 2024
@alvarobartt alvarobartt changed the title feat: add MistralAI API Add MistralAILLM Feb 2, 2024
@plaguss plaguss merged commit b7fcfb6 into main Feb 2, 2024
4 checks passed
@plaguss plaguss deleted the feat/mistral-api branch February 2, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: ml A tag for the ML team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] add Mistral LLM (using their API)
3 participants