Medical-Chatbot-API / README.md
khalednabawi11's picture
Update README.md
283f830 verified
metadata
title: Medical Chatbot API
emoji: πŸ₯
colorFrom: blue
colorTo: green
sdk: docker
sdk_version: '1.0'
app_file: app/main.py
pinned: false

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Medical Chatbot API

A FastAPI-based medical chatbot API powered by LangChain and custom models.

Configuration

Environment Variables

Create a .env file with the following variables:

QDRANT_URL=your_qdrant_url
QDRANT_API_KEY=your_qdrant_api_key
HF_TOKEN=your_huggingface_token

Model Configuration

The application expects the following model structure:

models/
    β”œβ”€β”€ embeddings/
    └── llm/

Dependencies

Key dependencies include:

  • LangChain ecosystem
  • Qdrant for vector storage
  • Unsloth for optimized model loading
  • FastAPI for the web framework

Development Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the development server:
uvicorn app.main:app --reload --host 0.0.0.0 --port 7860

Docker Deployment

Build and run with Docker:

docker build -t medical-chatbot .
docker run -p 7860:7860 --env-file .env medical-chatbot

API Endpoints

  • GET /health: Health check endpoint
  • POST /chat: Chat endpoint
    {
      "question": "What are the symptoms of diabetes?",
      "context": "Optional medical context"
    }
    

Production Deployment

For Hugging Face Spaces:

  1. Set repository secrets in Space settings
  2. Deploy using the provided Dockerfile
  3. Ensure model weights are properly configured