Spaces:
Runtime error
Runtime error
Commit History
-
Production Upgrade v2.0: SSE streaming, HIPAA compliance, Gradio Q&A UI
Nikhil Pravin Pise## Features Added - SSE streaming endpoint (/ask/stream) for real-time responses - HIPAA-compliant audit middleware with PHI redaction - Security headers middleware (CSP, X-Frame-Options) - Medical Q&A chat interface in Gradio HF app - PostgreSQL and FAISS health checks - Comprehensive medical safety test suite (19 tests) ## Files Modified - src/routers/ask.py: Added SSE streaming with AsyncGenerator - src/routers/health.py: PostgreSQL + FAISS health probes - src/main.py: Integrated HIPAA/security middlewares - huggingface/app.py: Added streaming Q&A section ## Files Added - src/middlewares.py: HIPAAAuditMiddleware, SecurityHeadersMiddleware - tests/test_medical_safety.py: Critical biomarker, guardrail, citation tests ## Test Results - 129 tests passing, 6 skipped - All production features validated3ca1d38
-
feat: production upgrade — agentic RAG, OpenSearch, Redis, Langfuse, Docker, Gradio, Telegram
Nikhil Pravin PisePhase 1: Project structure & dev tooling - pyproject.toml with Ruff/MyPy/pytest config and optional deps - Makefile with dev/test/docker/lint targets - Multi-stage Dockerfile + docker-compose.yml (12 services) - .env.example, .pre-commit-config.yaml Phase 2: Core infrastructure - src/settings.py: hierarchical Pydantic Settings (env-driven) - src/exceptions.py: domain exception hierarchy (15+ classes) - src/database.py: SQLAlchemy engine/session factory - src/models/analysis.py: ORM models (PatientAnalysis, MedicalDocument, SOPVersion) - src/repositories/: data access layer Phase 3: Production services - OpenSearch client with BM25, KNN vector, and hybrid RRF search - Medical synonym analyzer + KNN index mapping (1024d, HNSW) - Multi-provider embedding service (Jina/Google/HuggingFace) with fallback - Redis cache with graceful degradation (NullCache) - Langfuse v3 observability tracer (NullSpan for no-ops) - Ollama REST client with streaming + LangChain integration - Medical-aware tex…1e732dd