Spaces:
Sleeping
Sleeping
kevin
commited on
Commit
·
7336a39
1
Parent(s):
3b48286
ds2api
Browse files- .gitignore +1 -0
- Dockerfile +22 -0
- README.md +1 -0
- configs/dev/service.yml +6 -0
- configs/dev/system.yml +14 -0
- package.json +51 -0
- public/welcome.html +10 -0
- sha3_wasm_bg.7b9ca65ddd.wasm +3 -0
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.idea
|
Dockerfile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:lts AS BUILD_IMAGE
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
COPY . /app
|
| 6 |
+
|
| 7 |
+
RUN yarn install --registry https://registry.npmmirror.com/ && yarn run build
|
| 8 |
+
|
| 9 |
+
FROM node:lts-alpine
|
| 10 |
+
|
| 11 |
+
COPY --from=BUILD_IMAGE /app/configs /app/configs
|
| 12 |
+
COPY --from=BUILD_IMAGE /app/package.json /app/package.json
|
| 13 |
+
COPY --from=BUILD_IMAGE /app/dist /app/dist
|
| 14 |
+
COPY --from=BUILD_IMAGE /app/public /app/public
|
| 15 |
+
COPY --from=BUILD_IMAGE /app/*.wasm /app/
|
| 16 |
+
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules
|
| 17 |
+
|
| 18 |
+
WORKDIR /app
|
| 19 |
+
|
| 20 |
+
EXPOSE 8000
|
| 21 |
+
|
| 22 |
+
CMD ["npm", "start"]
|
README.md
CHANGED
|
@@ -5,6 +5,7 @@ colorFrom: red
|
|
| 5 |
colorTo: blue
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 5 |
colorTo: blue
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
+
app_port: 8000
|
| 9 |
---
|
| 10 |
|
| 11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
configs/dev/service.yml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 服务名称
|
| 2 |
+
name: deepseek-free-api
|
| 3 |
+
# 服务绑定主机地址
|
| 4 |
+
host: '0.0.0.0'
|
| 5 |
+
# 服务绑定端口
|
| 6 |
+
port: 8000
|
configs/dev/system.yml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 是否开启请求日志
|
| 2 |
+
requestLog: true
|
| 3 |
+
# 临时目录路径
|
| 4 |
+
tmpDir: ./tmp
|
| 5 |
+
# 日志目录路径
|
| 6 |
+
logDir: ./logs
|
| 7 |
+
# 日志写入间隔(毫秒)
|
| 8 |
+
logWriteInterval: 200
|
| 9 |
+
# 日志文件有效期(毫秒)
|
| 10 |
+
logFileExpires: 2626560000
|
| 11 |
+
# 公共目录路径
|
| 12 |
+
publicDir: ./public
|
| 13 |
+
# 临时文件有效期(毫秒)
|
| 14 |
+
tmpFileExpires: 86400000
|
package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "deepseek-free-api",
|
| 3 |
+
"version": "0.0.14",
|
| 4 |
+
"description": "DeepSeek Free API Server",
|
| 5 |
+
"type": "module",
|
| 6 |
+
"main": "dist/index.js",
|
| 7 |
+
"module": "dist/index.mjs",
|
| 8 |
+
"types": "dist/index.d.ts",
|
| 9 |
+
"directories": {
|
| 10 |
+
"dist": "dist"
|
| 11 |
+
},
|
| 12 |
+
"files": [
|
| 13 |
+
"dist/"
|
| 14 |
+
],
|
| 15 |
+
"scripts": {
|
| 16 |
+
"dev": "tsup src/index.ts --format cjs,esm --sourcemap --dts --publicDir public --watch --onSuccess \"node --enable-source-maps --no-node-snapshot dist/index.js\"",
|
| 17 |
+
"start": "node --enable-source-maps --no-node-snapshot dist/index.js",
|
| 18 |
+
"build": "tsup src/index.ts --format cjs,esm --sourcemap --dts --clean --publicDir public"
|
| 19 |
+
},
|
| 20 |
+
"author": "Vinlic",
|
| 21 |
+
"license": "ISC",
|
| 22 |
+
"dependencies": {
|
| 23 |
+
"@types/async-lock": "^1.4.2",
|
| 24 |
+
"async-lock": "^1.4.1",
|
| 25 |
+
"axios": "^1.6.7",
|
| 26 |
+
"colors": "^1.4.0",
|
| 27 |
+
"crc-32": "^1.2.2",
|
| 28 |
+
"cron": "^3.1.6",
|
| 29 |
+
"date-fns": "^3.3.1",
|
| 30 |
+
"eventsource-parser": "^1.1.2",
|
| 31 |
+
"fs-extra": "^11.2.0",
|
| 32 |
+
"koa": "^2.15.0",
|
| 33 |
+
"koa-body": "^5.0.0",
|
| 34 |
+
"koa-bodyparser": "^4.4.1",
|
| 35 |
+
"koa-range": "^0.3.0",
|
| 36 |
+
"koa-router": "^12.0.1",
|
| 37 |
+
"koa2-cors": "^2.0.6",
|
| 38 |
+
"lodash": "^4.17.21",
|
| 39 |
+
"mime": "^4.0.1",
|
| 40 |
+
"minimist": "^1.2.8",
|
| 41 |
+
"randomstring": "^1.3.0",
|
| 42 |
+
"uuid": "^9.0.1",
|
| 43 |
+
"yaml": "^2.3.4"
|
| 44 |
+
},
|
| 45 |
+
"devDependencies": {
|
| 46 |
+
"@types/lodash": "^4.17.13",
|
| 47 |
+
"@types/mime": "^3.0.4",
|
| 48 |
+
"tsup": "^8.0.2",
|
| 49 |
+
"typescript": "^5.3.3"
|
| 50 |
+
}
|
| 51 |
+
}
|
public/welcome.html
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html>
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="utf-8"/>
|
| 5 |
+
<title>🚀 服务已启动</title>
|
| 6 |
+
</head>
|
| 7 |
+
<body>
|
| 8 |
+
<p>deepseek-free-api已启动!<br>请通过LobeChat / NextChat / Dify等客户端或OpenAI SDK接入!</p>
|
| 9 |
+
</body>
|
| 10 |
+
</html>
|
sha3_wasm_bg.7b9ca65ddd.wasm
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b3fca8cc072c1defbd60c02266a8e48bd307a1804aaff4314900aea720e72f7d
|
| 3 |
+
size 26612
|