redis缓存替换+pgvector向量替换

This commit is contained in:
1iaan
2026-04-04 22:39:16 +08:00
parent e993eb6c5c
commit 9d7c416737
124 changed files with 5460 additions and 141 deletions

View File

@@ -33,6 +33,9 @@ docker run -d --name chatgpt-web-backend \
--openai-presence-penalty 0 \
--openai-frequency-penalty 0
# ai-chat-backend
docker build -t ai-chat-backend:1.0.0 .
# chatgpt-web-frontend
HUSKY=0 pnpm bootstrap
pnpm dev
@@ -44,43 +47,4 @@ docker build -t tokenizer:1.0.0 .
# keywords-filter
docker build -t keywords-filter:1.0.0 .
```
## backend
访问 tokenizer
```go
url := fmt.Sprintf("http://127.0.0.1:5000/tokenizer/%s", model)
// 改成
tokenizerBaseURL := os.Getenv("TOKENIZER_BASE_URL")
if tokenizerBaseURL == "" {
tokenizerBaseURL = "http://tokenizer:3002"
}
url := fmt.Sprintf("%s/tokenizer/%s", tokenizerBaseURL, model)
// 直接访问 tokenizer
```
## frontend
访问 backend
```conf
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://chatgpt-web-backend:7080/api/;
}
}
```