llmpt 1.1.8 → 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.
Files changed (2) hide show
  1. package/README.md +4 -32
  2. package/package.json +1 -1
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
- 启动后编辑当前目录的 `lpt.config.yaml`:
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", # 代理会替换为配置文件中的真实 key
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
- | 配置 | js-yaml |
89
+ | 配置 | dotenv (.env) |
118
90
  | 加密 | Node.js crypto(AES-256-GCM) |
119
91
 
120
92
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llmpt",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "LLM Proxy Trace - local LLM proxy that captures full traces with real-time Web dashboard",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",