{"id":26824,"date":"2025-02-25T00:28:38","date_gmt":"2025-02-24T16:28:38","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=26824"},"modified":"2025-02-25T00:28:38","modified_gmt":"2025-02-24T16:28:38","slug":"lazyllm","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/ja\/lazyllm\/","title":{"rendered":"LazyLLM\uff1a\u5546\u6c64\u5f00\u6e90\u6784\u5efa\u591a\u667a\u80fd\u4f53\u5e94\u7528\u7684\u4f4e\u4ee3\u7801\u5f00\u53d1\u5de5\u5177"},"content":{"rendered":"<p>LazyLLM \u662f\u7531 LazyAGI \u56e2\u961f\u5f00\u53d1\u7684\u4e00\u6b3e\u5f00\u6e90\u5de5\u5177\uff0c\u4e13\u6ce8\u4e8e\u7b80\u5316\u591a\u667a\u80fd\u4f53\u5927\u6a21\u578b\u5e94\u7528\u7684\u5f00\u53d1\u6d41\u7a0b\u3002\u5b83\u901a\u8fc7\u4e00\u952e\u90e8\u7f72\u548c\u8f7b\u91cf\u7ea7\u7f51\u5173\u673a\u5236\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u642d\u5efa\u590d\u6742\u7684 AI \u5e94\u7528\uff0c\u8282\u7701\u7e41\u7410\u7684\u5de5\u7a0b\u914d\u7f6e\u65f6\u95f4\u3002\u65e0\u8bba\u4f60\u662f\u521d\u5b66\u8005\u8fd8\u662f\u8d44\u6df1\u5f00\u53d1\u8005\uff0cLazyLLM \u90fd\u80fd\u63d0\u4f9b\u652f\u6301\uff1a\u65b0\u624b\u53ef\u5229\u7528\u9884\u7f6e\u6a21\u5757\u8f7b\u677e\u4e0a\u624b\uff0c\u4e13\u5bb6\u5219\u80fd\u901a\u8fc7\u7075\u6d3b\u7684\u5b9a\u5236\u529f\u80fd\u5b9e\u73b0\u9ad8\u7ea7\u5f00\u53d1\u3002\u5de5\u5177\u5f3a\u8c03\u9ad8\u6548\u3001\u5b9e\u7528\uff0c\u96c6\u6210\u4f18\u9009\u7ec4\u4ef6\uff0c\u786e\u4fdd\u4ee5\u6700\u4f4e\u6210\u672c\u6784\u5efa\u751f\u4ea7\u73af\u5883\u53ef\u7528\u7684\u5e94\u7528\u3002\u76ee\u524d\u5df2\u5728 GitHub \u4e0a\u83b7\u5f97\u8d85\u8fc7 1100 \u4e2a\u661f\u6807\uff0c\u793e\u533a\u6d3b\u8dc3\uff0c\u6301\u7eed\u66f4\u65b0\u4e2d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-26825\" title=\"LazyLLM\uff1a\u5546\u6c64\u5f00\u6e90\u7684\u6784\u5efa\u591a\u667a\u80fd\u4f53\u4f4e\u4ee3\u7801\u5f00\u53d1\u5de5\u5177-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/02\/b4dec5890e01f4a.png\" alt=\"LazyLLM\uff1a\u5546\u6c64\u5f00\u6e90\u7684\u6784\u5efa\u591a\u667a\u80fd\u4f53\u4f4e\u4ee3\u7801\u5f00\u53d1\u5de5\u5177-1\" width=\"1909\" height=\"961\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/02\/b4dec5890e01f4a.png 1909w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/02\/b4dec5890e01f4a-768x387.png 768w\" sizes=\"auto, (max-width: 1909px) 100vw, 1909px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-26826\" title=\"LazyLLM\uff1a\u5546\u6c64\u5f00\u6e90\u7684\u6784\u5efa\u591a\u667a\u80fd\u4f53\u4f4e\u4ee3\u7801\u5f00\u53d1\u5de5\u5177-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/02\/23e74d73bb108a3.jpg\" alt=\"LazyLLM\uff1a\u5546\u6c64\u5f00\u6e90\u7684\u6784\u5efa\u591a\u667a\u80fd\u4f53\u4f4e\u4ee3\u7801\u5f00\u53d1\u5de5\u5177-1\" width=\"1618\" height=\"1320\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/02\/23e74d73bb108a3.jpg 1618w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/02\/23e74d73bb108a3-768x627.jpg 768w\" sizes=\"auto, (max-width: 1618px) 100vw, 1618px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li><strong>\u4e00\u952e\u90e8\u7f72\u590d\u6742\u5e94\u7528<\/strong>\uff1a\u652f\u6301\u4ece\u539f\u578b\u9a8c\u8bc1\u5230\u751f\u4ea7\u53d1\u5e03\u7684\u5b8c\u6574\u6d41\u7a0b\uff0c\u81ea\u52a8\u914d\u7f6e\u5b50\u6a21\u5757\u670d\u52a1\u3002<\/li>\n<li><strong>\u8de8\u5e73\u53f0\u517c\u5bb9\u6027<\/strong>\uff1a\u65e0\u9700\u6539\u52a8\u4ee3\u7801\u5373\u53ef\u9002\u914d\u88f8\u91d1\u5c5e\u670d\u52a1\u5668\u3001\u5f00\u53d1\u673a\u3001Slurm \u96c6\u7fa4\u548c\u516c\u6709\u4e91\u3002<\/li>\n<li><strong>\u6570\u636e\u6d41\u7ba1\u7406\uff08Flow\uff09<\/strong>\uff1a\u63d0\u4f9b Pipeline\u3001Parallel \u7b49\u9884\u5b9a\u4e49\u6d41\u7a0b\uff0c\u8f7b\u677e\u7ec4\u7ec7\u590d\u6742\u5e94\u7528\u903b\u8f91\u3002<\/li>\n<li><strong>\u6a21\u5757\u5316\u7ec4\u4ef6<\/strong>\uff1a\u652f\u6301\u81ea\u5b9a\u4e49\u548c\u6269\u5c55\uff0c\u96c6\u6210\u7528\u6237\u7b97\u6cd5\u6216\u7b2c\u4e09\u65b9\u5de5\u5177\u3002<\/li>\n<li><strong>\u8f7b\u91cf\u7ea7\u7f51\u5173\u673a\u5236<\/strong>\uff1a\u7b80\u5316\u670d\u52a1\u542f\u52a8\u548c URL \u914d\u7f6e\uff0c\u63d0\u5347\u5f00\u53d1\u6548\u7387\u3002<\/li>\n<li><strong>\u652f\u6301\u591a\u667a\u80fd\u4f53\u5f00\u53d1<\/strong>\uff1a\u5feb\u901f\u6784\u5efa\u5305\u542b\u591a\u4e2a AI \u4ee3\u7406\u7684\u5e94\u7528\uff0c\u9002\u914d\u5927\u6a21\u578b\u4efb\u52a1\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h3>\u5b89\u88c5\u6d41\u7a0b<\/h3>\n<p>LazyLLM \u662f\u4e00\u4e2a\u57fa\u4e8e Python \u7684\u5f00\u6e90\u9879\u76ee\uff0c\u5b89\u88c5\u8fc7\u7a0b\u7b80\u5355\u660e\u4e86\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<h4>\u73af\u5883\u51c6\u5907<\/h4>\n<ol>\n<li><strong>\u68c0\u67e5\u7cfb\u7edf\u8981\u6c42<\/strong>\uff1a\u786e\u4fdd\u4f60\u7684\u8bbe\u5907\u5b89\u88c5\u4e86 Python 3.8 \u6216\u4ee5\u4e0a\u7248\u672c\u3002<\/li>\n<li><strong>\u5b89\u88c5 Git<\/strong>\uff1a\u82e5\u672a\u5b89\u88c5 Git\uff0c\u53ef\u901a\u8fc7\u547d\u4ee4\u884c\u5de5\u5177\uff08\u5982\u00a0<code>apt-get install git<\/code>\u00a0\u6216\u00a0<code>brew install git<\/code>\uff09\u5b89\u88c5\u3002<\/li>\n<li><strong>\u521b\u5efa\u865a\u62df\u73af\u5883\uff08\u53ef\u9009\u4f46\u63a8\u8350\uff09<\/strong>\uff1a\n<pre><code>python -m venv lazyllm_env\r\nsource lazyllm_env\/bin\/activate  # Linux\/Mac\r\nlazyllm_env\\Scripts\\activate  # Windows<\/code><\/pre>\n<\/li>\n<\/ol>\n<h4>\u4e0b\u8f7d\u4e0e\u5b89\u88c5<\/h4>\n<ol>\n<li><strong>\u514b\u9686 GitHub \u4ed3\u5e93<\/strong>\uff1a\n<pre><code>git clone https:\/\/github.com\/LazyAGI\/LazyLLM.git\r\ncd LazyLLM\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u5b89\u88c5\u4f9d\u8d56<\/strong>\uff1a\n<ul>\n<li>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u5e93\uff1a\n<pre><code>pip install -r requirements.txt\r\n<\/code><\/pre>\n<\/li>\n<li>\u82e5\u9047\u5230\u4f9d\u8d56\u51b2\u7a81\uff0c\u53ef\u5c1d\u8bd5\u5347\u7ea7 pip\uff1a\n<pre><code>pip install --upgrade pip\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong>\uff1a\n<ul>\n<li>\u8fd0\u884c\u793a\u4f8b\u4ee3\u7801\u786e\u8ba4\u5b89\u88c5\u6210\u529f\uff1a\n<pre><code>python -m lazyllm --version\r\n<\/code><\/pre>\n<\/li>\n<li>\u82e5\u8fd4\u56de\u7248\u672c\u53f7\uff08\u5982 v0.5\uff09\uff0c\u8bf4\u660e\u5b89\u88c5\u5b8c\u6210\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h4>\u53ef\u9009\uff1aDocker \u90e8\u7f72<\/h4>\n<ul>\n<li>LazyLLM \u652f\u6301 Docker \u4e00\u952e\u6253\u5305\u955c\u50cf\uff1a\n<ol>\n<li>\u5b89\u88c5 Docker\uff08\u53c2\u8003\u5b98\u7f51\uff1ahttps:\/\/docs.docker.com\/get-docker\/\uff09\u3002<\/li>\n<li>\u5728\u9879\u76ee\u6839\u76ee\u5f55\u8fd0\u884c\uff1a\n<pre><code>docker build -t lazyllm:latest .\r\ndocker run -it lazyllm:latest\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<h3>\u5982\u4f55\u4f7f\u7528<\/h3>\n<p>LazyLLM \u7684\u6838\u5fc3\u5728\u4e8e\u901a\u8fc7\u6a21\u5757\u5316\u548c\u6570\u636e\u6d41\u7ba1\u7406\u5feb\u901f\u6784\u5efa AI \u5e94\u7528\u3002\u4ee5\u4e0b\u662f\u4e3b\u8981\u529f\u80fd\u7684\u8be6\u7ec6\u64cd\u4f5c\u6307\u5357\uff1a<\/p>\n<h4>\u529f\u80fd 1\uff1a\u4e00\u952e\u90e8\u7f72\u590d\u6742\u5e94\u7528<\/h4>\n<ul>\n<li><strong>\u64cd\u4f5c\u6b65\u9aa4<\/strong>\uff1a\n<ol>\n<li><strong>\u51c6\u5907\u5e94\u7528\u914d\u7f6e\u6587\u4ef6<\/strong>\uff1a\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\u521b\u5efa\u00a0<code>config.yaml<\/code>\uff0c\u5b9a\u4e49\u6a21\u5757\u548c\u670d\u52a1\u3002\u4f8b\u5982\uff1a\n<pre><code>modules:\r\n- name: llm\r\ntype: language_model\r\nurl: http:\/\/localhost:8000\r\n- name: embedding\r\ntype: embedding_service\r\nurl: http:\/\/localhost:8001\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u542f\u52a8\u670d\u52a1<\/strong>\uff1a\n<pre><code>python -m lazyllm deploy\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u68c0\u67e5\u72b6\u6001<\/strong>\uff1a\u8bbf\u95ee\u65e5\u5fd7\u8f93\u51fa\uff0c\u786e\u8ba4\u6240\u6709\u6a21\u5757\u8fd0\u884c\u6b63\u5e38\u3002<\/li>\n<\/ol>\n<\/li>\n<li><strong>\u7279\u8272\u8bf4\u660e<\/strong>\uff1a\u6b64\u529f\u80fd\u901a\u8fc7\u8f7b\u91cf\u7ea7\u7f51\u5173\u81ea\u52a8\u8fde\u63a5\u5b50\u6a21\u5757\uff0c\u65e0\u9700\u624b\u52a8\u914d\u7f6e URL\uff0c\u9002\u5408\u5feb\u901f\u539f\u578b\u642d\u5efa\u3002<\/li>\n<\/ul>\n<h4>\u529f\u80fd 2\uff1a\u8de8\u5e73\u53f0\u517c\u5bb9\u6027<\/h4>\n<ul>\n<li><strong>\u64cd\u4f5c\u6b65\u9aa4<\/strong>\uff1a\n<ol>\n<li><strong>\u6307\u5b9a\u5e73\u53f0<\/strong>\uff1a\u5728\u547d\u4ee4\u884c\u4e2d\u6dfb\u52a0\u53c2\u6570\uff0c\u4f8b\u5982\uff1a\n<pre><code>python -m lazyllm deploy --platform slurm\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u5207\u6362\u73af\u5883<\/strong>\uff1a\u65e0\u9700\u4fee\u6539\u4ee3\u7801\uff0c\u76f4\u63a5\u66f4\u6362\u00a0<code>--platform<\/code>\u00a0\u53c2\u6570\uff08\u5982\u00a0<code>cloud<\/code>\u00a0\u6216\u00a0<code>bare_metal<\/code>\uff09\u3002<\/li>\n<\/ol>\n<\/li>\n<li><strong>\u5e94\u7528\u573a\u666f<\/strong>\uff1a\u5f00\u53d1\u8005\u53ef\u5728\u672c\u5730\u6d4b\u8bd5\u540e\u65e0\u7f1d\u8fc1\u79fb\u5230\u4e91\u7aef\uff0c\u51cf\u5c11\u9002\u914d\u5de5\u4f5c\u91cf\u3002<\/li>\n<\/ul>\n<h4>\u529f\u80fd 3\uff1a\u6570\u636e\u6d41\u7ba1\u7406\uff08Flow\uff09<\/h4>\n<ul>\n<li><strong>\u64cd\u4f5c\u6b65\u9aa4<\/strong>\uff1a\n<ol>\n<li><strong>\u5b9a\u4e49\u6570\u636e\u6d41<\/strong>\uff1a\u5728 Python \u811a\u672c\u4e2d\u8c03\u7528\u9884\u5b9a\u4e49 Flow\u3002\u4f8b\u5982\u6784\u5efa\u4e00\u4e2a Pipeline\uff1a\n<pre><code>from lazyllm import pipeline\r\nflow = pipeline(\r\nstep1=lambda x: x.upper(),\r\nstep2=lambda x: f\"Result: {x}\"\r\n)\r\nprint(flow(\"hello\"))  # \u8f93\u51fa \"Result: HELLO\"\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u8fd0\u884c\u590d\u6742\u6d41\u7a0b<\/strong>\uff1a\u7ed3\u5408 Parallel \u6216 Diverter \u5904\u7406\u591a\u4efb\u52a1\uff1a\n<pre><code>from lazyllm import parallel\r\npar = parallel(\r\ntask1=lambda x: x * 2,\r\ntask2=lambda x: x + 3\r\n)\r\nprint(par(5))  # \u8f93\u51fa [10, 8]\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<li><strong>\u7279\u8272\u8bf4\u660e<\/strong>\uff1aFlow \u63d0\u4f9b\u6807\u51c6\u5316\u63a5\u53e3\uff0c\u51cf\u5c11\u6570\u636e\u8f6c\u6362\u7684\u91cd\u590d\u5de5\u4f5c\uff0c\u652f\u6301\u6a21\u5757\u95f4\u7684\u534f\u4f5c\u5f00\u53d1\u3002<\/li>\n<\/ul>\n<h4>\u529f\u80fd 4\uff1a\u6a21\u5757\u5316\u7ec4\u4ef6\u5b9a\u5236<\/h4>\n<ul>\n<li><strong>\u64cd\u4f5c\u6b65\u9aa4<\/strong>\uff1a\n<ol>\n<li><strong>\u6ce8\u518c\u81ea\u5b9a\u4e49\u51fd\u6570<\/strong>\uff1a\n<pre><code>from lazyllm import register\r\n@register\r\ndef my_function(input_text):\r\nreturn f\"Processed: {input_text}\"\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u96c6\u6210\u5230\u5e94\u7528<\/strong>\uff1a\u5728 Flow \u6216\u90e8\u7f72\u914d\u7f6e\u4e2d\u8c03\u7528\u00a0<code>my_function<\/code>\u3002<\/li>\n<\/ol>\n<\/li>\n<li><strong>\u9ad8\u7ea7\u7528\u6cd5<\/strong>\uff1a\u652f\u6301 Bash \u547d\u4ee4\u6ce8\u518c\uff0c\u7528\u4e8e\u6df7\u5408\u811a\u672c\u5f00\u53d1\u3002<\/li>\n<\/ul>\n<h4>\u4f7f\u7528\u6280\u5de7<\/h4>\n<ul>\n<li><strong>\u8c03\u8bd5<\/strong>\uff1a\u8fd0\u884c\u65f6\u6dfb\u52a0\u00a0<code>--verbose<\/code>\u00a0\u53c2\u6570\u67e5\u770b\u8be6\u7ec6\u65e5\u5fd7\uff1a\n<pre><code>python -m lazyllm deploy --verbose\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u793e\u533a\u652f\u6301<\/strong>\uff1a\u9047\u5230\u95ee\u9898\u53ef\u5728 GitHub Issues \u63d0\u4ea4\u53cd\u9988\uff0c\u56e2\u961f\u4f1a\u53ca\u65f6\u54cd\u5e94\u3002<\/li>\n<li><strong>\u66f4\u65b0<\/strong>\uff1a\u5b9a\u671f\u62c9\u53d6\u6700\u65b0\u4ee3\u7801\uff1a\n<pre><code>git pull origin main\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5feb\u901f\u4e0a\u624b LazyLLM\uff0c\u6784\u5efa\u4ece\u7b80\u5355\u539f\u578b\u5230\u751f\u4ea7\u7ea7\u522b\u7684\u5927\u6a21\u578b\u5e94\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LazyLLM \u662f\u7531 LazyAGI \u56e2\u961f\u5f00\u53d1\u7684\u4e00\u6b3e\u5f00\u6e90\u5de5\u5177\uff0c\u4e13\u6ce8\u4e8e\u7b80\u5316\u591a\u667a\u80fd\u4f53\u5927\u6a21\u578b\u5e94\u7528\u7684\u5f00\u53d1\u6d41\u7a0b\u3002\u5b83\u901a\u8fc7\u4e00\u952e\u90e8\u7f72\u548c\u8f7b\u91cf\u7ea7\u7f51\u5173\u673a\u5236\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u642d\u5efa\u590d\u6742\u7684 AI \u5e94\u7528\uff0c\u8282\u7701\u7e41\u7410\u7684\u5de5\u7a0b\u914d\u7f6e\u65f6\u95f4\u3002\u65e0\u8bba\u4f60\u662f\u521d\u5b66\u8005\u8fd8\u662f\u8d44\u6df1\u5f00\u53d1\u8005\uff0cLazyLLM&#8230;<\/p>\n","protected":false},"author":1,"featured_media":61916,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[230,201],"class_list":["post-26824","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tool","tag-aikaiyuanxiangmu","tag-aizhinengti"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/posts\/26824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/comments?post=26824"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/posts\/26824\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/media\/61916"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/media?parent=26824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/categories?post=26824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/tags?post=26824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}