Replies: 4 comments
-
|
This project is EOL, see #3558 (comment) |
Beta Was this translation helpful? Give feedback.
-
|
Great initiative on production hardening! Here's what we've learned deploying local LLMs: Authentication: # API key middleware
from functools import wraps
def require_api_key(f):
@wraps(f)
def decorated(*args, **kwargs):
key = request.headers.get("X-API-Key")
if not key or key not in VALID_KEYS:
return {"error": "Invalid API key"}, 401
return f(*args, **kwargs)
return decoratedSafe defaults checklist:
Network security: # nginx config for GPT4All API
location /v1/ {
limit_req zone=api burst=10;
proxy_pass http://localhost:4891;
proxy_read_timeout 120s;
}Docs improvements:
We've deployed GPT4All in air-gapped environments at RevolutionAI. Happy to contribute to hardening docs! What's the current auth situation in the API server? |
Beta Was this translation helpful? Give feedback.
-
|
Excellent checklist. The bind-to-localhost default is critical — too many LLM deployments are exposed because 0.0.0.0 was convenient for development. Additional hardening suggestions:
Deployment pattern we use: We deploy hardened local LLM setups at Revolution AI — security defaults save everyone from footguns. |
Beta Was this translation helpful? Give feedback.
-
|
Excellent security checklist! Self-hosted LLM security is critically underaddressed. Additional recommendations: 1. API key rotation security:
api_keys:
rotation_days: 90
allow_multiple: true
audit_usage: true2. Request validation # Sanitize inputs
MAX_PROMPT_LENGTH = 32000
MAX_TOKENS = 4096
BLOCKED_PATTERNS = ["ignore previous", "system prompt"]3. Output filtering # Post-generation guardrails
if contains_pii(response):
response = redact_pii(response)4. Resource limits limits:
max_concurrent_requests: 10
max_tokens_per_minute: 100000
max_context_window: 81925. Audit logging {
"timestamp": "...",
"user_id": "...",
"prompt_hash": "...",
"tokens_used": 1500,
"model": "mistral-7b"
}6. Network isolation # Docker network isolation
docker network create --internal llm-internal7. Model integrity # Verify model checksums
sha256sum models/*.gguf | diff - checksums.txtWe harden LLM deployments at Revolution AI — this checklist should be in every self-hosted LLM docs. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We’re sharing a platform-agnostic hardening checklist distilled from a cross-platform study of self-hosted LLM deployments. The high-level takeaway: many exposed assets are accessible, and a large fraction of those allow unauthenticated interactions when misconfigured—so defaults and docs matter a lot.
Suggested checklist
0.0.0.0.We can provide platform-specific notes privately via security contacts if maintainers want to pursue targeted improvements.
Beta Was this translation helpful? Give feedback.
All reactions