通过 Llama Stack 接入 vLLM 的两种推理配置方式

Llama Stack 支持以远程或内嵌两种方式接入 vLLM 推理服务。远程方式通过配置指向已运行的 vLLM 服务地址,内嵌方式则在 Llama Stack 内部直接加载模型并设置张量并行规模。

## 拉玛堆栈[¶](<https://docs.vllm.ai/en/latest/deployment/integrations/llamastack/#llama-stack>) VLLM 也可以通过 [拉玛堆栈](<https://github.com/llamastack/llama-stack>). 要安装 Llama Stack, 运行 ``` pip install llama-stack -q ``` ## 使用 OpenAI 兼容的 API 推论[¶](<https://docs.vllm.ai/en/latest/deployment/integrations/llamastack/#inference-using-openai-compatible-api>) 然后启动 Llama Stack 服务器, 并配置它来指向您的 vLLM 服务器, 设置如下 : ``` inference: - provider_id: vllm0 provider_type: remote::vllm config: url: http://127.0.0.1:8000 ``` 请参见: [本指南](<https://llama-stack.readthedocs.io/en/latest/providers/inference/remote_vllm.html>) 关于此远程 vLLM 提供者的更多细节 。 ## 使用嵌入式 vLLM 推论[¶](<https://docs.vllm.ai/en/latest/deployment/integrations/llamastack/#inference-using-embedded-vllm>) 一个 [内置提供者](<https://github.com/llamastack/llama-stack/tree/main/llama_stack/providers/inline/inference>) 也可以找到。这是使用该方法的配置样本: ``` inference: - provider_type: vllm config: model: Llama3.1-8B-Instruct tensor_parallel_size: 4 ``` 9月 8, 2025 (英语).

查看原始来源