{"id":21418,"date":"2025-01-17T15:06:56","date_gmt":"2025-01-17T07:06:56","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=21418"},"modified":"2025-02-17T15:09:46","modified_gmt":"2025-02-17T07:09:46","slug":"vllm","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/de\/vllm\/","title":{"rendered":"vLLM\uff1a\u9ad8\u6548\u5185\u5b58\u5229\u7528\u7684LLM\u63a8\u7406\u548c\u670d\u52a1\u5f15\u64ce"},"content":{"rendered":"<p>vLLM\u662f\u4e00\u4e2a\u9ad8\u541e\u5410\u91cf\u548c\u5185\u5b58\u9ad8\u6548\u7684\u63a8\u7406\u548c\u670d\u52a1\u5f15\u64ce\uff0c\u4e13\u4e3a\u5927\u8bed\u8a00\u6a21\u578b\uff08LLM\uff09\u8bbe\u8ba1\u3002\u8be5\u9879\u76ee\u6700\u521d\u7531\u52a0\u5dde\u5927\u5b66\u4f2f\u514b\u5229\u5206\u6821\u7684Sky Computing Lab\u5f00\u53d1\uff0c\u73b0\u5df2\u6210\u4e3a\u4e00\u4e2a\u7531\u5b66\u672f\u754c\u548c\u5de5\u4e1a\u754c\u5171\u540c\u9a71\u52a8\u7684\u793e\u533a\u9879\u76ee\u3002vLLM\u65e8\u5728\u63d0\u4f9b\u5feb\u901f\u3001\u6613\u7528\u4e14\u6210\u672c\u4f4e\u5ec9\u7684LLM\u63a8\u7406\u670d\u52a1\uff0c\u652f\u6301\u591a\u79cd\u786c\u4ef6\u5e73\u53f0\uff0c\u5305\u62ecCUDA\u3001ROCm\u3001TPU\u7b49\u3002\u5176\u4e3b\u8981\u7279\u70b9\u5305\u62ec\u4f18\u5316\u7684\u6267\u884c\u5faa\u73af\u3001\u96f6\u5f00\u9500\u7684\u524d\u7f00\u7f13\u5b58\u548c\u589e\u5f3a\u7684\u591a\u6a21\u6001\u652f\u6301\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-21419\" title=\"vLLM\uff1a\u9ad8\u6548\u5185\u5b58\u5229\u7528\u7684LLM\u63a8\u7406\u548c\u670d\u52a1\u5f15\u64ce-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/02\/4b1a173278cef82.png\" alt=\"vLLM\uff1a\u9ad8\u6548\u5185\u5b58\u5229\u7528\u7684LLM\u63a8\u7406\u548c\u670d\u52a1\u5f15\u64ce-1\" width=\"750\" height=\"372\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li>\u9ad8\u541e\u5410\u91cf\u63a8\u7406\uff1a\u652f\u6301\u5927\u89c4\u6a21\u5e76\u884c\u63a8\u7406\uff0c\u663e\u8457\u63d0\u9ad8\u63a8\u7406\u901f\u5ea6\u3002<\/li>\n<li>\u5185\u5b58\u9ad8\u6548\uff1a\u901a\u8fc7\u4f18\u5316\u5185\u5b58\u7ba1\u7406\uff0c\u51cf\u5c11\u5185\u5b58\u5360\u7528\uff0c\u63d0\u9ad8\u6a21\u578b\u8fd0\u884c\u6548\u7387\u3002<\/li>\n<li>\u591a\u786c\u4ef6\u652f\u6301\uff1a\u517c\u5bb9CUDA\u3001ROCm\u3001TPU\u7b49\u591a\u79cd\u786c\u4ef6\u5e73\u53f0\uff0c\u7075\u6d3b\u90e8\u7f72\u3002<\/li>\n<li>\u96f6\u5f00\u9500\u524d\u7f00\u7f13\u5b58\uff1a\u51cf\u5c11\u91cd\u590d\u8ba1\u7b97\uff0c\u63d0\u9ad8\u63a8\u7406\u6548\u7387\u3002<\/li>\n<li>\u591a\u6a21\u6001\u652f\u6301\uff1a\u652f\u6301\u6587\u672c\u3001\u56fe\u50cf\u7b49\u591a\u79cd\u8f93\u5165\u7c7b\u578b\uff0c\u6269\u5c55\u5e94\u7528\u573a\u666f\u3002<\/li>\n<li>\u5f00\u6e90\u793e\u533a\uff1a\u7531\u5b66\u672f\u754c\u548c\u5de5\u4e1a\u754c\u5171\u540c\u7ef4\u62a4\uff0c\u6301\u7eed\u66f4\u65b0\u548c\u4f18\u5316\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h3>\u5b89\u88c5\u6d41\u7a0b<\/h3>\n<ol>\n<li>\u514b\u9686vLLM\u9879\u76ee\u4ed3\u5e93\uff1a<\/li>\n<\/ol>\n<pre><code>   git clone https:\/\/github.com\/vllm-project\/vllm.git\r\ncd vllm\r\n<\/code><\/pre>\n<ol start=\"2\">\n<li>\u5b89\u88c5\u4f9d\u8d56\uff1a<\/li>\n<\/ol>\n<pre><code>   pip install -r requirements.txt\r\n<\/code><\/pre>\n<ol start=\"3\">\n<li>\u6839\u636e\u786c\u4ef6\u5e73\u53f0\u9009\u62e9\u5408\u9002\u7684Dockerfile\u8fdb\u884c\u6784\u5efa\uff1a<\/li>\n<\/ol>\n<pre><code>   docker build -f Dockerfile.cuda -t vllm:cuda .\r\n<\/code><\/pre>\n<h3>\u4f7f\u7528\u6307\u5357<\/h3>\n<ol>\n<li>\u542f\u52a8vLLM\u670d\u52a1\uff1a<\/li>\n<\/ol>\n<pre><code>   python -m vllm.serve --model &lt;\u6a21\u578b\u8def\u5f84&gt;\r\n<\/code><\/pre>\n<ol start=\"2\">\n<li>\u53d1\u9001\u63a8\u7406\u8bf7\u6c42\uff1a<\/li>\n<\/ol>\n<pre><code>   import requests\r\nresponse = requests.post(\"http:\/\/localhost:8000\/infer\", json={\"input\": \"\u4f60\u597d\uff0c\u4e16\u754c\uff01\"})\r\nprint(response.json())\r\n<\/code><\/pre>\n<h3>\u8be6\u7ec6\u529f\u80fd\u64cd\u4f5c<\/h3>\n<ul>\n<li><strong>\u9ad8\u541e\u5410\u91cf\u63a8\u7406<\/strong>\uff1a\u901a\u8fc7\u5e76\u884c\u5316\u63a8\u7406\u4efb\u52a1\uff0cvLLM\u80fd\u591f\u5728\u77ed\u65f6\u95f4\u5185\u5904\u7406\u5927\u91cf\u8bf7\u6c42\uff0c\u9002\u7528\u4e8e\u9ad8\u5e76\u53d1\u573a\u666f\u3002<\/li>\n<li><strong>\u5185\u5b58\u9ad8\u6548<\/strong>\uff1avLLM\u91c7\u7528\u4f18\u5316\u7684\u5185\u5b58\u7ba1\u7406\u7b56\u7565\uff0c\u51cf\u5c11\u5185\u5b58\u5360\u7528\uff0c\u9002\u5408\u5728\u8d44\u6e90\u53d7\u9650\u7684\u73af\u5883\u4e2d\u8fd0\u884c\u3002<\/li>\n<li><strong>\u591a\u786c\u4ef6\u652f\u6301<\/strong>\uff1a\u7528\u6237\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u786c\u4ef6\u914d\u7f6e\u9009\u62e9\u5408\u9002\u7684Dockerfile\u8fdb\u884c\u6784\u5efa\uff0c\u7075\u6d3b\u90e8\u7f72\u5728\u4e0d\u540c\u5e73\u53f0\u4e0a\u3002<\/li>\n<li><strong>\u96f6\u5f00\u9500\u524d\u7f00\u7f13\u5b58<\/strong>\uff1a\u901a\u8fc7\u7f13\u5b58\u524d\u7f00\u8ba1\u7b97\u7ed3\u679c\uff0cvLLM\u51cf\u5c11\u4e86\u91cd\u590d\u8ba1\u7b97\uff0c\u63d0\u9ad8\u4e86\u63a8\u7406\u6548\u7387\u3002<\/li>\n<li><strong>\u591a\u6a21\u6001\u652f\u6301<\/strong>\uff1avLLM\u4e0d\u4ec5\u652f\u6301\u6587\u672c\u8f93\u5165\uff0c\u8fd8\u53ef\u4ee5\u5904\u7406\u56fe\u50cf\u7b49\u591a\u79cd\u8f93\u5165\u7c7b\u578b\uff0c\u6269\u5c55\u4e86\u5e94\u7528\u573a\u666f\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>vLLM\u662f\u4e00\u4e2a\u9ad8\u541e\u5410\u91cf\u548c\u5185\u5b58\u9ad8\u6548\u7684\u63a8\u7406\u548c\u670d\u52a1\u5f15\u64ce\uff0c\u4e13\u4e3a\u5927\u8bed\u8a00\u6a21\u578b\uff08LLM\uff09\u8bbe\u8ba1\u3002\u8be5\u9879\u76ee\u6700\u521d\u7531\u52a0\u5dde\u5927\u5b66\u4f2f\u514b\u5229\u5206\u6821\u7684Sky Computing Lab\u5f00\u53d1\uff0c\u73b0\u5df2\u6210\u4e3a\u4e00\u4e2a\u7531\u5b66\u672f\u754c\u548c\u5de5\u4e1a\u754c\u5171\u540c\u9a71\u52a8\u7684\u793e\u533a\u9879\u76ee\u3002vLLM\u65e8\u5728\u63d0\u4f9b\u5feb\u901f\u3001\u6613\u7528\u4e14\u6210\u672c\u4f4e\u5ec9\u7684L&#8230;<\/p>\n","protected":false},"author":1,"featured_media":61660,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[232],"class_list":["post-21418","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tool","tag-bendebushukaiyuanba"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/21418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/comments?post=21418"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/21418\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/media\/61660"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/media?parent=21418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/categories?post=21418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/tags?post=21418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}