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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mistral AI as a new provider in LLM Deployment #11020

Merged
merged 6 commits into from Feb 13, 2024

Conversation

thnguyendn
Copy link
Contributor

@thnguyendn thnguyendn commented Feb 5, 2024

馃洜 DevTools 馃洜

Open in GitHub Codespaces

Install mlflow from this PR

pip install git+https://github.com/mlflow/mlflow.git@refs/pull/11020/merge

Checkout with GitHub CLI

gh pr checkout 11020

Related Issues/PRs

Resolve #10948

What changes are proposed in this pull request?

Though MLFlow has already proposed Mistral AI as part of Hugging Face TGI, this PR is created to fill the need of having Mistral AI as a new LLM Provider, that could be easier to manage by the centralized endpoint of MLFlow LLM Deployment.

In terms of functionality, the new provider provides an endpoint for completion and another one for embedding, those which correspond to the Mistral AI completion (https://docs.mistral.ai/api/#operation/createChatCompletion) and embedding APIs (https://docs.mistral.ai/api/#operation/createEmbedding).

Technically, the changes in this Pull Request can be found in the following places:

  • Creation of the MistralConfig in the config.py file
  • Creation of the MistralProvider and MistralAdapter to adapt the request and the corresponding response from the Mistral APIs (mistral.py)
  • Creation of a unit test to test MistralProvider (test_mistral.py)

How is this PR tested?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests

Does this PR require documentation update?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/deployments: MLflow Deployments client APIs, server, and third-party Deployments integrations
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/recipes: Recipes, Recipe APIs, Recipe configs, Recipe Templates
  • area/projects: MLproject format, project running backends
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/server-infra: MLflow Tracking server backend
  • area/tracking: Tracking Service, tracking client APIs, autologging

Interface

  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

Language

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

Integrations

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Signed-off-by: Ngo Minh Thang Nguyen <thangnguyen.dn.1991@gmail.com>
Copy link

github-actions bot commented Feb 5, 2024

Documentation preview for 73a6980 will be available when this CircleCI job completes successfully.

More info

@github-actions github-actions bot added area/deployments MLflow Deployments client APIs, server, and third-party Deployments integrations integrations/databricks Databricks integrations rn/documentation Mention under Documentation Changes in Changelogs. labels Feb 5, 2024
@BenWilson2
Copy link
Member

Hi @thnguyendn great stuff! Could you add an entry in the integration suite for this provider? https://github.com/mlflow/mlflow/blob/master/tests/gateway/test_integration.py

Signed-off-by: Ngo Minh Thang Nguyen <thangnguyen.dn.1991@gmail.com>
@thnguyendn
Copy link
Contributor Author

thnguyendn commented Feb 6, 2024

Hi @thnguyendn great stuff! Could you add an entry in the integration suite for this provider? https://github.com/mlflow/mlflow/blob/master/tests/gateway/test_integration.py

Hi, @BenWilson2 , a new commit has been added to add entry in integration suite for the provider

Signed-off-by: Ngo Minh Thang Nguyen <thangnguyen.dn.1991@gmail.com>
@thnguyendn
Copy link
Contributor Author

Hi @BenWilson2 , could you please review the PR?

Copy link
Member

@BenWilson2 BenWilson2 left a comment

Choose a reason for hiding this comment

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

Looks good to me with the added test! Thanks for the contribution :)
Are you planning on a follow-up to add the examples and the docs updates?

Signed-off-by: Ngo Minh Thang Nguyen <thangnguyen.dn.1991@gmail.com>
@thnguyendn
Copy link
Contributor Author

Hi @BenWilson2 , I've just updated docs and add examples for the provider.

Can you check it @BenWilson2 ?

Are you planning to add the PR in your next patch version 2.10.2 ?

Signed-off-by: Ben Wilson <39283302+BenWilson2@users.noreply.github.com>
@BenWilson2
Copy link
Member

Hi @BenWilson2 , I've just updated docs and add examples for the provider.

Can you check it @BenWilson2 ?

Are you planning to add the PR in your next patch version 2.10.2 ?

We don't include features with patch releases. This will be included in the 2.11 release of MLflow. Thanks again for the contribution! I'll merge it once CI finishes :)

Signed-off-by: Ben Wilson <39283302+BenWilson2@users.noreply.github.com>
@BenWilson2 BenWilson2 merged commit be14e34 into mlflow:master Feb 13, 2024
36 checks passed
sateeshmannar pushed a commit to StateFarmIns/mlflow that referenced this pull request Feb 20, 2024
Signed-off-by: Ngo Minh Thang Nguyen <thangnguyen.dn.1991@gmail.com>
Signed-off-by: Ben Wilson <39283302+BenWilson2@users.noreply.github.com>
Co-authored-by: Ngo Minh Thang Nguyen <thangnguyen.dn.1991@gmail.com>
Co-authored-by: Ben Wilson <39283302+BenWilson2@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/deployments MLflow Deployments client APIs, server, and third-party Deployments integrations integrations/databricks Databricks integrations rn/documentation Mention under Documentation Changes in Changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Add Mistral AI as a new LLM provider
2 participants