You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Optionally you can specify additional keyword arguments for the model, e.g. temperature.
53
+
# Optionally you can specify additional keyword arguments for the model, e.g. temperature and headers.
53
54
temperature=0.1,
55
+
headers={"route": "v1/chat/completions"}, # default header for chat models
54
56
)
55
57
56
58
Completion Models
57
59
=================
58
60
59
-
Completion models takes a text string and input and returns a string with completions. To use completion models, your model should be deployed with the completion endpoint (``/v1/completions``). The following example shows how you can use the ``OCIModelDeploymentVLLM`` class for model deployed with vLLM container. If you deployed the model with TGI container, you can use ``OCIModelDeploymentTGI`` similarly.
61
+
Completion models takes a text string and input and returns a string with completions. To use completion models, your model should be deployed with the completion endpoint (``/v1/completions``).
# Optionally you can specify additional keyword arguments for the model.
69
71
max_tokens=32,
72
+
headers={"route": "v1/completions"}, # default header for completion models
70
73
)
71
74
72
75
# Invoke the LLM. The completion will be a string.
@@ -87,18 +90,19 @@ Completion models takes a text string and input and returns a string with comple
87
90
Chat Models
88
91
===========
89
92
90
-
Chat models takes `chat messages <https://python.langchain.com/docs/concepts/#messages>`_ as inputs and returns additional chat message (usually `AIMessage <https://python.langchain.com/docs/concepts/#aimessage>`_) as output. To use chat models, your models must be deployed with chat completion endpoint (``/v1/chat/completions``). The following example shows how you can use the ``ChatOCIModelDeploymentVLLM`` class for model deployed with vLLM container. If you deployed the model with TGI container, you can use ``ChatOCIModelDeploymentTGI`` similarly.
93
+
Chat models takes `chat messages <https://python.langchain.com/docs/concepts/#messages>`_ as inputs and returns additional chat message (usually `AIMessage <https://python.langchain.com/docs/concepts/#aimessage>`_) as output. To use chat models, your models must be deployed with chat completion endpoint (``/v1/chat/completions``).
91
94
92
95
.. code-block:: python3
93
96
94
97
from langchain_core.messages import HumanMessage, SystemMessage
95
-
from ads.llm import ChatOCIModelDeploymentVLLM
98
+
from ads.llm import ChatOCIModelDeployment
96
99
97
-
llm = ChatOCIModelDeploymentVLLM(
100
+
llm = ChatOCIModelDeployment(
98
101
model="odsc-llm",
99
-
endpoint=f"<oci_model_deployment_url>>/predict",
102
+
endpoint=f"<oci_model_deployment_url>/predict",
100
103
# Optionally you can specify additional keyword arguments for the model.
101
104
max_tokens=32,
105
+
headers={"route": "v1/chat/completions"}, # default header for chat models
0 commit comments