{"id":1825,"date":"2026-07-30T18:07:11","date_gmt":"2026-07-30T10:07:11","guid":{"rendered":"https:\/\/www.imaseo.com\/blog\/?p=1825"},"modified":"2026-06-02T17:25:40","modified_gmt":"2026-06-02T09:25:40","slug":"idea-use-local-models-apis","status":"publish","type":"post","link":"https:\/\/www.imaseo.com\/blog\/ai-tools\/idea-use-local-models-apis","title":{"rendered":"IDEA \u4e0d\u53ea\u63a5 Claude \u548c Codex\uff1a\u672c\u5730\u6a21\u578b\u548c\u7b2c\u4e09\u65b9 API \u600e\u4e48\u76f4\u63a5\u7528\uff1f"},"content":{"rendered":"<p><strong>IDEA \u4e0d\u53ea\u63a5 Claude \u548c Codex\uff1a\u672c\u5730\u6a21\u578b\u548c\u7b2c\u4e09\u65b9 API \u600e\u4e48\u76f4\u63a5\u7528\uff1f<\/strong><\/p>\n<p>JetBrains IDEA \u7684 AI Assistant \u65e9\u5df2\u4e0d\u6b62\u80fd\u63a5 Claude \u548c OpenAI Codex\u3002\u73b0\u5728\uff0c\u901a\u8fc7\u7b80\u5355\u7684\u914d\u7f6e\uff0c\u4f60\u5c31\u53ef\u4ee5\u628a\u672c\u5730\u5927\u6a21\u578b\uff08Ollama\u3001LM Studio\uff09\u548c\u5404\u79cd\u7b2c\u4e09\u65b9 API\uff08DeepSeek\u3001\u7845\u57fa\u6d41\u52a8\u3001Groq\u3001Together.ai \u7b49\uff09\u76f4\u63a5\u63a5\u5165 IDEA\uff0c\u4eab\u53d7\u5b8c\u5168\u79bb\u7ebf\u3001\u79c1\u5bc6\u4e14\u51e0\u4e4e\u96f6\u6210\u672c\u7684\u667a\u80fd\u7f16\u7801\u4f53\u9a8c\u3002<\/p>\n<p>\u65e0\u8bba\u4f60\u662f\u8ffd\u6c42\u6570\u636e\u4e0d\u51fa\u516c\u53f8\u7684\u4f01\u4e1a\u5f00\u53d1\u8005\uff0c\u8fd8\u662f\u559c\u6b22\u6298\u817e\u672c\u5730 LLM \u7684\u4e2a\u4eba\u73a9\u5bb6\uff0c\u8fd9\u5957\u73a9\u6cd5\u90fd\u80fd\u8ba9\u4f60\u628a IDEA \u53d8\u6210\u771f\u6b63\u5c5e\u4e8e\u81ea\u5df1\u7684\u7f16\u7a0b\u795e\u5668\u3002<\/p>\n<h3>\u4e3a\u4ec0\u4e48\u8981\u5728 IDEA \u91cc\u63a5\u672c\u5730\u6a21\u578b\u548c\u7b2c\u4e09\u65b9 API\uff1f<\/h3>\n<p>\u672c\u5730\u6a21\u578b\u548c\u517c\u5bb9 OpenAI \u534f\u8bae\u7684\u7b2c\u4e09\u65b9 API\uff0c\u6709\u7740\u5b98\u65b9\u670d\u52a1\u96be\u4ee5\u66ff\u4ee3\u7684\u4f18\u52bf\uff1a<\/p>\n<ul>\n<li><strong>\u9690\u79c1\u7edd\u5bf9\u53ef\u63a7<\/strong>\uff1a\u4ee3\u7801\u4e0d\u79bb\u5f00\u672c\u5730\u6216\u4f01\u4e1a\u5185\u7f51\uff0c\u9002\u5408\u5904\u7406\u6838\u5fc3\u4e1a\u52a1\u903b\u8f91\u548c\u654f\u611f\u9879\u76ee<\/li>\n<li><strong>\u6210\u672c\u6781\u4f4e<\/strong>\uff1a\u672c\u5730\u6a21\u578b\u957f\u671f\u4f7f\u7528\u51e0\u4e4e\u96f6\u8fb9\u9645\u6210\u672c\uff0c\u7b2c\u4e09\u65b9\u4f18\u8d28 API \u4e5f\u8fdc\u6bd4 Claude 3.5\/4.0 \u4fbf\u5b9c<\/li>\n<li><strong>\u4e0d\u4f9d\u8d56\u6d77\u5916\u7f51\u7edc<\/strong>\uff1a\u672c\u5730\u6a21\u578b\u5b8c\u5168\u79bb\u7ebf\u8fd0\u884c\uff0c\u56fd\u5185\u5f00\u53d1\u8005\u518d\u4e5f\u4e0d\u7528\u62c5\u5fc3\u7f51\u7edc\u6ce2\u52a8<\/li>\n<li><strong>\u6a21\u578b\u9ad8\u5ea6\u5b9a\u5236<\/strong>\uff1a\u53ef\u4ee5\u6839\u636e\u56e2\u961f\u4ee3\u7801\u98ce\u683c\u5fae\u8c03\u6a21\u578b\uff0c\u6216\u76f4\u63a5\u4f7f\u7528 DeepSeek-Coder\u3001Qwen2.5-Coder \u7b49\u4ee3\u7801\u4e13\u5c5e\u6a21\u578b<\/li>\n<li><strong>\u54cd\u5e94\u901f\u5ea6\u53ef\u63a7<\/strong>\uff1a\u672c\u5730\u9ad8\u914d\u673a\u5668\u4e0a\uff0c\u4e2d\u5c0f\u6a21\u578b\u54cd\u5e94\u901f\u5ea6\u80fd\u505a\u5230\u4e1d\u6ed1<\/li>\n<\/ul>\n<p>\u5f53\u7136\uff0c\u524d\u63d0\u662f\u4f60\u7684\u673a\u5668\u8981\u6709\u8db3\u591f\u7684\u663e\u5b58\uff08\u63a8\u8350\u81f3\u5c11 16GB \u663e\u5b58\u8dd1 7B~14B \u6a21\u578b\uff09\u3002\u5982\u679c\u914d\u7f6e\u8ddf\u4e0d\u4e0a\uff0c\u4f53\u9a8c\u4f1a\u6253\u6298\u6263\u3002<\/p>\n<h3>\u6838\u5fc3\u539f\u7406\uff1aIDEA \u53ea\u8ba4 OpenAI \u517c\u5bb9\u534f\u8bae<\/h3>\n<p>JetBrains \u4ece 2024 \u5e74\u5f00\u59cb\u5927\u529b\u652f\u6301 <strong>OpenAI Compatible API<\/strong>\u3002\u53ea\u8981\u540e\u7aef\u63a5\u53e3\u9075\u5faa <code>\/v1\/chat\/completions<\/code> \u683c\u5f0f\uff0cIDEA \u5c31\u8ba4\u5b83\u3002<\/p>\n<p>\u8fd9\u610f\u5473\u7740\uff1a<br \/>\n&#8211; Ollama \u76f4\u63a5\u53ef\u7528\uff08<code>http:\/\/localhost:11434\/v1<\/code>\uff09<br \/>\n&#8211; LM Studio\u3001AnythingLLM\u3001Oobabooga \u7b49\u672c\u5730\u63a8\u7406\u5de5\u5177\u90fd\u80fd\u63a5<br \/>\n&#8211; \u56fd\u5185\u5916\u5404\u79cd\u4e2d\u8f6c\/\u5546\u7528 API\uff08DeepSeek\u3001\u6708\u4e4b\u6697\u9762\u3001\u7845\u57fa\u6d41\u52a8\u3001OpenRouter \u7b49\uff09\u5747\u53ef\u4e00\u952e\u63a5\u5165<\/p>\n<h3>\u7b2c\u4e00\u6b65\uff1a\u51c6\u5907\u672c\u5730\u6a21\u578b\u6216\u7b2c\u4e09\u65b9 API<\/h3>\n<h4>\u65b9\u6848\u4e00\uff1a\u4f7f\u7528 Ollama\uff08\u6700\u63a8\u8350\u672c\u5730\u73a9\u5bb6\uff09<\/h4>\n<ol>\n<li>\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5 Ollama\uff08\u652f\u6301 Mac\u3001Windows\u3001Linux\uff09<\/li>\n<li>\u62c9\u53d6\u4ee3\u7801\u6a21\u578b\uff1a<br \/>\n   <code>bash<br \/>\n   ollama pull qwen2.5-coder:14b<br \/>\n   ollama pull deepseek-coder-v2:16b<\/code><\/li>\n<li>\u542f\u52a8\u670d\u52a1\uff08\u9ed8\u8ba4\u7aef\u53e3 11434\uff09<\/li>\n<\/ol>\n<h4>\u65b9\u6848\u4e8c\uff1a\u4f7f\u7528 LM Studio \u6216 GPT4All<\/h4>\n<p>\u8fd9\u7c7b\u5de5\u5177\u81ea\u5e26\u56fe\u5f62\u754c\u9762\uff0c\u9002\u5408\u4e0d\u60f3\u6572\u547d\u4ee4\u7684\u7528\u6237\u3002\u542f\u52a8\u540e\u8bb0\u5f97\u6253\u5f00\u201cLocal Server\u201d\u529f\u80fd\uff0c\u590d\u5236\u63d0\u4f9b\u7684 API Base URL\u3002<\/p>\n<h4>\u65b9\u6848\u4e09\uff1a\u7b2c\u4e09\u65b9\u5546\u7528 API<\/h4>\n<p>\u63a8\u8350\u4f18\u5148\u7ea7\uff08\u6027\u4ef7\u6bd4\u6392\u5e8f\uff09\uff1a<br \/>\n&#8211; DeepSeek\uff08\u4ee3\u7801\u80fd\u529b\u6781\u5f3a\uff0c\u4ef7\u683c\u6781\u4f4e\uff09<br \/>\n&#8211; \u7845\u57fa\u6d41\u52a8\uff08SiliconFlow\uff09<br \/>\n&#8211; Groq\uff08\u901f\u5ea6\u6781\u5feb\uff09<br \/>\n&#8211; Together.ai \/ Fireworks.ai\uff08\u6a21\u578b\u79cd\u7c7b\u4e30\u5bcc\uff09<\/p>\n<h3>\u5728 IDEA \u4e2d\u914d\u7f6e\u672c\u5730\u6a21\u578b\u548c\u81ea\u5b9a\u4e49 API\uff08\u5b8c\u6574\u6b65\u9aa4\uff09<\/h3>\n<ol>\n<li>\u6253\u5f00 IDEA\uff0c\u8fdb\u5165 <strong>Settings \u2192 AI Assistant \u2192 Model configurations<\/strong><\/li>\n<li>\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684 <strong>Add model<\/strong> \u6216 <strong>Add custom provider<\/strong><\/li>\n<li>\u9009\u62e9 <strong>OpenAI Compatible<\/strong> \u4f5c\u4e3a Provider<\/li>\n<li>\u586b\u5199\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/li>\n<\/ol>\n<p><strong>\u672c\u5730 Ollama \u914d\u7f6e\u793a\u4f8b\uff1a<\/strong><br \/>\n&#8211; <strong>Name<\/strong>\uff1aOllama Qwen2.5-Coder<br \/>\n&#8211; <strong>Base URL<\/strong>\uff1a<code>http:\/\/localhost:11434\/v1<\/code><br \/>\n&#8211; <strong>API Key<\/strong>\uff1a\u968f\u4fbf\u586b\uff08\u53ef\u586b <code>ollama<\/code>\uff09<br \/>\n&#8211; <strong>Model<\/strong>\uff1a<code>qwen2.5-coder:14b<\/code>\uff08\u5fc5\u987b\u548c ollama list \u91cc\u7684\u540d\u5b57\u5b8c\u5168\u4e00\u81f4\uff09<\/p>\n<p><strong>\u7b2c\u4e09\u65b9 API \u914d\u7f6e\u793a\u4f8b\uff08\u4ee5 DeepSeek \u4e3a\u4f8b\uff09\uff1a<\/strong><br \/>\n&#8211; <strong>Base URL<\/strong>\uff1a<code>https:\/\/api.deepseek.com\/v1<\/code><br \/>\n&#8211; <strong>API Key<\/strong>\uff1a\u4f60\u7684 DeepSeek \u5bc6\u94a5<br \/>\n&#8211; <strong>Model<\/strong>\uff1a<code>deepseek-coder<\/code><\/p>\n<ol>\n<li>\u70b9\u51fb <strong>Test Connection<\/strong>\uff0c\u6210\u529f\u540e\u4fdd\u5b58\u3002<\/li>\n<\/ol>\n<p><strong>\u5c0f\u6280\u5de7<\/strong>\uff1a\u5982\u679c\u4f60\u4e4b\u524d\u767b\u5f55\u4e86 JetBrains AI\uff08Codex\/Claude \u76f8\u5173\u8d26\u53f7\uff09\uff0c\u5efa\u8bae\u5148\u9000\u51fa\u767b\u5f55\u3002IDEA \u4f1a\u4f18\u5148\u4f7f\u7528\u5b98\u65b9\u8d26\u53f7\uff0c\u5bfc\u81f4\u81ea\u5b9a\u4e49 API \u88ab\u8986\u76d6\u3002<\/p>\n<h3>\u5982\u4f55\u5728\u65e5\u5e38\u5f00\u53d1\u4e2d\u4f7f\u7528\uff1f<\/h3>\n<p>\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u6709\u4e24\u79cd\u4e3b\u8981\u4f7f\u7528\u65b9\u5f0f\uff1a<\/p>\n<p><strong>1. AI Chat \u6a21\u5f0f<\/strong><br \/>\n&#8211; \u53f3\u4e0b\u89d2 AI \u804a\u5929\u7a97\u53e3<br \/>\n&#8211; \u70b9\u51fb\u6a21\u578b\u9009\u62e9\u5668\uff0c\u5207\u6362\u5230\u4f60\u521a\u521a\u6dfb\u52a0\u7684\u672c\u5730\u6a21\u578b\u6216\u7b2c\u4e09\u65b9\u6a21\u578b<br \/>\n&#8211; \u53ef\u76f4\u63a5\u5bf9\u8bdd\u3001\u89e3\u91ca\u4ee3\u7801\u3001\u751f\u6210\u6d4b\u8bd5\u7528\u4f8b<\/p>\n<p><strong>2. Inline Completion\uff08\u884c\u5185\u8865\u5168\uff09<\/strong><br \/>\n&#8211; \u5728\u8bbe\u7f6e\u4e2d\u628a\u9ed8\u8ba4\u8865\u5168\u6a21\u578b\u6539\u4e3a\u4f60\u7684\u672c\u5730\/\u7b2c\u4e09\u65b9\u6a21\u578b<br \/>\n&#8211; \u5199\u4ee3\u7801\u65f6\u6309 <code>Tab<\/code> \u6216 <code>Alt + \\<\/code> \u89e6\u53d1\u8865\u5168\uff0c\u901f\u5ea6\u53d6\u51b3\u4e8e\u672c\u5730\u663e\u5361\u6027\u80fd<\/p>\n<h3>\u8fdb\u9636\u73a9\u6cd5\uff1a\u4e00\u4e2a\u7f51\u5173\u7ba1\u591a\u4e2a\u6a21\u578b<\/h3>\n<p>\u5f53\u4f60\u540c\u65f6\u60f3\u7528\u591a\u4e2a\u672c\u5730\u6a21\u578b\u548c\u591a\u4e2a API \u65f6\uff0c\u63a8\u8350\u4f7f\u7528 <strong>CliGate<\/strong> \u6216 <strong>LiteLLM<\/strong> \u8fd9\u6837\u7684\u672c\u5730\u4ee3\u7406\u5de5\u5177\u3002<\/p>\n<p>\u5b83\u4eec\u53ef\u4ee5\u628a\u6240\u6709\u6a21\u578b\u7edf\u4e00\u5230\u4e00\u4e2a <code>http:\/\/localhost:xxxx\/v1<\/code> \u5730\u5740\u4e0b\uff0c\u518d\u901a\u8fc7\u6a21\u578b\u540d\u79f0\u8def\u7531\u5230\u4e0d\u540c\u540e\u7aef\uff0c\u5b9e\u73b0\u300c\u4e00\u4e2a IDEA \u914d\u7f6e\uff0c\u8d70\u904d\u6240\u6709\u6a21\u578b\u300d\u3002<\/p>\n<h3>\u5e38\u89c1\u95ee\u9898\u89e3\u7b54<\/h3>\n<p><strong>Q\uff1a\u672c\u5730\u6a21\u578b\u54cd\u5e94\u5f88\u6162\u600e\u4e48\u529e\uff1f<\/strong><br \/>\nA\uff1a\u4f18\u5148\u4f7f\u7528 7B~14B \u7684\u7cbe\u7b80\u6a21\u578b\uff0c\u5173\u95ed\u601d\u8003\u94fe\uff08Chain of Thought\uff09\uff0c\u6216\u4f7f\u7528 GGUF \u91cf\u5316\u7248\u672c\uff08Q4_K_M\u3001Q5_K_M\uff09\u3002<\/p>\n<p><strong>Q\uff1a\u51fa\u73b0\u8ba4\u8bc1\u9519\u8bef\u6216 404\uff1f<\/strong><br \/>\nA\uff1a\u68c0\u67e5 Base URL \u662f\u5426\u4ee5 <code>\/v1<\/code> \u7ed3\u5c3e\uff0cModel \u540d\u79f0\u662f\u5426\u548c\u540e\u7aef\u5b8c\u5168\u4e00\u81f4\u3002<\/p>\n<p><strong>Q\uff1a\u60f3\u540c\u65f6\u4f7f\u7528 Claude \u505a\u67b6\u6784\u8bbe\u8ba1\u3001\u672c\u5730\u6a21\u578b\u505a\u4ee3\u7801\u5b9e\u73b0\u600e\u4e48\u529e\uff1f<\/strong><br \/>\nA\uff1aIDEA \u652f\u6301\u4e3a\u4e0d\u540c\u573a\u666f\u8bbe\u7f6e\u4e0d\u540c\u9ed8\u8ba4\u6a21\u578b\uff0c\u53ef\u5206\u522b\u914d\u7f6e Chat\u3001Completion\u3001Agent \u7b49\u573a\u666f\u7684\u6a21\u578b\u3002<\/p>\n<h3>\u5199\u5728\u6700\u540e<\/h3>\n<p>IDEA \u7684 AI \u751f\u6001\u5df2\u7ecf\u5f7b\u5e95\u5f00\u653e\u3002\u672c\u5730\u6a21\u578b + \u7b2c\u4e09\u65b9 API \u7684\u7ec4\u5408\uff0c\u4e0d\u4ec5\u80fd\u5927\u5e45\u964d\u4f4e\u4f7f\u7528\u6210\u672c\uff0c\u66f4\u91cd\u8981\u7684\u662f\u628a\u300c\u628a AI \u771f\u6b63\u53d8\u6210\u81ea\u5df1\u7684\u5de5\u5177\u300d\u8fd9\u4ef6\u4e8b\u843d\u5230\u4e86\u5b9e\u5904\u3002<\/p>\n<p>\u4e0d\u7ba1\u4f60\u662f\u8ffd\u6c42\u6781\u81f4\u9690\u79c1\u7684\u4f01\u4e1a\u5f00\u53d1\u8005\uff0c\u8fd8\u662f\u559c\u6b22\u5c1d\u9c9c\u7684\u4e2a\u4eba\u7a0b\u5e8f\u5458\uff0c\u73b0\u5728\u6b63\u662f\u628a\u672c\u5730\u5927\u6a21\u578b\u63a5\u5165 IDEA \u7684\u6700\u4f73\u65f6\u673a\u3002<\/p>\n<p><strong>\u884c\u52a8\u8d77\u6765<\/strong>\uff1a\u6253\u5f00\u4f60\u7684 IDEA\uff0c\u6309\u7167\u4e0a\u9762\u7684\u6b65\u9aa4\uff0c\u5148\u63a5\u4e00\u4e2a Ollama \u7684 Qwen2.5-Coder \u8bd5\u8bd5\u3002\u5341\u5206\u949f\u540e\uff0c\u4f60\u53ef\u80fd\u4f1a\u7231\u4e0a\u8fd9\u79cd\u300c\u6a21\u578b\u968f\u5fc3\u6362\uff0c\u6570\u636e\u6c38\u4e0d\u51fa\u95e8\u300d\u7684\u81ea\u7531\u611f\u3002<\/p>\n<p>\uff08\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u5206\u4eab\u4f60\u63a5\u5165\u7684\u6a21\u578b\u548c\u4f7f\u7528\u4f53\u9a8c\uff0c\u6211\u4eec\u4e00\u8d77\u4ea4\u6d41\u6700\u9002\u5408\u7f16\u7a0b\u7684\u672c\u5730 LLM \u914d\u7f6e\u3002\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IDEA \u4e0d\u53ea\u63a5 Claude \u548c Codex\uff1a\u672c\u5730\u6a21\u578b\u548c\u7b2c\u4e09\u65b9 API \u600e\u4e48\u76f4\u63a5\u7528\uff1f JetBrains IDEA \u7684\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1825","post","type-post","status-publish","format-standard","hentry","category-ai-tools"],"_links":{"self":[{"href":"https:\/\/www.imaseo.com\/blog\/wp-json\/wp\/v2\/posts\/1825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.imaseo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.imaseo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.imaseo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.imaseo.com\/blog\/wp-json\/wp\/v2\/comments?post=1825"}],"version-history":[{"count":1,"href":"https:\/\/www.imaseo.com\/blog\/wp-json\/wp\/v2\/posts\/1825\/revisions"}],"predecessor-version":[{"id":1826,"href":"https:\/\/www.imaseo.com\/blog\/wp-json\/wp\/v2\/posts\/1825\/revisions\/1826"}],"wp:attachment":[{"href":"https:\/\/www.imaseo.com\/blog\/wp-json\/wp\/v2\/media?parent=1825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.imaseo.com\/blog\/wp-json\/wp\/v2\/categories?post=1825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.imaseo.com\/blog\/wp-json\/wp\/v2\/tags?post=1825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}