For the latest updates, examples and experimental features, please see ADS LangChain Integration.
Overview
Integration details
| Class | Package | Local | Serializable | JS support | Downloads | Version |
|---|---|---|---|---|---|---|
| ChatOCIModelDeployment | langchain-community | ❌ | beta | ❌ |
Model features
| Tool calling | Structured output | JSON mode | Image input | Audio input | Video input | Token-level streaming | Native async | Token usage | Logprobs |
|---|---|---|---|---|---|---|---|---|---|
| depends | depends | depends | depends | depends | depends | ✅ | ✅ | ✅ | ✅ |
Setup
To use ChatOCIModelDeployment you’ll need to deploy a chat model with chat completion endpoint and install thelangchain-community, langchain-openai and oracle-ads integration packages.
You can easily deploy foundation models using the AI Quick Actions on OCI Data Science Model deployment. For additional deployment examples, please visit the Oracle GitHub samples repository.
Policies
Make sure to have the required policies to access the OCI Data Science Model Deployment endpoint.Credentials
You can set authentication through Oracle ADS. When you are working in OCI Data Science Notebook Session, you can leverage resource principal to access other OCI resources.Installation
The LangChain OCIModelDeployment integration lives in thelangchain-community package. The following command will install langchain-community and the required dependencies.
Instantiation
You may instantiate the model with the genericChatOCIModelDeployment or framework specific class like ChatOCIModelDeploymentVLLM.
- Using
ChatOCIModelDeploymentwhen you need a generic entry point for deploying models. You can pass model parameters throughmodel_kwargsduring the instantiation of this class. This allows for flexibility and ease of configuration without needing to rely on framework-specific details.
- Using framework specific class like
ChatOCIModelDeploymentVLLM: This is suitable when you are working with a specific framework (e.g.vLLM) and need to pass model parameters directly through the constructor, streamlining the setup process.