Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 1.41 KB

File metadata and controls

26 lines (20 loc) · 1.41 KB

Tutorial: Using External Models or Provisioned Throughput

  1. Create an External Model or Provisioned Throughput endpoint

  2. Once your endpoint is created, update your RAG chain.py to reference the model using ChatDatabricks (for chat models) or Databricks (for completions models).

from langchain_community.chat_models import ChatDatabricks

model = ChatDatabricks(
    endpoint="name-of-your-external-model-or-pt-endpoint",
    # extra_params={}, # optional e.g., temperature, etc
)

chain = (
    {
        "question": itemgetter("messages") | RunnableLambda(extract_user_query_string),
    }
    | prompt
    | model
    | StrOutputParser()
)
  1. When logging your chain, RAG Studio will automaticaly detect the endpoint and provision the appropiate credentials for your deployed model to use it.