Unverified Commit 05a38612 authored by Massimiliano Pronesti's avatar Massimiliano Pronesti Committed by GitHub
Browse files

docs: add instruction for langchain (#1162)

parent d27f4bae
...@@ -66,6 +66,7 @@ Documentation ...@@ -66,6 +66,7 @@ Documentation
serving/run_on_sky serving/run_on_sky
serving/deploying_with_triton serving/deploying_with_triton
serving/deploying_with_docker serving/deploying_with_docker
serving/serving_with_langchain
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
......
.. _run_on_langchain:
Serving with Langchain
============================
vLLM is also available via `Langchain <https://github.com/langchain-ai/langchain>`_ .
To install langchain, run
.. code-block:: console
$ pip install langchain -q
To run inference on a single or multiple GPUs, use ``VLLM`` class from ``langchain``.
.. code-block:: python
from langchain.llms import VLLM
llm = VLLM(model="mosaicml/mpt-7b",
trust_remote_code=True, # mandatory for hf models
max_new_tokens=128,
top_k=10,
top_p=0.95,
temperature=0.8,
# tensor_parallel_size=... # for distributed inference
)
print(llm("What is the capital of France ?"))
Please refer to this `Tutorial <https://github.com/langchain-ai/langchain/blob/master/docs/extras/integrations/llms/vllm.ipynb>`_ for more details.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment