```mermaid graph TD A[Client] -->|HTTP/WebSocket| B[FastAPI Server] B -->|Authentication| C[Auth Module] B -->|Text Generation| D[Generation Module] B -->|Rate Limiting| E[Rate Limiter] B -->|Logging| F[Logging Middleware] C -->|JWT Token| G[Secrets Manager] D -->|Model Inference| H[Hugging Face Model] E -->|Rate Limit Check| I[Redis/Database] F -->|Logs| J[Log Storage] H -->|Streaming| A subgraph FastAPI Server B C D E F end subgraph External Services G[Secrets Manager] H[Hugging Face Model] I[Redis/Database] J[Log Storage] end ```