{"id":442697,"date":"2026-06-09T16:52:29","date_gmt":"2026-06-09T08:52:29","guid":{"rendered":"https:\/\/idc.net\/help\/?p=442697"},"modified":"2026-06-11T16:54:33","modified_gmt":"2026-06-11T08:54:33","slug":"%e5%9c%a8%e9%a6%99%e6%b8%afvps%e4%b8%8a%e9%83%a8%e7%bd%b2deepseek-ollama%e6%9c%ac%e5%9c%b0%e5%a4%a7%e6%a8%a1%e5%9e%8b%ef%bc%9agpu%e5%ae%9e%e4%be%8b%e9%85%8d%e7%bd%ae%e4%b8%8e%e6%8e%a8%e7%90%86","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/442697\/","title":{"rendered":"\u5728\u9999\u6e2fVPS\u4e0a\u90e8\u7f72DeepSeek \/ Ollama\u672c\u5730\u5927\u6a21\u578b\uff1aGPU\u5b9e\u4f8b\u914d\u7f6e\u4e0e\u63a8\u7406\u52a0\u901f\u6559\u7a0b"},"content":{"rendered":"<p>\u968f\u7740DeepSeek\u3001Llama3\u3001Qwen\u7b49\u5f00\u6e90\u5927\u6a21\u578b\u76f8\u7ee7\u53d1\u5e03\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u5f00\u53d1\u8005\u548c\u4f01\u4e1a\u9009\u62e9\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\u79c1\u6709\u5316\u90e8\u7f72AI\u6a21\u578b\uff0c\u907f\u514d\u6570\u636e\u5916\u6cc4\u5e76\u964d\u4f4eAPI\u8c03\u7528\u6210\u672c\u3002\u9999\u6e2fVPS\u56e0\u5176\u514d\u5907\u6848\u3001\u4f4e\u5ef6\u8fdf\u7684\u7279\u6027\uff0c\u6210\u4e3a\u90e8\u7f72\u672c\u5730\u5927\u6a21\u578b\u7684\u70ed\u95e8\u9009\u62e9\u3002\u672c\u6587\u5e26\u4f60\u5b8c\u6574\u8d70\u4e00\u904d\u90e8\u7f72\u6d41\u7a0b\u3002<\/p>\n<h2>\u4e00\u3001\u4e3a\u4ec0\u4e48\u9009\u9999\u6e2f\u670d\u52a1\u5668\u90e8\u7f72\u5927\u6a21\u578b\uff1f<\/h2>\n<ul>\n<li><strong>\u6570\u636e\u9690\u79c1<\/strong>\uff1a\u4f01\u4e1a\u654f\u611f\u6570\u636e\u4e0d\u7ecf\u8fc7\u7b2c\u4e09\u65b9API\uff0c\u5b8c\u5168\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\u63a8\u7406<\/li>\n<li><strong>\u4f4e\u5ef6\u8fdf\u8bbf\u95ee<\/strong>\uff1a\u5927\u9646\u7528\u6237\u8bbf\u95ee\u9999\u6e2f\u8282\u70b9\u5ef6\u8fdf10~30ms\uff0c\u4ea4\u4e92\u4f53\u9a8c\u63a5\u8fd1\u672c\u5730<\/li>\n<li><strong>\u6210\u672c\u53ef\u63a7<\/strong>\uff1a\u6309\u6708\u56fa\u5b9a\u8d39\u7528\uff0c\u76f8\u6bd4\u6309Token\u8ba1\u8d39\u7684\u5546\u4e1aAPI\uff0c\u9ad8\u9891\u8c03\u7528\u573a\u666f\u6210\u672c\u5927\u5e45\u964d\u4f4e<\/li>\n<li><strong>\u514d\u5907\u6848\u5feb\u901f\u4e0a\u7ebf<\/strong>\uff1a\u65e0\u9700ICP\u5907\u6848\uff0c\u4ed8\u6b3e\u540e\u5206\u949f\u7ea7\u5f00\u901a<\/li>\n<\/ul>\n<h2>\u4e8c\u3001\u786c\u4ef6\u914d\u7f6e\u9009\u578b<\/h2>\n<h3>CPU\u63a8\u7406\u65b9\u6848\uff08\u5165\u95e8\uff0c\u65e0\u9700GPU\uff09<\/h3>\n<p>\u5bf9\u4e8e7B\u4ee5\u4e0b\u7684\u5c0f\u6a21\u578b\uff08\u5982DeepSeek-R1-7B\u3001Llama3-8B\uff09\uff0c\u9ad8\u914dCPU\u5b9e\u4f8b\u53ef\u4ee5\u8fd0\u884c\uff0c\u4f46\u63a8\u7406\u901f\u5ea6\u8f83\u6162\uff08\u7ea65~15 tokens\/s\uff09\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u6a21\u578b\u89c4\u6a21<\/th>\n<th>\u6700\u4f4e\u914d\u7f6e<\/th>\n<th>\u63a8\u8350\u914d\u7f6e<\/th>\n<th>\u63a8\u7406\u901f\u5ea6\u53c2\u8003<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>3B\u4ee5\u4e0b<\/td>\n<td>4\u68388G<\/td>\n<td>8\u683816G<\/td>\n<td>15~30 t\/s<\/td>\n<\/tr>\n<tr>\n<td>7B<\/td>\n<td>8\u683816G<\/td>\n<td>16\u683832G<\/td>\n<td>5~15 t\/s<\/td>\n<\/tr>\n<tr>\n<td>13B<\/td>\n<td>16\u683832G<\/td>\n<td>32\u683864G<\/td>\n<td>2~8 t\/s<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>GPU\u63a8\u7406\u65b9\u6848\uff08\u63a8\u8350\uff0c\u901f\u5ea6\u63d0\u534710\u500d\u4ee5\u4e0a\uff09<\/h3>\n<p>GPU\u5b9e\u4f8b\u53ef\u5c067B\u6a21\u578b\u63a8\u7406\u901f\u5ea6\u63d0\u5347\u523050~100 tokens\/s\uff0c\u7528\u6237\u4f53\u9a8c\u663e\u8457\u6539\u5584\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>GPU\u578b\u53f7<\/th>\n<th>\u663e\u5b58<\/th>\n<th>\u9002\u5408\u6a21\u578b\u89c4\u6a21<\/th>\n<th>\u6708\u8d39\u53c2\u8003<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>NVIDIA T4<\/td>\n<td>16G<\/td>\n<td>7B~13B\uff084bit\u91cf\u5316\uff09<\/td>\n<td>\u7ea6800~1500\u5143<\/td>\n<\/tr>\n<tr>\n<td>NVIDIA A10<\/td>\n<td>24G<\/td>\n<td>13B~34B<\/td>\n<td>\u7ea62000~3500\u5143<\/td>\n<\/tr>\n<tr>\n<td>NVIDIA A100<\/td>\n<td>40G\/80G<\/td>\n<td>70B\u5168\u7cbe\u5ea6<\/td>\n<td>\u7ea68000\u5143\u8d77<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u4e09\u3001\u5b89\u88c5Ollama<\/h2>\n<p>Ollama\u662f\u76ee\u524d\u6700\u7b80\u5355\u7684\u672c\u5730\u5927\u6a21\u578b\u8fd0\u884c\u6846\u67b6\uff0c\u652f\u6301MacOS\u3001Linux\u548cWindows\uff0c\u63d0\u4f9b\u7edf\u4e00\u7684\u6a21\u578b\u7ba1\u7406\u548cAPI\u63a5\u53e3\u3002<\/p>\n<h3>Linux\u4e00\u952e\u5b89\u88c5<\/h3>\n<pre><code>curl -fsSL https:\/\/ollama.com\/install.sh | sh\r\n\r\n# \u9a8c\u8bc1\u5b89\u88c5\r\nollama --version\r\n\r\n# \u542f\u52a8Ollama\u670d\u52a1\r\nsystemctl start ollama\r\nsystemctl enable ollama<\/code><\/pre>\n<h2>\u56db\u3001\u4e0b\u8f7d\u5e76\u8fd0\u884cDeepSeek\u6a21\u578b<\/h2>\n<pre><code># \u4e0b\u8f7d\u5e76\u8fd0\u884cDeepSeek-R1 7B\uff08\u7ea64.7GB\uff09\r\nollama run deepseek-r1:7b\r\n\r\n# \u4e0b\u8f7dDeepSeek-R1 14B\uff08\u7ea69GB\uff0c\u970016G\u4ee5\u4e0a\u5185\u5b58\uff09\r\nollama run deepseek-r1:14b\r\n\r\n# \u67e5\u770b\u5df2\u4e0b\u8f7d\u7684\u6a21\u578b\u5217\u8868\r\nollama list\r\n\r\n# \u540e\u53f0\u8fd0\u884c\u6a21\u578b\u670d\u52a1\r\nollama serve &amp;<\/code><\/pre>\n<p>\u9996\u6b21\u8fd0\u884c\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u6a21\u578b\u6587\u4ef6\uff0c\u9999\u6e2f\u670d\u52a1\u5668\u4e0b\u8f7d\u901f\u5ea6\u901a\u5e38\u572850~200MB\/s\uff0c7B\u6a21\u578b\u7ea6\u97001~5\u5206\u949f\u3002<\/p>\n<h2>\u4e94\u3001\u5f00\u653eAPI\u63a5\u53e3\u4f9b\u5916\u90e8\u8c03\u7528<\/h2>\n<p>Ollama\u9ed8\u8ba4\u53ea\u76d1\u542c\u672c\u5730127.0.0.1\uff0c\u9700\u8981\u914d\u7f6e\u624d\u80fd\u4ece\u5916\u90e8\u8bbf\u95ee\u3002<\/p>\n<h3>\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h3>\n<pre><code># \u7f16\u8f91systemd\u670d\u52a1\u914d\u7f6e\r\nsystemctl edit ollama\r\n\r\n# \u5728[Service]\u6bb5\u6dfb\u52a0\uff1a\r\n[Service]\r\nEnvironment=\"OLLAMA_HOST=0.0.0.0:11434\"<\/code><\/pre>\n<pre><code>systemctl daemon-reload\r\nsystemctl restart ollama<\/code><\/pre>\n<h3>\u7528Nginx\u53cd\u5411\u4ee3\u7406\u5e76\u52a0\u5bc6<\/h3>\n<pre><code>server {\r\n    listen 443 ssl;\r\n    server_name ai.\u4f60\u7684\u57df\u540d.com;\r\n\r\n    ssl_certificate \/etc\/letsencrypt\/live\/ai.\u4f60\u7684\u57df\u540d.com\/fullchain.pem;\r\n    ssl_certificate_key \/etc\/letsencrypt\/live\/ai.\u4f60\u7684\u57df\u540d.com\/privkey.pem;\r\n\r\n    # \u7b80\u5355API Key\u9274\u6743\r\n    if ($http_authorization != \"Bearer \u4f60\u7684\u5bc6\u94a5\") {\r\n        return 403;\r\n    }\r\n\r\n    location \/ {\r\n        proxy_pass http:\/\/127.0.0.1:11434;\r\n        proxy_set_header Host $host;\r\n        proxy_read_timeout 300s;\r\n    }\r\n}<\/code><\/pre>\n<h2>\u516d\u3001API\u8c03\u7528\u793a\u4f8b<\/h2>\n<pre><code># \u4f7f\u7528curl\u6d4b\u8bd5\r\ncurl https:\/\/ai.\u4f60\u7684\u57df\u540d.com\/api\/generate \\\r\n  -H \"Authorization: Bearer \u4f60\u7684\u5bc6\u94a5\" \\\r\n  -H \"Content-Type: application\/json\" \\\r\n  -d '{\r\n    \"model\": \"deepseek-r1:7b\",\r\n    \"prompt\": \"\u7528Python\u5199\u4e00\u4e2a\u5feb\u901f\u6392\u5e8f\u51fd\u6570\",\r\n    \"stream\": false\r\n  }'<\/code><\/pre>\n<p>\u4e5f\u53ef\u4ee5\u901a\u8fc7OpenAI\u517c\u5bb9\u63a5\u53e3\u8c03\u7528\uff0c\u76f4\u63a5\u66ff\u6362\u539f\u6709OpenAI SDK\u7684base_url\uff1a<\/p>\n<pre><code>from openai import OpenAI\r\n\r\nclient = OpenAI(\r\n    base_url=\"https:\/\/ai.\u4f60\u7684\u57df\u540d.com\/v1\",\r\n    api_key=\"\u4f60\u7684\u5bc6\u94a5\"\r\n)\r\n\r\nresponse = client.chat.completions.create(\r\n    model=\"deepseek-r1:7b\",\r\n    messages=[{\"role\": \"user\", \"content\": \"\u4f60\u597d\"}]\r\n)\r\nprint(response.choices[0].message.content)<\/code><\/pre>\n<h2>\u4e03\u3001\u63a8\u7406\u6027\u80fd\u4f18\u5316<\/h2>\n<ul>\n<li><strong>\u4f7f\u7528\u91cf\u5316\u6a21\u578b<\/strong>\uff1aQ4_K_M\u91cf\u5316\u7248\u672c\u5728\u7cbe\u5ea6\u635f\u5931\u5f88\u5c0f\u7684\u60c5\u51b5\u4e0b\uff0c\u663e\u5b58\u5360\u7528\u51cf\u5c1150%\uff0c\u63a8\u7406\u901f\u5ea6\u63d0\u534730%<\/li>\n<li><strong>\u8bbe\u7f6e\u5e76\u53d1\u9650\u5236<\/strong>\uff1a<code>OLLAMA_NUM_PARALLEL=2<\/code> \u63a7\u5236\u5e76\u53d1\u63a8\u7406\u6570\u91cf\uff0c\u907f\u514dOOM<\/li>\n<li><strong>\u8c03\u6574\u4e0a\u4e0b\u6587\u957f\u5ea6<\/strong>\uff1a<code>OLLAMA_MAX_LOADED_MODELS=1<\/code> \u907f\u514d\u591a\u6a21\u578b\u540c\u65f6\u52a0\u8f7d\u5360\u7528\u663e\u5b58<\/li>\n<li><strong>\u4f7f\u7528SSD\u5b58\u50a8\u6a21\u578b<\/strong>\uff1aNVMe SSD\u6bd4HDD\u6a21\u578b\u52a0\u8f7d\u901f\u5ea6\u5feb5~10\u500d<\/li>\n<\/ul>\n<h2>\u516b\u3001\u5176\u4ed6\u53ef\u90e8\u7f72\u7684\u70ed\u95e8\u5f00\u6e90\u6a21\u578b<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u6a21\u578b<\/th>\n<th>\u7279\u957f<\/th>\n<th>Ollama\u547d\u4ee4<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Llama3.1:8b<\/td>\n<td>\u901a\u7528\u5bf9\u8bdd\uff0c\u82f1\u6587\u6700\u5f3a<\/td>\n<td>ollama run llama3.1:8b<\/td>\n<\/tr>\n<tr>\n<td>Qwen2.5:7b<\/td>\n<td>\u4e2d\u6587\u7406\u89e3\u4f18\u79c0<\/td>\n<td>ollama run qwen2.5:7b<\/td>\n<\/tr>\n<tr>\n<td>CodeLlama:13b<\/td>\n<td>\u4ee3\u7801\u751f\u6210<\/td>\n<td>ollama run codellama:13b<\/td>\n<\/tr>\n<tr>\n<td>Mistral:7b<\/td>\n<td>\u901f\u5ea6\u5feb\uff0c\u6b27\u6d32\u6570\u636e\u5408\u89c4<\/td>\n<td>ollama run mistral:7b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u4e5d\u3001\u603b\u7ed3<\/h2>\n<p>\u5728\u9999\u6e2fVPS\u4e0a\u7528Ollama\u90e8\u7f72\u672c\u5730\u5927\u6a21\u578b\uff0c\u6574\u4e2a\u8fc7\u7a0b\u7ea630\u5206\u949f\u5373\u53ef\u5b8c\u6210\u3002\u5bf9\u4e8e\u4e2a\u4eba\u5f00\u53d1\u8005\u548c\u4e2d\u5c0f\u4f01\u4e1a\uff0c7B\u91cf\u5316\u6a21\u578b\u5728CPU\u5b9e\u4f8b\u4e0a\u5373\u53ef\u6d41\u7545\u8fd0\u884c\uff0c\u6210\u672c\u6bcf\u6708\u767e\u5143\u7ea7\u3002\u5982\u9700\u66f4\u9ad8\u63a8\u7406\u901f\u5ea6\uff0cIDC.Net\u63d0\u4f9b<a href=\"https:\/\/idc.net\/\">\u9999\u6e2fGPU\u5b9e\u4f8b<\/a>\uff0cT4\u663e\u5361\u914d\u7f6e\u53ef\u5c06\u63a8\u7406\u901f\u5ea6\u63d0\u534710\u500d\u4ee5\u4e0a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u968f\u7740DeepSeek\u3001Llama3\u3001Qwen\u7b49\u5f00\u6e90\u5927\u6a21\u578b\u76f8\u7ee7\u53d1\u5e03\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u5f00\u53d1\u8005\u548c\u4f01\u4e1a\u9009\u62e9\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\u79c1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[202648],"tags":[],"class_list":["post-442697","post","type-post","status-publish","format-standard","hentry","category-hkvps"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/442697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=442697"}],"version-history":[{"count":1,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/442697\/revisions"}],"predecessor-version":[{"id":442698,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/442697\/revisions\/442698"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=442697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=442697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=442697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}