Spaces:
Running
Running
nacho commited on
Commit ·
0ecb6f3
1
Parent(s): 50d75a2
docs: 更新 README,移除旧版代理描述,更新为统一的 v4 模型名和最新架构
Browse files
README.md
CHANGED
|
@@ -36,19 +36,7 @@ pip install -r requirements.txt
|
|
| 36 |
|
| 37 |
## 使用
|
| 38 |
|
| 39 |
-
### 方式 1:
|
| 40 |
-
|
| 41 |
-
```bash
|
| 42 |
-
export DS2API_ACCOUNTS="email1@gmail.com:password1;email2@gmail.com:password2"
|
| 43 |
-
export DS2API_KEYS="sk-key1,sk-key2"
|
| 44 |
-
export DS2API_ADMIN_KEY="your-admin-key"
|
| 45 |
-
export DS2API_PORT="5001"
|
| 46 |
-
export DS2API_HEADLESS="true"
|
| 47 |
-
|
| 48 |
-
python main.py
|
| 49 |
-
```
|
| 50 |
-
|
| 51 |
-
### 方式 2: 直接运行
|
| 52 |
|
| 53 |
```bash
|
| 54 |
python run.py
|
|
@@ -57,7 +45,7 @@ python run.py
|
|
| 57 |
### 方式 3: 后台运行
|
| 58 |
|
| 59 |
```bash
|
| 60 |
-
nohup python
|
| 61 |
```
|
| 62 |
|
| 63 |
## Web 管理界面
|
|
@@ -77,7 +65,7 @@ curl http://localhost:5001/v1/chat/completions \
|
|
| 77 |
-H "Authorization: Bearer sk-test123456" \
|
| 78 |
-H "Content-Type: application/json" \
|
| 79 |
-d '{
|
| 80 |
-
"model": "deepseek-flash",
|
| 81 |
"messages": [{"role": "user", "content": "Hello!"}]
|
| 82 |
}'
|
| 83 |
```
|
|
@@ -89,7 +77,7 @@ curl http://localhost:5001/v1/chat/completions \
|
|
| 89 |
-H "Authorization: Bearer sk-test123456" \
|
| 90 |
-H "Content-Type: application/json" \
|
| 91 |
-d '{
|
| 92 |
-
"model": "deepseek-flash",
|
| 93 |
"messages": [{"role": "user", "content": "Hello!"}],
|
| 94 |
"stream": true
|
| 95 |
}'
|
|
@@ -106,7 +94,7 @@ client = OpenAI(
|
|
| 106 |
)
|
| 107 |
|
| 108 |
response = client.chat.completions.create(
|
| 109 |
-
model="deepseek-flash",
|
| 110 |
messages=[{"role": "user", "content": "Hello!"}]
|
| 111 |
)
|
| 112 |
print(response.choices[0].message.content)
|
|
@@ -116,8 +104,8 @@ print(response.choices[0].message.content)
|
|
| 116 |
|
| 117 |
| 模型 ID | 说明 |
|
| 118 |
|---------|------|
|
| 119 |
-
| deepseek-flash |
|
| 120 |
-
| deepseek-pro | 专家
|
| 121 |
|
| 122 |
## 健康检查
|
| 123 |
|
|
@@ -143,11 +131,10 @@ curl http://localhost:5001/admin/stats -H "admin-key: admin"
|
|
| 143 |
|
| 144 |
```
|
| 145 |
ds2api-browser/
|
| 146 |
-
├── main.py # FastAPI 服务器(
|
| 147 |
-
├── deepseek_browser.py # CloakBrowser 自动化核心
|
| 148 |
-
├── account_manager.py # 账号池
|
| 149 |
├── config.py # 配置管理
|
| 150 |
-
├── proxy.py # 多协议代理(Claude/Gemini/Ollama)
|
| 151 |
├── run.py # 启动入口
|
| 152 |
├── .env.example # 环境变量模板
|
| 153 |
├── requirements.txt # 依赖列表
|
|
|
|
| 36 |
|
| 37 |
## 使用
|
| 38 |
|
| 39 |
+
### 方式 1: 直接运行
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
```bash
|
| 42 |
python run.py
|
|
|
|
| 45 |
### 方式 3: 后台运行
|
| 46 |
|
| 47 |
```bash
|
| 48 |
+
nohup python run.py > /tmp/ds2api-browser.log 2>&1 &
|
| 49 |
```
|
| 50 |
|
| 51 |
## Web 管理界面
|
|
|
|
| 65 |
-H "Authorization: Bearer sk-test123456" \
|
| 66 |
-H "Content-Type: application/json" \
|
| 67 |
-d '{
|
| 68 |
+
"model": "deepseek-v4-flash",
|
| 69 |
"messages": [{"role": "user", "content": "Hello!"}]
|
| 70 |
}'
|
| 71 |
```
|
|
|
|
| 77 |
-H "Authorization: Bearer sk-test123456" \
|
| 78 |
-H "Content-Type: application/json" \
|
| 79 |
-d '{
|
| 80 |
+
"model": "deepseek-v4-flash",
|
| 81 |
"messages": [{"role": "user", "content": "Hello!"}],
|
| 82 |
"stream": true
|
| 83 |
}'
|
|
|
|
| 94 |
)
|
| 95 |
|
| 96 |
response = client.chat.completions.create(
|
| 97 |
+
model="deepseek-v4-flash",
|
| 98 |
messages=[{"role": "user", "content": "Hello!"}]
|
| 99 |
)
|
| 100 |
print(response.choices[0].message.content)
|
|
|
|
| 104 |
|
| 105 |
| 模型 ID | 说明 |
|
| 106 |
|---------|------|
|
| 107 |
+
| deepseek-v4-flash | 标准版(全局默认开启深度思考 R1) |
|
| 108 |
+
| deepseek-v4-pro | 专家版(全局默认开启深度思考 R1) |
|
| 109 |
|
| 110 |
## 健康检查
|
| 111 |
|
|
|
|
| 131 |
|
| 132 |
```
|
| 133 |
ds2api-browser/
|
| 134 |
+
├── main.py # FastAPI 服务器(API路由与核心拦截层)
|
| 135 |
+
├── deepseek_browser.py # Playwright/CloakBrowser 自动化爬虫核心
|
| 136 |
+
├── account_manager.py # 账号池调度与封禁规避
|
| 137 |
├── config.py # 配置管理
|
|
|
|
| 138 |
├── run.py # 启动入口
|
| 139 |
├── .env.example # 环境变量模板
|
| 140 |
├── requirements.txt # 依赖列表
|