Skip to content

medvoice-app/MedVoice-Core

Repository files navigation

MedVoice Core System

This is the backend for the MedVoice project, which includes the ML pipeline for Whisper-Diarization, Llama3 models, and others LLMs.

What is MedVoice?

MedVoice is a Mobile Application that supports coverting Speech to Medical Documentation format in real-time!

Before you start

  1. This README assumes that your machine is Debian-based. Please find the equivalent commands if you are running on a Windows machine or other OS.
  2. This README assumes that your machine has enough GPU resources to run nomic-embed-text Ollama model. Please find the equivalent GPU Cloud Instance if your local does not have enough resources.
  3. Make sure that you have turn off your VPN.

Build Instructions

To build the project locally, follow the steps below:

Prerequisites

Ensure the following dependencies are installed on your machine:

  • Python 3
  • Docker
  • Docker Compose
  • For remote access: using ngrok command
  • make command
  • Optional for Debian-based GPU: make nvidia

Steps to Set Up

  1. Clone the repository to your local machine:

    git clone https://github.com/MedVoice-RMIT-CapStone-2024/MedVoice-FastAPI.git
    cd MedVoice-FastAPI
  2. Install make command (if not already installed):

  3. Check for missing dependencies and configuration files:

    make check

    Resolve any missing dependencies or files as indicated in the output with Step 4

  4. For Debian-based OS, set up the Python virtual environment and install dependencies:

    make venv-all
  5. Choose your deployment mode:

    a. For local development:

    • In app/core/app_config.py, ensure ON_LOCALHOST is set to 1:
      ON_LOCALHOST = 1

    b. For remote access (using ngrok):

    • In app/core/app_config.py, ensure ON_LOCALHOST is set to 0:
      ON_LOCALHOST = 0
    • Before running the command below, ensure you have a .env file in the root directory with the following variables:
      NGROK_AUTH_TOKEN=your-auth-token
      NGROK_API_KEY=your-api-key (not API ID)
      NGROK_EDGE=your-edge-label
      NGROK_TUNNEL=your-tunnel-name
    • Run the following command:
      make ngrok
  6. Run the project with docker compose

  • If you are using a GPU/CPU, run the following command:
    # For GPU
    make GPU=true up
    # For CPU
    make GPU=false up
  1. [Optional] Additional utility options:
  • Export dependencies from poetry.lock to requirements.txt:
    • poe export
  • Import dependencies from requirements.txt to poetry.lock:
    • poe import

Obtaining the Replicate API Key

To use the Replicate API, follow these steps:

  1. Visit the Replicate website at https://www.replicate.ai and #.
  2. Generate a new API key in your account settings.
  3. Add the API key to the .env file:
    REPLICATE_API_KEY=<YOUR_API_KEY>

Setup your google-credentials.json file

See docs/how-to-setup guide for reference

Configuring ngrok

Run the following command to verify your ngrok configuration file:

ngrok config check

Use the make ngrok command to generate the configuration file automatically.

For more details on ngrok configuration, see the Ngrok Documentation.

License

This project is licensed under the GNU GENERAL PL License.

Reference