不要pin太多
移動到其他資料夾即不吃處理的效率
model不要放太多
提升
5s–>1s
但最後還是2s
因為用了gemini的一個pipe
再找到方法搞定gemini的imagen與 -search之前得忍受這個+1s了
移動到其他資料夾即不吃處理的效率
提升
5s–>1s
但最後還是2s
因為用了gemini的一個pipe
再找到方法搞定gemini的imagen與 -search之前得忍受這個+1s了
谁看明白楼主说什么了 麻烦给我解释一下
感谢分享ww
应该是api/model加载的东西不能太多,gemini的图片想办法搞定。其他的没看懂,就当作克鲁苏的呓语
open webui 的model list别放太多model了?
回答速度从5s优化到1s,但是因为function call导致又变成2s了?
你是不是用某個佬的hugging face去代理gemini
第二部分整理的不錯
但主要是第一部分
釘選對話的加載耗時是4s
都請出去後變為1.4s左右
感谢教程!
只要把/models缓存了,速度就会大幅提升
怎麼操作阿
你用的抱抱脸还是服务器
服務器 是在nginx設定嗎 還是cf
nginx 設定就行了
user www www;
worker_processes auto;
worker_rlimit_nofile 51200;
error_log /path/to/logs/nginx_error.log crit;
pid /path/to/nginx.pid;
events {
use epoll;
worker_connections 51200;
multi_accept on;
}
http {
include mime.types;
default_type application/octet-stream;
client_max_body_size 1024m;
# 日志格式定义
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log off;
# 性能优化设置
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# Gzip 压缩配置
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# 代理缓存配置
proxy_cache_path /path/to/cache
levels=1:2
keys_zone=nginx_cache:1m
max_size=100m
inactive=24h
use_temp_path=off;
# OpenWebUI 服务代理配置
server {
listen 80;
server_name chat.example.com;
client_max_body_size 1024m; # 支持大文件上传
# 主代理设置,连接到 OpenWebUI 后端
location / {
proxy_pass http://127.0.0.1:3000/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
# WebSocket 支持
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
# WebSocket 超时设置
proxy_read_timeout 60s;
proxy_send_timeout 60s;
# 可选:增加缓冲区大小
proxy_buffer_size 128k;
proxy_buffers 4 256k;
}
# 静态资源处理
location ~* \.(css|js|jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot)(.*) {
proxy_pass http://127.0.0.1:3333;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 禁用浏览器缓存
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
add_header Expires "0";
}
# 模型接口缓存(动态内容)
location /api/models {
proxy_cache nginx_cache;
proxy_cache_key $request_uri;
proxy_cache_valid 200 1m; # 设置 1 分钟缓存,避免过于频繁刷新
proxy_cache_background_update on;
proxy_cache_use_stale updating;
proxy_cache_revalidate on;
proxy_cache_min_uses 1;
proxy_pass http://127.0.0.1:3333;
add_header X-Cache-Status $upstream_cache_status;
}
# 版本检查 API,不缓存
location /api/check_version {
proxy_pass http://127.0.0.1:3333;
proxy_no_cache 1
多謝 回頭嘗試一下
那佬友知道有圖片的對話打開時間如何優化嗎
目前有想過對nginx動手腳
此外還能把圖片放置到圖床
图片不用怎么处理吧,不会有太多图片,openwebui存的图片应该是压缩过的了
谢谢分享 .
好吧,這個問題等之後本機部署再來確認
剛剛研究了下佬友的nginx
在緩存model接口的時候 不是應該要配置登入後的訊息嗎,不然nginx怎麼去訪問到model有哪些
proxy_pass http://127.0.0.1:3000/;
location /api/models {