llmpt 1.1.7 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +6 -6
- package/README.md +4 -32
- package/package.json +1 -1
package/.env.example
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# LPT 提供商配置 -
|
|
1
|
+
# LPT 提供商配置 - 填入真实值后保存,重启服务生效
|
|
2
2
|
|
|
3
3
|
# OpenAI / 兼容接口
|
|
4
|
-
OPENAI_BASE_URL=https://api.openai.com/v1
|
|
5
|
-
OPENAI_API_KEY=sk-...
|
|
4
|
+
# OPENAI_BASE_URL=https://api.openai.com/v1
|
|
5
|
+
# OPENAI_API_KEY=sk-...
|
|
6
6
|
|
|
7
7
|
# Anthropic
|
|
8
|
-
ANTHROPIC_BASE_URL=https://api.anthropic.com
|
|
9
|
-
ANTHROPIC_API_KEY=sk-ant-...
|
|
8
|
+
# ANTHROPIC_BASE_URL=https://api.anthropic.com
|
|
9
|
+
# ANTHROPIC_API_KEY=sk-ant-...
|
|
10
10
|
|
|
11
11
|
# Ollama 本地(无需 apiKey)
|
|
12
|
-
OLLAMA_BASE_URL=http://localhost:11434
|
|
12
|
+
# OLLAMA_BASE_URL=http://localhost:11434
|
package/README.md
CHANGED
|
@@ -31,8 +31,6 @@
|
|
|
31
31
|
npx llmpt
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
首次运行会在当前目录自动生成 `lpt.config.yaml`,服务同时启动。编辑配置文件填入 API Key 后,Ctrl+C 重启即可生效。
|
|
35
|
-
|
|
36
34
|
### 方式二:全局安装
|
|
37
35
|
|
|
38
36
|
```bash
|
|
@@ -40,41 +38,15 @@ npm install -g llmpt
|
|
|
40
38
|
llmpt
|
|
41
39
|
```
|
|
42
40
|
|
|
43
|
-
### 方式三:从源码运行
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
git clone https://github.com/zhxsking/llm_proxy_trace.git
|
|
47
|
-
cd llm_proxy_trace
|
|
48
|
-
npm install
|
|
49
|
-
npm run build
|
|
50
|
-
npm start
|
|
51
|
-
```
|
|
52
|
-
|
|
53
41
|
启动后浏览器打开 `http://localhost:19900`。
|
|
54
42
|
|
|
55
43
|
---
|
|
56
44
|
|
|
57
45
|
## 配置
|
|
58
46
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
```yaml
|
|
62
|
-
proxy:
|
|
63
|
-
port: 19900 # 代理端口
|
|
64
|
-
|
|
65
|
-
providers:
|
|
66
|
-
openai:
|
|
67
|
-
apiKey: "sk-..." # OpenAI API Key
|
|
68
|
-
baseUrl: "https://api.openai.com"
|
|
69
|
-
|
|
70
|
-
anthropic:
|
|
71
|
-
apiKey: "sk-ant-..." # Anthropic API Key
|
|
72
|
-
|
|
73
|
-
ollama:
|
|
74
|
-
baseUrl: "http://localhost:11434"
|
|
75
|
-
```
|
|
47
|
+
首次运行会在系统配置目录自动生成 `.env`,并打印出文件路径。编辑该文件填入 `BASE_URL` 和 `API Key` 后,重启服务即可生效。
|
|
76
48
|
|
|
77
|
-
|
|
49
|
+
如果当前目录存在 `.env`,会优先使用当前目录的配置,修改后重启服务生效。
|
|
78
50
|
|
|
79
51
|
---
|
|
80
52
|
|
|
@@ -87,7 +59,7 @@ providers:
|
|
|
87
59
|
from openai import OpenAI
|
|
88
60
|
client = OpenAI(
|
|
89
61
|
base_url="http://localhost:19900/v1",
|
|
90
|
-
api_key="any", #
|
|
62
|
+
api_key="any", # 代理会替换为 .env 中的真实 key
|
|
91
63
|
)
|
|
92
64
|
```
|
|
93
65
|
|
|
@@ -114,7 +86,7 @@ ANTHROPIC_BASE_URL=http://localhost:19900
|
|
|
114
86
|
| 字体 | 系统默认字体栈 |
|
|
115
87
|
| 实时通信 | WebSocket (`ws`) |
|
|
116
88
|
| Markdown | react-markdown + remark-gfm + highlight.js |
|
|
117
|
-
| 配置 |
|
|
89
|
+
| 配置 | dotenv (.env) |
|
|
118
90
|
| 加密 | Node.js crypto(AES-256-GCM) |
|
|
119
91
|
|
|
120
92
|
---
|