Skip to main content
This will help you get started with OCIModelDeployment chat models. For detailed documentation of all ChatOCIModelDeployment features and configurations, see the langchain-oci package. OCI Data Science is a fully managed and serverless platform for data science teams to build, train, and manage machine learning models in the Oracle Cloud Infrastructure. You can use AI Quick Actions to easily deploy LLMs on OCI Data Science Model Deployment Service. You may choose to deploy the model with popular inference frameworks such as vLLM or TGI. By default, the model deployment endpoint mimics the OpenAI API protocol.
For the latest updates, examples and experimental features, please see ADS LangChain Integration.

Overview

Integration details

Model features

Some model features, including tool calling, structured output, and multi-modal inputs, are depending on deployed model.

Setup

To use ChatOCIModelDeployment, deploy a chat model with a chat completion endpoint and install the langchain-oci and oracle-ads 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.
Alternatively, you can configure the credentials using the following environment variables. For example, to use API key with specific profile:
Check out Oracle ADS docs to see more options.

Installation

The LangChain OCIModelDeployment integration lives in the langchain-oci package.

Instantiation

You may instantiate the model with the generic ChatOCIModelDeployment or framework specific class like ChatOCIModelDeploymentVLLM.
  • Using ChatOCIModelDeployment when you need a generic entry point for deploying models. You can pass model parameters through model_kwargs during 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.

Invocation

Chaining

Asynchronous calls

Streaming calls

Structured output

API reference

For comprehensive details on all features and configurations, see the langchain-oci package documentation for each class:
  • ChatOCIModelDeployment
  • ChatOCIModelDeploymentVLLM
  • ChatOCIModelDeploymentTGI