{"id":1002,"date":"2026-06-09T08:13:18","date_gmt":"2026-06-09T08:13:18","guid":{"rendered":"https:\/\/opshub.com.cn\/?p=1002"},"modified":"2026-06-10T02:55:58","modified_gmt":"2026-06-10T02:55:58","slug":"ollama-%e9%83%a8%e7%bd%b2%e9%ad%94%e5%a1%94-modelscope-%e5%a4%a7%e6%a8%a1%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/opshub.com.cn\/?p=1002","title":{"rendered":"Ollama \u90e8\u7f72\u9b54\u5854 (ModelScope) \u5927\u6a21\u578b"},"content":{"rendered":"\n<p>Ollama<strong>\u4ec5\u652f\u6301 GGUF \u683c\u5f0f\u6a21\u578b<\/strong>\uff0c\u5206<strong>\u5728\u7ebf\u4e00\u952e\u62c9\u53d6\uff08\u6700\u7b80\uff09\u3001\u79bb\u7ebf\u672c\u5730 GGUF \u5bfc\u5165\u3001\u539f\u6a21\u578b\u8f6c GGUF \u518d\u90e8\u7f72<\/strong>3 \u79cd\u65b9\u6848\uff0c\u4f18\u5148\u9009\u524d\u4e24\u79cd\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u524d\u7f6e\uff1a\u5b89\u88c5 Ollama<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Windows\/Mac<\/h3>\n\n\n\n<p>\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\uff1a<a href=\"https:\/\/link.wtturl.cn\/?target=https%3A%2F%2Follama.com%2Fdownload&amp;scene=im&amp;aid=497858&amp;lang=zh\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/ollama.com\/download<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Linux<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -fsSL https:\/\/ollama.com\/install.sh | sh<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u540e\u7ec8\u7aef\u8f93\u5165<code>ollama --version<\/code>\u9a8c\u8bc1\uff0c\u540e\u53f0\u81ea\u52a8\u542f\u52a8<code>ollama serve<\/code>\u670d\u52a1\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b9\u6848 1\uff1a\u5728\u7ebf\u4e00\u952e\u62c9\u53d6\u9b54\u5854 GGUF \u6a21\u578b\uff08\u63a8\u8350\uff0c\u65e0\u9700\u4e0b\u8f7d\u672c\u5730\uff09<\/h2>\n\n\n\n<p>\u9b54\u5854\u5e26 GGUF \u6807\u7b7e\u7684\u6a21\u578b\u53ef\u76f4\u63a5\u7528\u9b54\u5854\u4ed3\u5e93\u5730\u5740\u8fd0\u884c\uff0c\u683c\u5f0f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ollama run https:\/\/www.modelscope.cn\/\u6a21\u578b\u4f5c\u8005\/\u6a21\u578b\u4ed3\u5e93\u540d<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u64cd\u793a\u4f8b\uff08\u5343\u95ee 3-7B-GGUF\uff09<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u9b54\u5854\u6253\u5f00\u6a21\u578b\u9875\uff1a<code>https:\/\/www.modelscope.cn\/unsloth\/Qwen3-7B-Instruct-GGUF<\/code><\/li>\n\n\n\n<li>\u7ec8\u7aef\u6267\u884c\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code># \u9ed8\u8ba4Q4_K_M\u91cf\u5316\u7248\nollama run https:\/\/www.modelscope.cn\/unsloth\/Qwen3-7B-Instruct-GGUF\n# \u6307\u5b9a\u91cf\u5316\u89c4\u683c:Q5_K_M\nollama run https:\/\/www.modelscope.cn\/unsloth\/Qwen3-7B-Instruct-GGUF:Q5_K_M<\/code><\/pre>\n\n\n\n<p>\u81ea\u52a8\u4ece\u9b54\u5854\u4e0b\u8f7d + \u8f7d\u5165\uff0c\u4e0b\u8f7d\u5b8c\u76f4\u63a5\u5bf9\u8bdd\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b9\u6848 2\uff1a\u79bb\u7ebf\u90e8\u7f72\uff08\u672c\u5730\u5148\u4e0b\u8f7d GGUF\uff0c\u9002\u5408\u65e0\u7f51\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9aa4 1\uff1a\u9b54\u5854\u4e0b\u8f7d GGUF \u6587\u4ef6<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u9b54\u5854\u641c\u7d22\uff1a<code>\u5173\u952e\u8bcd GGUF<\/code>\uff08\u5982 Qwen2\u3001Llama3\u3001DeepSeek\uff09\uff0c\u7b5b\u9009\u5e26 GGUF \u4ed3\u5e93<\/li>\n\n\n\n<li>\u8fdb\u5165\u6a21\u578b\u2192<strong>\u6a21\u578b\u6587\u4ef6<\/strong>\uff0c\u9009\u62e9<code>Q4_K_M<\/code>\uff08\u5e73\u8861\u901f\u5ea6 \/ \u7cbe\u5ea6\uff0c\u901a\u7528\u9996\u9009\uff09\u540e\u7f00<code>.gguf<\/code>\u6587\u4ef6\u4e0b\u8f7d\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9aa4 2\uff1aModelfile \u5bfc\u5165 Ollama<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5728 GGUF \u540c\u76ee\u5f55\u65b0\u5efa<strong>\u65e0\u540e\u7f00\u6587\u4ef6 Modelfile<\/strong>\uff0c\u5199\u5165\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code># \u76f8\u5bf9\u8def\u5f84\nFROM .\/Qwen2-7B-Instruct.Q4_K_M.gguf\n# \u53ef\u9009\uff1a\u914d\u7f6e\u5bf9\u8bdd\u6a21\u677f\u3001\u4e0a\u4e0b\u6587\u7a97\u53e3\uff08\u907f\u514d\u4e71\u7b54\uff09\nPARAMETER num_ctx 8192<\/code><\/pre>\n\n\n\n<p>     2.  \u7ec8\u7aef\u5728\u5f53\u524d\u76ee\u5f55\u521b\u5efa\u81ea\u5b9a\u4e49\u6a21\u578b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># qwen2-7b-local\u4e3a\u81ea\u5b9a\u4e49\u6a21\u578b\u540d\nollama create qwen2-7b-local -f Modelfile\n# \u542f\u52a8\u8fd0\u884c\nollama run qwen2-7b-local<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b9\u6848 3\uff1a\u9b54\u5854\u539f\u7248 safetensors\/bin \u6a21\u578b \u2192 \u8f6c GGUF \u2192 Ollama \u90e8\u7f72<\/h2>\n\n\n\n<p>\u9b54\u5854\u5927\u90e8\u5206\u6a21\u578b\u662f\u539f\u751f HF \u683c\u5f0f (safetensors)\uff0c\u9700\u8981\u7528 llama.cpp \u8f6c GGUF\uff1a<\/p>\n\n\n\n<p>\u5728\u4e0b\u8f7d\u524d\uff0c\u8bf7\u5148\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5ModelScope\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install modelscope<\/code><\/pre>\n\n\n\n<p>1. \u4e0b\u8f7d\u6a21\u578b\u5230\u672c\u5730<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>modelscope download --model qwen\/Qwen2-7B-Instruct --local_dir .\/qwen2-7b-origin<\/code><\/pre>\n\n\n\n<p>2. \u514b\u9686 llama.cpp \u8f6c\u6362\u5de5\u5177<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/ggerganov\/llama.cpp\ncd llama.cpp\npip install -r requirements.txt<\/code><\/pre>\n\n\n\n<p>3. \u8f6c GGUF\uff08Q4_K_M \u5e38\u7528\u91cf\u5316\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python convert_hf_to_gguf.py ..\/qwen2-7b-origin \\\n--outfile ..\/qwen2-7b.Q4_K_M.gguf \\\n--outtype q4_k_m<\/code><\/pre>\n\n\n\n<p><code>f16<\/code>\uff1a\u5168\u7cbe\u5ea6\u3001\u4f53\u79ef\u5927\uff1b<code>q4_k_m<\/code>\uff1a\u65e5\u5e38\u90e8\u7f72\u6700\u4f18\uff1b<code>q2_k<\/code>\uff1a\u4f4e\u914d\u673a\u5668\u6781\u9650\u538b\u7f29\u3002<\/p>\n\n\n\n<p>4. \u540c\u65b9\u6848 2\uff0cModelfile+ollama create \u5bfc\u5165\u8fd0\u884c<\/p>\n\n\n\n<p>\u5e38\u7528\u8fd0\u7ef4\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ollama list          # \u67e5\u770b\u5df2\u5b89\u88c5\u6a21\u578b\nollama stop \u6a21\u578b\u540d    # \u505c\u6b62\u6a21\u578b\nollama rm \u6a21\u578b\u540d     # \u5220\u9664\u6a21\u578b\n# OpenAI\u683c\u5f0fAPI\u8c03\u7528\uff08\u9ed8\u8ba4\u7aef\u53e311434\uff09\ncurl http:\/\/localhost:11434\/api\/chat -d '{\"model\":\"qwen2-7b-local\",\"messages\":&#91;{\"role\":\"user\",\"content\":\"\u4f60\u597d\"}]}'<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u786c\u4ef6\u53c2\u8003\uff08Q4_K_M \u91cf\u5316\uff09<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1.5B\uff1a\u22654G \u5185\u5b58\uff1b7B\uff1a\u22658G \u5185\u5b58\uff1b13B\uff1a\u226516G \u5185\u5b58\uff1b34B\uff1a\u226532G \u5185\u5b58<\/li>\n\n\n\n<li>\u6709 N \u5361\u81ea\u52a8 GPU \u52a0\u901f\uff0cOllama \u81ea\u52a8\u8bc6\u522b CUDA\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ollama\u4ec5\u652f\u6301 GGUF \u683c\u5f0f\u6a21\u578b\uff0c\u5206\u5728\u7ebf\u4e00\u952e\u62c9\u53d6\uff08\u6700\u7b80\uff09\u3001\u79bb\u7ebf\u672c\u5730 GGUF \u5bfc\u5165\u3001\u539f\u6a21\u578b\u8f6c GGUF \u518d\u90e8\u7f723 \u79cd\u65b9\u6848\uff0c\u4f18\u5148\u9009\u524d\u4e24\u79cd\u3002 \u4e00\u3001\u524d\u7f6e\uff1a\u5b89\u88c5 Ollama Windows\/Mac \u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\uff1ahttps:\/\/ollama.com\/download Linux \u5b89\u88c5\u540e\u7ec8\u7aef\u8f93\u5165ollama &#8211;version\u9a8c\u8bc1\uff0c\u540e\u53f0\u81ea\u52a8\u542f\u52a8ollama serve\u670d\u52a1\u3002 \u65b9\u6848 1\uff1a\u5728\u7ebf\u4e00\u952e\u62c9\u53d6\u9b54\u5854 GGUF \u6a21\u578b\uff08\u63a8\u8350\uff0c\u65e0\u9700\u4e0b\u8f7d\u672c\u5730\uff09 \u9b54\u5854\u5e26 GGUF \u6807\u7b7e\u7684\u6a21\u578b\u53ef\u76f4\u63a5\u7528\u9b54\u5854\u4ed3\u5e93\u5730\u5740\u8fd0\u884c\uff0c\u683c\u5f0f\uff1a \u5b9e\u64cd\u793a\u4f8b\uff08\u5343\u95ee 3-7B-GGUF\uff09 \u81ea\u52a8\u4ece\u9b54\u5854\u4e0b\u8f7d + \u8f7d\u5165\uff0c\u4e0b\u8f7d\u5b8c\u76f4\u63a5\u5bf9\u8bdd\u3002 \u65b9\u6848 2\uff1a\u79bb\u7ebf\u90e8\u7f72\uff08\u672c\u5730\u5148\u4e0b\u8f7d GGUF\uff0c\u9002\u5408\u65e0\u7f51\uff09 \u6b65\u9aa4 1\uff1a\u9b54\u5854\u4e0b\u8f7d GGUF \u6587\u4ef6 \u6b65\u9aa4 2\uff1aModelfile \u5bfc\u5165 Ollama 2. \u7ec8\u7aef\u5728\u5f53\u524d\u76ee\u5f55\u521b\u5efa\u81ea\u5b9a\u4e49\u6a21\u578b\uff1a \u65b9\u6848 3\uff1a\u9b54\u5854\u539f\u7248 safetensors\/bin \u6a21\u578b \u2192 \u8f6c GGUF \u2192 Ollama \u90e8\u7f72 \u9b54\u5854\u5927\u90e8\u5206\u6a21\u578b\u662f\u539f\u751f HF \u683c\u5f0f (safetensors)\uff0c\u9700\u8981\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-1002","post","type-post","status-publish","format-standard","hentry","category-9"],"_links":{"self":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1002","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1002"}],"version-history":[{"count":4,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1002\/revisions"}],"predecessor-version":[{"id":1016,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1002\/revisions\/1016"}],"wp:attachment":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}