Harden LLM access: secrets only in server .env, no URL in repo.
Require LLM_BASE_URL and LLM_API_KEY for automatic generation, add per-user rate limits, stop publishing backend/LLM settings in docker-compose, and document secure deployment.
This commit is contained in:
@@ -17,6 +17,9 @@ class LLMClient:
|
||||
return f"{base}/api/chat"
|
||||
|
||||
async def generate(self, prompt: str) -> str:
|
||||
if not self.settings.llm_ready:
|
||||
raise LLMUnavailableError("Automatic AI generation is not available")
|
||||
|
||||
payload = {
|
||||
"model": self.settings.llm_model,
|
||||
"messages": [
|
||||
|
||||
Reference in New Issue
Block a user