{"id":5961,"date":"2025-02-08T13:55:11","date_gmt":"2025-02-08T05:55:11","guid":{"rendered":"https:\/\/blog.qdac.cc\/?p=5961"},"modified":"2025-02-08T23:38:52","modified_gmt":"2025-02-08T15:38:52","slug":"%e6%95%99%e7%a8%8bdeepseek-%e6%9c%ac%e5%9c%b0%e5%8c%96%e9%83%a8%e7%bd%b2%ef%bc%88linux%ef%bc%89","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=5961","title":{"rendered":"[\u6559\u7a0b]DeepSeek \u672c\u5730\u5316\u90e8\u7f72\uff08Linux\uff09"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>1\u3001Ollama\u90e8\u7f72<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/ollama.com\/download\">\u53c2\u8003 Ollama \u5b98\u7f51<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 Linux \u4f7f\u7528\u547d\u4ee4<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>curl -fsSL https:\/\/ollama.com\/install.sh | sh<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0b\u8f7d\u5e76\u6267\u884c install.sh \u811a\u672c\uff0c\u6ce8\u610f\u4fdd\u8bc1\u6839\u5206\u533a\u6709\u8db3\u591f\u7684\u7a7a\u95f4\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u624b\u52a8\u4e0b\u8f7d install.sh \uff0c\u4fee\u6539\u76ee\u6807\u5b89\u88c5\u4f4d\u7f6e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5982\u679c\u4fee\u6539\u4e86\u5b89\u88c5\u4f4d\u7f6e\uff0c\u9700\u8981\u5c06 \/usr\/local\/bin\/ollama \u7684\u7b26\u53f7\u94fe\u63a5\u5220\u9664\uff0c\u91cd\u5efa\u6307\u5411\u5b89\u88c5\u76ee\u5f55\u4e0b\u7684 bin\/ollama \u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2\u3001\u6309\u9700\u4fee\u6539\u670d\u52a1\u914d\u7f6e\u540e\u542f\u52a8\u670d\u52a1<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6309\u9700\u8981\u4fee\u6539\u670d\u52a1\u4e2d\u6a21\u578b\u4e0b\u8f7d\u4f4d\u7f6e\u548c\u670d\u52a1\u7aef\u53e3\uff0c\u7136\u540e\u91cd\u8f7d\u5e76\u91cd\u542f\u670d\u52a1\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Environment=&#8221;OLLAMA_MODELS=\/opt\/ollama\/models&#8221; #\u53ef\u9009\uff1a\u8bbe\u7f6e\u6a21\u578b\u7684\u4e0b\u8f7d\u4f4d\u7f6e<br>Environment=&#8221;OLLAMA_HOST=0.0.0.0:11434&#8243; #\u53ef\u9009\uff1a\u8bbe\u7f6e\u53ef\u8bbf\u95eeollama\u670d\u52a1\u7684\u5730\u5740\u4e0e\u7aef\u53e3(\u6b64\u5904\u8868\u793a\u4efb\u610fIP\u5730\u5740\u90fd\u53ef\u4ee5\u4ece\u7aef\u53e311434\u8bbf\u95ee\u6b64ollama\u670d\u52a1)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3\u3001\u8fd0\u884c\u547d\u4ee4\u4e0b\u8f7d\u6a21\u578b<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bbf\u95ee Ollama \u5b98\u7f51\u7684 <a href=\"https:\/\/ollama.com\/library\/deepseek-r1\">Deepseek \u6a21\u578b<\/a>\uff0c\u627e\u5230\u9700\u8981\u7684\u6a21\u578b\uff0c\u6027\u80fd\u8d8a\u5f3a\uff0c\u53ef\u9009\u6a21\u578b\u53ef\u4ee5\u8d8a\u597d\uff0c\u53ef\u80fd\u7684\u60c5\u51b5\u4e0b\uff0c\u5c3d\u91cf\u900932b\u53ca\u4ee5\u4e0a\u7684\u6a21\u578b\uff0c\u4e0d\u8981\u5148 14b \u4ee5\u4e0b\u6a21\u578b\uff0c\u8f93\u51fa\u5185\u5bb9\u7684\u53c2\u8003\u7a0b\u5ea6\u6709\u9650\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u7ec8\u7aef\u4e2d\uff0c\u8f93\u5165 ollama run \u6a21\u578b\u540d \u6765\u4e0b\u8f7d\u5e76\u8fdb\u884c\u6a21\u578b\u6267\u884c\uff0c\u53ef\u4ee5\u52a0\u5165 &#8211;verbose \u53c2\u6570\u6765\u663e\u793a\u7edf\u8ba1\u6570\u636e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ollama run deepseek-r1:14b &#8211;verbose<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u6d4b\u8bd5\u4e86\u51e0\u4e2a\u95ee\u9898\uff0c\u611f\u89c9 14b \u53ef\u4ee5\u505a\u4e3a\u4e00\u4e2a\u751c\u70b9\u503c\u4e86\uff0c\u914d\u7f6e\u9ad8\u7684\u5c31\u9009\u66f4\u597d\u7684\u6a21\u578b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4\u3001\u8054\u7f51\u641c\u7d22\u652f\u6301<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u6d4f\u89c8\u5668\u91cc\u5b89\u88c5 Page Assist \u63d2\u4ef6\uff0c\u7136\u540e\u8bbe\u7f6e\u597d\u641c\u7d22\u5f15\u64ce\u76f8\u5173\u53c2\u6570\u548c\u6587\u672c\u5d4c\u5165\u76f8\u5173\u8bbe\u7f6e\u3002\u7136\u540e\u6253\u5f00\u8054\u7f51\u9009\u9879\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2025\/02\/\u56fe\u7247.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"761\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2025\/02\/\u56fe\u7247-1024x761.png\" alt=\"\" class=\"wp-image-5974\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2025\/02\/\u56fe\u7247-1024x761.png 1024w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2025\/02\/\u56fe\u7247-300x223.png 300w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2025\/02\/\u56fe\u7247-768x570.png 768w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2025\/02\/\u56fe\u7247.png 1314w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a8\u8350 Delphi \u5f00\u53d1\u8005\u4f7f\u7528\u6a21\u578b\uff0c\u76f4\u63a5\u8f6c\u6362 C \u5934\u6587\u4ef6\u5230 Delphi \u5934\u6587\u4ef6\u6548\u679c\u76f8\u5f53\u4e0d\u9519\uff0c\u53ea\u67099GB\u5927\u5c0f\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>ollama run ishumilin\/deepseek-r1-coder-tools:14b<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u9009 1.5b\/7b\/8b\/14b\/32b\/70b,32b \u8dd1\u8d77\u6765\u5927\u7ea6\u9700\u8981 50G+\u5185\u5b58\uff0c70b \u9700\u8981 98G \u5185\u5b58\uff0c\u4e5f\u624d43GB\uff0c\u6709\u8db3\u591f\u7684\u5185\u5b58\u4e5f\u80fd\u8dd1\u8d77\u6765\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">14b \u7ffb\u8bd1 C++ \u5934\u6587\u4ef6\u5230 Pascal \u4ee3\u7801\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u4ee5\u4e0b\u662f\u5c06C\u8bed\u8a00\u5934\u6587\u4ef6\u5185\u5bb9\u8f6c\u6362\u4e3aPascal\u683c\u5f0f\u7684\u7248\u672c\uff1a\n\n```pascal\n(*\n * Copyright (c) 2016-2021, Przemyslaw Skibinski, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n *)\n\n#ifndef ZSTD_ZLIBWRAPPER_H\n#define ZSTD_ZLIBWRAPPER_H\n\n{$if defined(__cplusplus__)}\ninterface\n\n{$endif}\n\n(* \u5b9a\u4e49 *)\n#define ZLIB_CONST\n#define Z_PREFIX\n#define ZLIB_INTERNAL (* \u7981\u7528 gz*64 \u51fd\u6570\uff0c\u4f46\u4fee\u590d\u4e86 zlib 1.2.4 \u7684 Z_PREFIX \u95ee\u9898 *)\n\n#include &lt;zlib.h>\n\n{$ifndef z_const}\n    #define z_const\n{$endif}\n\n(* \u8fd4\u56de zstd \u5e93\u7684\u7248\u672c\u5b57\u7b26\u4e32 *)\nfunction zstdVersion: PChar;\n\n(* \u538b\u7f29\u90e8\u5206 *)\nprocedure ZWRAP_useZSTDcompression(turn_on: Integer);\nfunction ZWRAP_isUsingZSTDcompression: Integer;\nfunction ZWRAP_setPledgedSrcSize(strm: z_streamp; pledgedSrcSize: UInt64): Integer;\nfunction ZWRAP_deflateReset_keepDict(strm: z_streamp): Integer;\n\n(* \u89e3\u538b\u90e8\u5206 *)\ntype\n    ZWRAP_decompress_type = (ZWRAP_FORCE_ZLIB, ZWRAP_AUTO);\n\nprocedure ZWRAP_setDecompressionType(type_: ZWRAP_decompress_type);\nfunction ZWRAP_getDecompressionType: ZWRAP_decompress_type;\nfunction ZWRAP_isUsingZSTDdecompression(strm: z_streamp): Integer;\nfunction ZWRAP_inflateReset_keepDict(strm: z_streamp): Integer;\n\n{$if defined(__cplusplus__)}\nend\n{$endif}\n\n#endif (* ZSTD_ZLIBWRAPPER_H *)\n```\n\n\u6b64\u8f6c\u6362\u7248\u672c\uff1a\n1. \u4f7f\u7528\u4e86 Pascal \u7684\u8bed\u6cd5\u7ed3\u6784\uff0c\u5982 `(* \u6ce8\u91ca *)` \u548c `procedure\/function` \u58f0\u660e\u3002\n2. \u4fdd\u7559\u4e86\u539f\u59cb\u6587\u4ef6\u7684\u7248\u6743\u58f0\u660e\u3001\u8bb8\u53ef\u8bc1\u4fe1\u606f\u548c\u5b8f\u5b9a\u4e49\u3002\n3. \u5c06 C \u7684 `typedef enum` \u8f6c\u6362\u4e3a Pascal \u7684 `type` \u5b9a\u4e49\u3002\n4. \u5904\u7406\u4e86\u51fd\u6570\u6307\u9488\u548c\u5176\u4ed6\u7ed3\u6784\uff0c\u4f7f\u5176\u9002\u5e94 Pascal \u7684\u8bed\u6cd5\u3002\n5. \u79fb\u9664\u4e86 C++ \u7684 `extern \"C\"` \u548c\u5176\u4ed6\u7279\u5b9a\u4e8e\u8bed\u8a00\u7684\u7279\u6027\u3002\n\n\u6ce8\u610f\uff1aPascal \u4e0e C \u5728\u67d0\u4e9b\u65b9\u9762\u5b58\u5728\u5dee\u5f02\uff0c\u7279\u522b\u662f\u5173\u4e8e\u6587\u4ef6\u5305\u542b\u548c\u6a21\u5757\u5316\u3002\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d\u53ef\u80fd\u9700\u8981\u6839\u636e\u5177\u4f53\u9700\u6c42\u8fdb\u884c\u8c03\u6574\u3002\n\ntotal duration:       1m40.432799843s\nload duration:        11.188659ms\nprompt eval count:    1894 token(s)\nprompt eval duration: 21.461s\nprompt eval rate:     88.25 tokens\/s\neval count:           590 token(s)\neval duration:        1m18.936s\neval rate:            7.47 tokens\/s<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">32b \u7684\u7ffb\u8bd1\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u597d\u7684\uff0c\u6211\u73b0\u5728\u8981\u5c06\u4e00\u4e2aC\u8bed\u8a00\u7684\u5934\u6587\u4ef6\u8f6c\u6362\u4e3aPascal\u683c\u5f0f\u3002\u9996\u5148\uff0c\u6211\u9700\u8981\u4ed4\u7ec6\u9605\u8bfb\u5e76\u7406\u89e3\u8fd9\u4e2aC\u5934\u6587\u4ef6\u7684\u5185\u5bb9\u548c\u7ed3\u6784\u3002\n\n\u4ece\u5185\u5bb9\u6765\u770b\uff0c\u8fd9\u4e2a\u5934\u6587\u4ef6\u4e3b\u8981\u662fZstandard\u5e93\u7684\u4e00\u4e2azlib\u5305\u88c5\u5668\u3002\u5b83\u5305\u542b\u4e86\u538b\u7f29\u548c\u89e3\u538b\u7f29\u7684\u76f8\u5173\u51fd\u6570\u3001\u5b8f\u5b9a\u4e49\u4ee5\u53ca\u4e00\u4e9b\u7c7b\u578b\u5b9a\u4e49\u3002\u56e0\u6b64\uff0c\u5728\u8f6c\u6362\u65f6\uff0c\u6211\u9700\u8981\u786e\u4fdd\u6240\u6709\u8fd9\u4e9b\u5143\u7d20\u90fd\u80fd\u5728Pascal\u4e2d\u6b63\u786e\u5730\u8868\u8fbe\u51fa\u6765\n\u3002\n\n\u9996\u5148\uff0c\u5904\u7406\u7248\u6743\u4fe1\u606f\u3002C\u4e2d\u7684\u6ce8\u91ca\u4f7f\u7528\u201c\/*\u201d\u5f00\u59cb\uff0c\u201c*\/\u201d\u7ed3\u675f\u3002\u5728Pascal\u4e2d\uff0c\u5355\u884c\u6ce8\u91ca\u7528\u201c{\u201d\uff0c\u800c\u591a\u884c\u6ce8\u91ca\u5219\u53ef\u4ee5\u7ee7\u7eed\u4f7f\u7528\u201c{\u201d\u548c\u201c}\u201d\u3002\u56e0\u6b64\uff0c\u6211\u9700\u8981\u5c06\u7248\u6743\u90e8\u5206\u7684\u6ce8\u91ca\u8f6c\u6362\u4e3aPascal\u7684\u683c\u5f0f\u3002\n\n\u63a5\u4e0b\u6765\u662f\u5934\u6587\u4ef6\u7684\u5305\u542b\u4fdd\u62a4\u3002C\u8bed\u8a00\u4f7f\u7528#ifndef, #define\u548c#endif\u6765\u9632\u6b62\u91cd\u590d\u5305\u542b\u3002\u5728Pascal\u4e2d\uff0c\u901a\u5e38\u4f7f\u7528\u6761\u4ef6\u7f16\u8bd1\u6307\u4ee4{$IFNDEF}, {$DEFINE}\u548c{$ENDIF}\u3002\u6240\u4ee5\u8fd9\u90e8\u5206\u7ed3\u6784\u53ef\u4ee5\u4fdd\u6301\u7c7b\u4f3c\uff0c\u53ea\u9700\u8981\u8c03\u6574\u7b26\n\u53f7\u5373\u53ef\u3002\n\n\u7136\u540e\u662f\u9488\u5bf9C++\u7684\u5916\u90e8\u5757\u3002C\u4e2d\u7684extern \"C\"\u544a\u8bc9\u7f16\u8bd1\u5668\u8fd9\u4e9b\u51fd\u6570\u5e94\u8be5\u6309\u7167C\u7684\u65b9\u5f0f\u5904\u7406\u3002\u5728Pascal\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528 cdecl \u8c03\u7528\u7ea6\u5b9a\uff0c\u5e76\u4e14\u53ef\u80fd\u9700\u8981\u5305\u88f9\u51fd\u6570\u58f0\u660e\u5728\u5916\u5c42\u6a21\u5757\u4e2d\u3002\u56e0\u6b64\uff0c\u8fd9\u90e8\u5206\u6211\u9700\u8981\u6dfb\u52a0\u4e00\u4e2a \nbegin..end \u5757\u6765\u5305\u542b\u6240\u6709\u51fd\u6570\u58f0\u660e\u3002\n\n\u63a5\u4e0b\u6765\u662f\u5b8f\u5b9a\u4e49\u548c\u5934\u6587\u4ef6\u7684\u5305\u542b\u3002\u4f8b\u5982\uff0cZLIB_CONST, Z_ PREFIX \u7b49\u5b8f\u5728Pascal\u4e2d\u5982\u4f55\u5904\u7406\uff1fPascal\u901a\u5e38\u4e0d\u4f7f\u7528\u5b8f\uff0c\u800c\u662f\u76f4\u63a5\u5b9a\u4e49\u5e38\u91cf\u6216\u7c7b\u578b\u3002\u56e0\u6b64\uff0c\u8fd9\u4e9b\u5b8f\u53ef\u80fd\u9700\u8981\u8f6c\u6362\u4e3aconst\u6216\u8005\u7c7b\u4f3c\u7684\u65b9\u5f0f\u3002\u6b64\u5916\uff0c\n&lt;zlib.h>\u5728Pascal\u4e2d\u53ef\u80fd\u5df2\u7ecf\u6709\u4e00\u4e2a\u5bf9\u5e94\u7684\u5355\u5143\uff08unit\uff09\uff0c\u6240\u4ee5\u53ef\u80fd\u9700\u8981\u8c03\u6574include\u8bed\u53e5\u3002\n\n\u51fd\u6570\u58f0\u660e\u90e8\u5206\u9700\u8981\u6ce8\u610f\u53c2\u6570\u548c\u8fd4\u56de\u7c7b\u578b\u7684\u8f6c\u6362\u3002\u4f8b\u5982\uff0cC\u4e2d\u7684void * zstdVersion(void)\u5728Pascal\u4e2d\u53ef\u4ee5\u5199\u6210 function zstdVersion: PChar; cdecl; \u56e0\u4e3aPascal\u4f7f\u7528PChar\u6765\u8868\u793a\u6307\u5411\u5b57\u7b26\u7684\u6307\u9488\uff0c\u5e76\u4e14\ncdecl\u7528\u4e8e\u6307\u5b9a\u8c03\u7528\u7ea6\u5b9a\u4ee5\u5339\u914dC\u8bed\u8a00\u7684\u884c\u4e3a\u3002\n\n\u679a\u4e3e\u7c7b\u578b\u548c\u51fd\u6570\u53c2\u6570\u4e5f\u9700\u8981\u8c03\u6574\u3002\u4f8b\u5982\uff0cZWRAP_decompress_type\u662f\u4e00\u4e2a\u679a\u4e3e\u7c7b\u578b\uff0c\u5728Pascal\u4e2d\u53ef\u4ee5\u76f4\u63a5\u5b9a\u4e49\u4e3atype ZWRAP_decompress_type = (ZWRAP_FORCE_ZLIB, ZWRAP_AUTO); \u8fd9\u6837\u66f4\u6e05\u6670\u3002\n\n\u51fd\u6570\u7684\u53c2\u6570\u4f20\u9012\u65b9\u5f0f\u9700\u8981\u8003\u8651\u662f\u5426\u4f7f\u7528\u5f15\u7528\u6216\u6307\u9488\u3002\u6bd4\u5982z_streamp\u5728C\u4e2d\u662f\u6307\u5411z_stream\u7ed3\u6784\u4f53\u7684\u6307\u9488\uff0c\u56e0\u6b64\u5728Pascal\u4e2d\u5e94\u8be5\u4f7f\u7528var\u53c2\u6570\u6216\u8005\u4f5c\u4e3aPzStream\u7c7b\u578b\u7684\u6307\u9488\u6765\u4f20\u9012\u3002\n\n\u6b64\u5916\uff0c\u6240\u6709\u7684\u51fd\u6570\u90fd\u9700\u8981\u6dfb\u52a0 cdecl \u8c03\u7528\u7ea6\u5b9a\uff0c\u4ee5\u786e\u4fddPascal\u80fd\u591f\u6b63\u786e\u8c03\u7528\u8fd9\u4e9b\u5916\u90e8C\u51fd\u6570\u3002\u540c\u65f6\uff0c\u5728\u6a21\u5757\u7ed3\u675f\u65f6\u9700\u8981\u91cd\u65b0\u58f0\u660e cdecl\uff0c\u4ee5\u907f\u514d\u5f71\u54cd\u540e\u7eed\u4ee3\u7801\u7684\u9ed8\u8ba4\u8c03\u7528\u65b9\u5f0f\u3002\n\n\u6700\u540e\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cPascal\u4e2d\u7684\u7c7b\u578b\u547d\u540d\u548c\u5927\u5c0f\u5199\u89c4\u5219\u53ef\u80fd\u4e0eC\u4e0d\u540c\uff0c\u56e0\u6b64\u5728\u8f6c\u6362\u8fc7\u7a0b\u4e2d\u8981\u4fdd\u6301\u4e00\u81f4\u6027\uff0c\u5e76\u6839\u636e\u9700\u8981\u8c03\u6574\u6807\u8bc6\u7b26\u7684\u5927\u5c0f\u5199\u3002\n\n\u603b\u7ed3\u4e00\u4e0b\uff0c\u8f6c\u6362\u8fc7\u7a0b\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a\n\n1. \u5904\u7406\u6ce8\u91ca\uff1a\u5c06C\u7684\u591a\u884c\u6ce8\u91ca\u8f6c\u6362\u4e3aPascal\u7684\u591a\u884c\u6ce8\u91ca\u3002\n2. \u8f6c\u6362\u5934\u6587\u4ef6\u4fdd\u62a4\uff1a\u4f7f\u7528Pascal\u7684\u6761\u4ef6\u7f16\u8bd1\u6307\u4ee4\u4ee3\u66ffC\u7684#ifndef\u7b49\u3002\n3. \u5305\u88c5C\u51fd\u6570\u58f0\u660e\uff1a\u4f7f\u7528begin..end\u5757\u548ccdecl\u8c03\u7528\u7ea6\u5b9a\u3002\n4. \u66ff\u6362\u5b8f\u5b9a\u4e49\uff1a\u5c06C\u4e2d\u7684\u5b8f\u8f6c\u6362\u4e3aPascal\u4e2d\u7684\u5e38\u91cf\u6216\u7c7b\u578b\u3002\n5. \u8f6c\u6362\u6570\u636e\u7c7b\u578b\uff1a\u5982z_streamp\u8f6c\u4e3aPzStream\uff0cconst char *\u8f6c\u4e3aPChar\u7b49\u3002\n6. \u9002\u914d\u51fd\u6570\u58f0\u660e\uff1a\u786e\u4fdd\u53c2\u6570\u548c\u8fd4\u56de\u7c7b\u578b\u7684\u6b63\u786e\u6027\uff0c\u5e76\u6dfb\u52a0\u5fc5\u8981\u7684\u8c03\u7528\u7ea6\u5b9a\u3002\n7. \u5904\u7406\u679a\u4e3e\u7c7b\u578b\uff1a\u5728Pascal\u4e2d\u5b9a\u4e49\u76f8\u5e94\u7684\u679a\u4e3e\u7c7b\u578b\u3002\n\n\u5728\u6574\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u6211\u9700\u8981\u4ed4\u7ec6\u68c0\u67e5\u6bcf\u4e2a\u8f6c\u6362\u6b65\u9aa4\uff0c\u786e\u4fdd\u6ca1\u6709\u9057\u6f0f\u6216\u9519\u8bef\u3002\u5982\u679c\u9047\u5230\u4e0d\u786e\u5b9a\u7684\u90e8\u5206\uff0c\u53ef\u80fd\u9700\u8981\u67e5\u9605\u76f8\u5173\u6587\u6863\u6216\u53c2\u8003\u8d44\u6599\uff0c\u4ee5\u786e\u4fdd\u8f6c\u6362\u7684\u51c6\u786e\u6027\u548c\u517c\u5bb9\u6027\u3002\n&lt;\/think>\n\n\u4ee5\u4e0b\u662f\u5c06\u63d0\u4f9b\u7684C\u8bed\u8a00\u5934\u6587\u4ef6\u5185\u5bb9\u8f6c\u6362\u4e3aPascal\u683c\u5f0f\u7684\u7ed3\u679c\uff1a\n\n```pascal\n{*\n * Copyright (c) 2016-2021, Przemyslaw Skibinski, Yann Collet, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-mentioned licenses.\n *}\n\n{$IFNDEF ZSTD_ZLIBWRAPPER_H}\n{$DEFINE ZSTD_ZLIBWRAPPER_H}\n\nunit ZstdZlibWrapper;\n\ninterface\n\nuses\n  zlib; { Adjust this to the correct Pascal zlib unit if necessary }\n\ntype\n  z_streamp = PzStream;\n  ZWRAP_decompress_type = (ZWRAP_FORCE_ZLIB, ZWRAP_AUTO);\n\nconst\n  ZLIB_CONST = '';\n  Z_ PREFIX = '';\n\nprocedure UseZSTDCompression(turn_on: Integer); cdecl; external;\nfunction IsUsingZSTDCompression: Integer; cdecl; external;\nfunction SetPledgedSrcSize(strm: z_streamp; pledgedSrcSize: UInt64): Integer; cdecl; external;\nfunction DeflateReset_keepDict(strm: z_streamp): Integer; cdecl; external;\n\nprocedure SetDecompressionType(type_: ZWRAP_decompress_type); cdecl; external;\nfunction GetDecompressionType: ZWRAP_decompress_type; cdecl; external;\nfunction IsUsingZSTDdecompression(strm: z_streamp): Integer; cdecl; external;\nfunction InflateReset_keepDict(strm: z_streamp): Integer; cdecl; external;\n\nfunction zstdVersion: PChar; cdecl; external;\n\nimplementation\n\nbegin\n  { C functions are declared here with appropriate Pascal equivalents }\nend.\n\n{$ENDIF} { ZSTD_ZLIBWRAPPER_H }\n```\n\n### \u6ce8\u610f\u4e8b\u9879\uff1a\n1. **\u5355\u5143\uff08Unit\uff09\u540d\u79f0**\uff1a\u786e\u4fdd\u5355\u5143\u540d\u79f0\u4e0e\u6587\u4ef6\u540d\u4e00\u81f4\u3002\n2. **\u5916\u90e8\u51fd\u6570\u58f0\u660e**\uff1a\u4f7f\u7528 `external` \u5173\u952e\u5b57\u58f0\u660e\u5916\u90e8C\u51fd\u6570\uff0c\u5e76\u6307\u5b9a\u6b63\u786e\u7684\u8c03\u7528\u7ea6\u5b9a\uff08\u5982 `cdecl`\uff09\u3002\n3. **\u7c7b\u578b\u6620\u5c04**\uff1a\u5c06C\u4e2d\u7684\u7ed3\u6784\u4f53\u6307\u9488\u6620\u5c04\u4e3a\u76f8\u5e94\u7684Pascal\u6307\u9488\u7c7b\u578b\uff0c\u4f8b\u5982 `z_streamp` \u8f6c\u6362\u4e3a `PzStream`\u3002\n4. **\u679a\u4e3e\u7c7b\u578b**\uff1a\u5728Pascal\u4e2d\u5b9a\u4e49\u679a\u4e3e\u7c7b\u578b\u4ee5\u66ff\u4ee3C\u4e2d\u7684\u679a\u4e3e\u3002\n5. **\u5b57\u7b26\u4e32\u5904\u7406**\uff1a\u4f7f\u7528 `PChar` \u6765\u8868\u793a\u6307\u5411\u5b57\u7b26\u7684\u6307\u9488\uff0c\u5e76\u6839\u636e\u9700\u8981\u8fdb\u884c\u8f6c\u6362\u3002\n\n\u8bf7\u6839\u636e\u5b9e\u9645\u5f00\u53d1\u73af\u5883\u548cPascal\u7f16\u8bd1\u5668\u7684\u5177\u4f53\u8981\u6c42\u8c03\u6574\u4e0a\u8ff0\u4ee3\u7801\u3002\n\ntotal duration:       7m27.911770823s\nload duration:        12.723748ms\nprompt eval count:    1089 token(s)\nprompt eval duration: 56.433s\nprompt eval rate:     19.30 tokens\/s\neval count:           1419 token(s)\neval duration:        6m31.464s\neval rate:            3.62 tokens\/s<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001Ollama\u90e8\u7f72 \u53c2\u8003 Ollama [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[603,21],"tags":[838,839],"class_list":["post-5961","post","type-post","status-publish","format-standard","hentry","category-603","category-misc","tag-deepseek","tag-839"],"views":1694,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5961"}],"version-history":[{"count":10,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5961\/revisions"}],"predecessor-version":[{"id":5978,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5961\/revisions\/5978"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}