本页还没有译文
本页 9 段还没译成日本語,下面显示的是英文原文。Haystack
还没翻译译自英文(docs.vllm.ai)本页 9 段都还没译
Haystack
Haystack is an end-to-end LLM framework that allows you to build applications powered by LLMs, Transformer models, vector search and more. Whether you want to perform retrieval-augmented generation (RAG), document search, question answering or answer generation, Haystack can orchestrate state-of-the-art embedding models and LLMs into pipelines to build end-to-end NLP applications and solve your use case.
It allows you to deploy a large language model (LLM) server with vLLM as the backend, which exposes OpenAI-compatible endpoints.
Prerequisites
Set up the vLLM and Haystack environment:
pip install vllm haystack-aiDeploy
-
Start the vLLM server with the supported chat completion model, e.g.
vllm serve mistralai/Mistral-7B-Instruct-v0.1 -
Use the
OpenAIGeneratorandOpenAIChatGeneratorcomponents in Haystack to query the vLLM server.
------------------------------
{'replies': [ChatMessage(_role=<ChatRole.ASSISTANT: 'assistant'>, _content=[TextContent(text=' Of course! Where in Italy would you like to go and what type of trip are you looking to plan?')], _name=None, _meta={'model': 'mistralai/Mistral-7B-Instruct-v0.1', 'index': 0, 'finish_reason': 'stop', 'usage': {'completion_tokens': 23, 'prompt_tokens': 21, 'total_tokens': 44, 'completion_tokens_details': None, 'prompt_tokens_details': None}})]}
------------------------------For details, see the tutorial Using vLLM in Haystack.