Skip to content

The agent engineering platform.

Allow specifying dtype in `langchain.llms.VLLM` (#9635)

Gabriel Fub2d9970fc1ae
diff --git a/libs/langchain/langchain/llms/vllm.py b/libs/langchain/langchain/llms/vllm.py
index bf82c8c214..9f456fde51 100644
--- a/libs/langchain/langchain/llms/vllm.py
+++ b/libs/langchain/langchain/llms/vllm.py
@@ -59,6 +59,9 @@ class VLLM(BaseLLM):
logprobs: Optional[int] = None
"""Number of log probabilities to return per output token."""
+ dtype: str = "auto"
+ """The data type for the model weights and activations."""
+
client: Any #: :meta private:
@root_validator()
@@ -77,6 +80,7 @@ class VLLM(BaseLLM):
model=values["model"],
tensor_parallel_size=values["tensor_parallel_size"],
trust_remote_code=values["trust_remote_code"],
+ dtype=values["dtype"],
)
return values