feat(assistente): gateway do LLM e netpols (22/10/2026)

This commit is contained in:
deploy
2026-10-23 15:30:45 +00:00
parent 1e17a8e0cd
commit e368bee61f
2 changed files with 16 additions and 4 deletions
+14 -3
View File
@@ -13,6 +13,14 @@ metadata:
data:
default.conf: |
limit_req_zone $binary_remote_addr zone=llm:1m rate=30r/m;
# 23/10/2026: servidor de IA DEDICADO ("jarvis", tunel em 10.42.0.1:11437) como principal; o .16 (InfluxIA, tunel em
# 10.42.0.1:11436) fica de RESERVA e so recebe quando o principal falha (conexao recusada/tempo esgotado/5xx antes da
# primeira resposta). O modelo e o de embeddings precisam ter o MESMO nome nos dois (docs/assistente-ia-servidor-dedicado.md).
# Enquanto o tunel do jarvis nao existe, a porta 11437 recusa e tudo cai no .16: aplicar este arquivo antes e seguro.
upstream llm_ia {
server 10.42.0.1:11437 max_fails=2 fail_timeout=20s;
server 10.42.0.1:11436 backup;
}
server {
listen 8092;
client_max_body_size 64k;
@@ -21,10 +29,13 @@ data:
proxy_buffering off; # streaming (NDJSON) chega aos poucos
proxy_read_timeout 180s;
proxy_connect_timeout 3s;
proxy_next_upstream error timeout http_502 http_503 http_504;
proxy_next_upstream_tries 2;
proxy_next_upstream_timeout 8s;
location = /saude { access_log off; default_type text/plain; return 200 "ok"; }
location = /api/tags { limit_req zone=llm burst=10 nodelay; proxy_pass http://10.42.0.1:11436; }
location = /api/chat { limit_req zone=llm burst=10 nodelay; proxy_pass http://10.42.0.1:11436; }
location = /api/embed { limit_req zone=llm burst=10 nodelay; proxy_pass http://10.42.0.1:11436; }
location = /api/tags { limit_req zone=llm burst=10 nodelay; proxy_pass http://llm_ia; }
location = /api/chat { limit_req zone=llm burst=10 nodelay; proxy_pass http://llm_ia; }
location = /api/embed { limit_req zone=llm burst=10 nodelay; proxy_pass http://llm_ia; }
location / { return 404; } # nada de /api/pull, /api/delete, /api/generate, /api/create...
}
---
@@ -28,4 +28,5 @@ spec:
- to:
- ipBlock: { cidr: 10.42.0.1/32 }
ports:
- { protocol: TCP, port: 11436 }
- { protocol: TCP, port: 11436 } # .16 (reserva)
- { protocol: TCP, port: 11437 } # servidor dedicado "jarvis" (principal), 23/10/2026