Skip to content

Conversation

@matt-dz
Copy link
Contributor

@matt-dz matt-dz commented Jun 20, 2023

Description

We have added a new LLM integration azureml_endpoint that allows users to leverage models from the AzureML platform. Microsoft recently announced the release of Azure Foundation Models which users can find in the AzureML Model Catalog. The Model Catalog contains a variety of open source and Hugging Face models that users can deploy on AzureML. The azureml_endpoint allows LangChain users to use the deployed Azure Foundation Models.

Dependencies

No added dependencies were required for the change.

Tests

Integration tests were added in tests/integration_tests/llms/test_azureml_endpoint.py.

Notebook

A Jupyter notebook demonstrating how to use azureml_endpoint was added to docs/modules/llms/integrations/azureml_endpoint_example.ipynb.

Twitters

Prakhar Gupta
Matthew DeGuzman

Who can review?

Tag maintainers/contributors who might be interested:

@vercel
Copy link

vercel bot commented Jun 20, 2023

@matthewdeguzman is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Jun 21, 2023

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

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2023 6:33pm

@vercel vercel bot temporarily deployed to Preview June 21, 2023 05:41 Inactive
@dev2049
Copy link
Contributor

dev2049 commented Jun 21, 2023

overall looks good, just a few quick q's!

@vercel vercel bot temporarily deployed to Preview June 21, 2023 15:58 Inactive
@vercel vercel bot temporarily deployed to Preview June 21, 2023 16:30 Inactive
@vercel vercel bot temporarily deployed to Preview June 21, 2023 16:58 Inactive
@vercel vercel bot temporarily deployed to Preview June 21, 2023 18:10 Inactive
@matt-dz matt-dz requested a review from dev2049 June 21, 2023 18:31
@vercel vercel bot temporarily deployed to Preview June 21, 2023 18:33 Inactive
Copy link
Contributor

@dev2049 dev2049 left a comment

Choose a reason for hiding this comment

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

few more small comments but basically there!

class OSSContentFormatter(ContentFormatterBase):
"""Content handler for LLMs from the OSS catalog."""

content_type = "application/json"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: no need to specify since it's default (here or in other child classes)

Copy link
Contributor

Choose a reason for hiding this comment

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

note if you're setting api key as env var you don't need to pass it in when initializing class (you can drop endpoint_api_key=os.get("ENDPOINT_API_KEY"))

def validate_client(cls, field_value: Any, values: Dict) -> AzureMLEndpointClient:
"""Validate that api key and python package exists in environment."""
endpoint_key = get_from_dict_or_env(
values, "endpoint_api_key", "ENDPOINT_API_KEY"
Copy link
Contributor

Choose a reason for hiding this comment

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

can we give the env var a more class-specific name, like AZURE_ENDPOINT_API_KEY? if it's generic may collide with other env vars folks have

endpoint_key = get_from_dict_or_env(
values, "endpoint_api_key", "ENDPOINT_API_KEY"
)
endpoint_url = values["endpoint_url"]
Copy link
Contributor

Choose a reason for hiding this comment

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

should we just make it possible to pass in endpoint_url and deployment_name as env vars as well?

class AzureMLOnlineEndpoint(LLM, BaseModel):
"""Wrapper around Azure ML Hosted models using Managed Online Endpoints.
Example:
.. code-block:: python
Copy link
Contributor

Choose a reason for hiding this comment

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

need extra new line after .. code-block... or it won't render correctly

@dev2049 dev2049 changed the base branch from master to dev2049/azure_endpoint June 22, 2023 08:22
@dev2049 dev2049 merged commit b120b90 into langchain-ai:dev2049/azure_endpoint Jun 22, 2023
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.

3 participants