{"id":48508,"date":"2024-04-13T10:27:13","date_gmt":"2024-04-13T02:27:13","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=48508"},"modified":"2024-05-10T17:14:23","modified_gmt":"2024-05-10T09:14:23","slug":"freegpt35wu-xu-deng-lu-zhu-ce-kai-xiang-ji-yong","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2024\/04\/13\/freegpt35wu-xu-deng-lu-zhu-ce-kai-xiang-ji-yong\/","title":{"rendered":"FreeGPT35\u2014\u2014\u65e0\u9700\u767b\u5f55\u6ce8\u518c\uff0c\u5f00\u7bb1\u5373\u7528"},"content":{"rendered":"<h1><a id=\"freegpt35%E2%80%94%E2%80%94%E6%97%A0%E9%9C%80%E7%99%BB%E5%BD%95%E6%B3%A8%E5%86%8C%EF%BC%8C%E5%BC%80%E7%AE%B1%E5%8D%B3%E7%94%A8\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>FreeGPT35\u2014\u2014\u65e0\u9700\u767b\u5f55\u6ce8\u518c\uff0c\u5f00\u7bb1\u5373\u7528<\/h1>\n<h2><a id=\"%E7%AE%80%E4%BB%8B\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u7b80\u4ecb<\/h2>\n<p>\u4ece\u4eca\u5e744\u67082\u65e5\u5f00\u59cb\uff0cGPT 3.5 \u5f00\u59cb\u63d0\u4f9b\u65e0\u9700\u6ce8\u518c\u3001\u65e0\u9700\u767b\u5f55\u5373\u53ef\u76f4\u63a5\u8bbf\u95ee\u7684\u670d\u52a1\uff0c\u5e76\u4e14\u5b98\u65b9\u8fd8\u8c03\u6574\u4e86\u5176 API \u7684\u653f\u7b56\u3002\u968f\u7740\u5b98\u65b9\u653f\u7b56\u7684\u8c03\u6574\uff0cGitHub \u4e0a\u6d8c\u73b0\u4e86\u4e00\u4e2a\u540d\u4e3a FreeGPT35 \u7684\u5f00\u6e90\u9879\u76ee\uff0c\u8be5\u9879\u76ee\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528 3.5 \u7248\u672c\u7684 API\uff0c\u5e76\u4e14\u5b8c\u5168\u514d\u8d39\u3002\u4ece\u6280\u672f\u539f\u7406\u4e0a\u770b\uff0cFreeGPT35 \u7684\u4f5c\u7528\u76f8\u5f53\u4e8e\u6a21\u62df\u7528\u6237\u8bbf\u95ee ChatGPT 3.5 \u7684\u7f51\u9875\u7248\u3002<\/p>\n<p>GitHub\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/missuo\/FreeGPT35\">https:\/\/github.com\/missuo\/FreeGPT35<\/a><\/p>\n<h2><a id=\"%E5%AE%89%E8%A3%85%E5%92%8C%E4%BD%BF%E7%94%A8\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u5b89\u88c5\u548c\u4f7f\u7528<\/h2>\n<p>\u5728\u90e8\u7f72\u548c\u4f7f\u7528\u4e00\u4e2a\u540d\u4e3a FreeGPT35 \u7684\u670d\u52a1\u65f6\uff0c\u60a8\u53ef\u4ee5\u5229\u7528\u5176\u57fa\u4e8e GPT-3.5 \u6a21\u578b\u7684\u804a\u5929\u63a5\u53e3\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528 Node.js \u548c npm \u5b89\u88c5\u548c\u542f\u52a8\u670d\u52a1\u7684\u65b9\u6cd5\uff0c\u4ee5\u53ca\u4f7f\u7528 Docker \u548c Docker Compose \u8fdb\u884c\u5bb9\u5668\u5316\u90e8\u7f72\u7684\u6b65\u9aa4\u3002\u6b64\u5916\uff0c\u8fd8\u63d0\u4f9b\u4e86\u914d\u7f6e Nginx \u53cd\u5411\u4ee3\u7406\u548c\u8d1f\u8f7d\u5747\u8861\u4ee5\u53ca\u8bf7\u6c42\u793a\u4f8b\u548c\u517c\u5bb9\u6027\u8bf4\u660e\u7684\u6307\u5357\u3002<\/p>\n<h3><a id=\"%E9%83%A8%E7%BD%B2%E5%92%8C%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u90e8\u7f72\u548c\u542f\u52a8\u670d\u52a1<\/h3>\n<p>\u5b89\u88c5 Node.js \u548c npm\u3002\u4f7f\u7528 npm \u5b89\u88c5\u4f9d\u8d56\u3002\u542f\u52a8\u670d\u52a1\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<pre><code class=\"language-shell\">npm install\nnode app.js\n<\/code><\/pre>\n<h3><a id=\"%E4%BD%BF%E7%94%A8docker%E9%83%A8%E7%BD%B2%E6%9C%8D%E5%8A%A1\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u4f7f\u7528Docker\u90e8\u7f72\u670d\u52a1<\/h3>\n<h4><a id=\"%E8%BF%90%E8%A1%8Cdocker%E5%AE%B9%E5%99%A8%E4%BB%A5%E9%83%A8%E7%BD%B2%E6%9C%8D%E5%8A%A1\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u8fd0\u884c Docker \u5bb9\u5668\u4ee5\u90e8\u7f72\u670d\u52a1<\/h4>\n<pre><code class=\"language-bash\">docker run -p 3040:3040 ghcr.io\/missuo\/freegpt35\n \ndocker run -p 3040:3040 missuo\/freegpt35\n<\/code><\/pre>\n<h4><a id=\"%E4%BD%BF%E7%94%A8docker-compose%E8%BF%9B%E8%A1%8C%E6%9B%B4%E6%96%B9%E4%BE%BF%E7%9A%84%E5%AE%B9%E5%99%A8%E5%8C%96%E9%83%A8%E7%BD%B2\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u4f7f\u7528 Docker Compose \u8fdb\u884c\u66f4\u65b9\u4fbf\u7684\u5bb9\u5668\u5316\u90e8\u7f72<\/h4>\n<h5><a id=\"freegpt35%E6%9C%8D%E5%8A%A1\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>FreeGPT35 \u670d\u52a1<\/h5>\n<pre><code class=\"language-shell\">mkdir freegpt35 && cd freegpt35\nwget -O compose.yaml https:\/\/raw.githubusercontent.com\/missuo\/FreeGPT35\/main\/compose.yaml\ndocker compose up -d\n<\/code><\/pre>\n<h5><a id=\"%E5%B8%A6%E6%9C%89chatgpt-next-web%E7%9A%84%E6%9C%8D%E5%8A%A1\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u5e26\u6709 ChatGPT-Next-Web \u7684\u670d\u52a1<\/h5>\n<pre><code class=\"language-shell\">mkdir freegpt35 && cd freegpt35\nwget -O compose.yaml https:\/\/raw.githubusercontent.com\/missuo\/FreeGPT35\/main\/compose_with_next_chat.yaml\ndocker compose up -d\n<\/code><\/pre>\n<p>\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee <code>http:\/\/[IP]:3040\/v1\/chat\/completions<\/code> \u4f7f\u7528 API\u3002\u6216\u8005\u4f7f\u7528 <code>http:\/\/[IP]:3000<\/code> \u76f4\u63a5\u4f7f\u7528 ChatGPT-Next-Web\u3002<\/p>\n<h2><a id=\"%E9%85%8D%E7%BD%AE%E4%BB%A3%E7%90%86\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u914d\u7f6e\u4ee3\u7406<\/h2>\n<h3><a id=\"nginx%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>Nginx\u53cd\u5411\u4ee3\u7406<\/h3>\n<pre><code class=\"language-xml\">location ^~ \/ {\n        proxy_pass http:\/\/127.0.0.1:3040; \n        proxy_set_header Host <span class=\"katex math inline\">host;        proxy_set_header X-Real-IP<\/span>remote_addr; \n        proxy_set_header X-Forwarded-For <span class=\"katex math inline\">proxy_add_x_forwarded_for;        proxy_set_header REMOTE-HOST<\/span>remote_addr; \n        proxy_set_header Upgrade $http_upgrade; \n        proxy_set_header Connection \"upgrade\"; \n        proxy_http_version 1.1; \n        add_header Cache-Control no-cache; \n        proxy_cache off;\n        proxy_buffering off;\n        chunked_transfer_encoding on;\n        tcp_nopush on;\n        tcp_nodelay on;\n        keepalive_timeout 300;\n<\/code><\/pre>\n<h3><a id=\"%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u8d1f\u8f7d\u5747\u8861<\/h3>\n<pre><code class=\"language-xml\">upstream freegpt35 {\n        server 1.1.1.1:3040;\n        server 2.2.2.2:3040;\n}\n \nlocation ^~ \/ {\n        proxy_pass http:\/\/freegpt35; \n        proxy_set_header Host <span class=\"katex math inline\">host;        proxy_set_header X-Real-IP<\/span>remote_addr; \n        proxy_set_header X-Forwarded-For <span class=\"katex math inline\">proxy_add_x_forwarded_for;        proxy_set_header REMOTE-HOST<\/span>remote_addr; \n        proxy_set_header Upgrade $http_upgrade; \n        proxy_set_header Connection \"upgrade\"; \n        proxy_http_version 1.1; \n        add_header Cache-Control no-cache; \n        proxy_cache off;\n        proxy_buffering off;\n        chunked_transfer_encoding on;\n        tcp_nopush on;\n        tcp_nodelay on;\n        keepalive_timeout 300;\n    }\n<\/code><\/pre>\n<h3><a id=\"%E8%AF%B7%E6%B1%82%E7%A4%BA%E4%BE%8B\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u8bf7\u6c42\u793a\u4f8b<\/h3>\n<p>\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4f7f\u7528 cURL \u53d1\u9001\u8bf7\u6c42\u7684\u793a\u4f8b\u3002<\/p>\n<pre><code class=\"language-cpp\">curl http:\/\/127.0.0.1:3040\/v1\/chat\/completions \\\n  -H \"Content-Type: application\/json\" \\\n  -H \"Authorization: Bearer any_string_you_like\" \\\n  -d '{\n    \"model\": \"gpt-3.5-turbo\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Hello!\"\n      }\n    ],\n    \"stream\": true\n    }'\n<\/code><\/pre>\n<h3><a id=\"%E5%85%BC%E5%AE%B9%E6%80%A7%E8%AF%B4%E6%98%8E\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u517c\u5bb9\u6027\u8bf4\u660e<\/h3>\n<p>\u53ef\u4ee5\u5728\u4efb\u4f55\u5e94\u7528\u4e2d\u4f7f\u7528\u5b83\uff0c\u5982 OpenCat\u3001Next-Chat\u3001Lobe-Chat\u3001Bob \u7b49\u7b49\u3002\u968f\u610f\u586b\u5199\u4e00\u4e2a\u4efb\u610f\u5b57\u7b26\u4e32\u7684 API \u5bc6\u94a5\uff0c\u4f8b\u5982 gptyyds\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FreeGPT35\u2014\u2014\u65e0\u9700\u767b\u5f55\u6ce8\u518c\uff0c\u5f00\u7bb1\u5373\u7528 \u7b80\u4ecb \u4ece\u4eca\u5e744\u67082\u65e5\u5f00\u59cb\uff0cGPT 3.5 \u5f00\u59cb\u63d0\u4f9b\u65e0\u9700\u6ce8\u518c\u3001\u65e0\u9700 [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[99],"tags":[],"class_list":["post-48508","post","type-post","status-publish","format-standard","hentry","category-javabase"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/48508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=48508"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/48508\/revisions"}],"predecessor-version":[{"id":48509,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/48508\/revisions\/48509"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=48508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=48508"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=48508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}