Skip to content

Commit a9cefb2

Browse files
committed
Document run/usage: start.sh and start_all.sh foreground behavior
1 parent 42ae3e5 commit a9cefb2

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,40 @@ Use /web/start.sh or /web/start.cmd to start engine!
7878
9. 打开防火墙
7979
10. 修改绝对路径
8080

81+
## 运行(Run / Usage)
82+
83+
本项目提供两种方便的启动脚本:`web/start.sh`(可单独启动后端或 ollama)和仓库根的 `start_all.sh`(便捷包装,默认调用 `web/start.sh --all --foreground`)。
84+
85+
重要变更:`start_all.sh` 默认现在会以前台模式运行(等同于传入 `--foreground``web/start.sh`),以便在当前终端持续输出后端或 Ollama 的实时日志。
86+
87+
主要用法示例:
88+
89+
- 在项目根直接启动(默认前台,显示日志):
90+
```bash
91+
cd /path/to/lightLLM
92+
./start_all.sh
93+
# 等价于: ./web/start.sh --all --foreground
94+
```
95+
96+
- 只启动后端并保持前台(显示 uvicorn 日志):
97+
```bash
98+
cd web
99+
./start.sh --backend --foreground
100+
# 或简写:./start.sh --backend --fg
101+
```
102+
103+
- 后台启动(将日志写入 logs/xxxx.log 文件):
104+
```bash
105+
# 后台运行后端,日志写入 logs/web_uvicorn.log
106+
cd web
107+
./start.sh --backend
108+
```
109+
110+
注意事项:
111+
- 如果希望同时观察后端与 Ollama 的日志,建议在两个不同终端分别运行:
112+
- `./start.sh --backend --foreground`(观察后端)
113+
- `./start.sh --ollama --foreground`(观察 Ollama)
114+
- `start_all.sh` 在前台模式下会使用 `exec` 启动 `start.sh`,因此不会返回到 `start_all.sh` 中后续的等待/自动打开浏览器逻辑;这是有意行为以便终端持续显示日志。
115+
- 若你更想保持原来非阻塞行为,请直接使用 `web/start.sh --backend``web/start.sh --all`(不加 `--foreground`)。
116+
81117
(结束)

0 commit comments

Comments
 (0)