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: Enable 100% HF Space capability with dynamic environment variables
Nikhil Pravin Pise- Add env helper functions for both naming conventions (simple and nested) - Support all embeddings providers: Jina, Google, HuggingFace - Enable Langfuse observability configuration - Make LLM models configurable via environment - Remove hardcoded values - everything is now dynamic - Update HF README with complete secrets reference - Add .env.huggingface template with all options - Update deployment guide with secrets configuration - Enhance startup logging to show all enabled features - Tests passing: 4/4 llm_config, 3/3 settingsd495234 -
Fix: Dynamic API key loading - secrets now work properly on HuggingFace Spaces
Nikhil Pravin Pise150e705 -
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 -
Refactor: Improve code quality, security, and configuration
Nikhil Pravin Pise- Remove redundant sys.path manipulation in agents and services - Enhance CORS configuration with environment-based origin handling - Improve error handling (no internal detail leakage) - Fix environment variable handling in setup scripts (remove extra quotes) - Update gitignore for external tools and course materials - Correct clinical biomarker reference ranges - Add comprehensive production upgrade plan - Improve test configuration (HuggingFace deprecation filters) - Add optional dependencies for evaluation tools - Consolidate path initialization patternsad2e847 -
docs: update all documentation to reflect current codebase state
Nikhil Pravin Pise- Update README.md: correct test count (83 -> 30), fix test commands - Rewrite START_HERE.md as proper onboarding guide - Update QUICKSTART.md and CONTRIBUTING.md test commands - Update api/ docs: Groq/Gemini as default providers (not Ollama) - Update api/ARCHITECTURE.md: multi-provider LLM diagram - Update api/GETTING_STARTED.md: Groq/Gemini prerequisites - Update api/QUICK_REFERENCE.md: fix troubleshooting, commands - Update docs/DEVELOPMENT.md: fix code examples, test commands - Update docs/DEEP_REVIEW.md: add RESOLVED/OPEN status to all findings - Update scripts/README.md: use .venv python paths - Archive stale root-level docs to docs/archive/ - All 30 tests passingaefac4f
-
refactor: major repository cleanup and bug fixes
Nikhil Pravin PiseCleanup & Organization: - Removed clutter: deleted archive/ and setup.py - Reorganized scripts: moved PowerShell startup scripts to scripts/ - Created examples/ folder with HTML/JS integration examples - Consolidated docs: archived 13 old implementation notes to docs/archive/ - Rewrote root README.md for clarity and professional appearance Core Bug Fixes: - Fixed Google Gemini embedding API 404 error by switching to HuggingFace local embeddings - Upgraded torch/torchvision to resolve PyTorch compatibility issues - Fixed HuggingFaceEmbeddings import and configuration in pdf_processor.py - Successfully rebuilt FAISS vector store with compatible embeddings (2,609 chunks) Documentation: - Created docs/ARCHITECTURE.md: system design, components, data flow - Created docs/API.md: complete REST API reference with examples - Created docs/DEVELOPMENT.md: extension guide for developers - Created scripts/README.md: utility scripts reference - Created examples/README.md: integration patterns for …6dc9d46