med-chat Svelte Themes

Med Chat

A ollama based local medical chat app.

Med-Chat Assistant

A medical chat assistant built with SvelteKit and powered by Ollama's local AI models. This application provides an interactive chat interface for medical inquiries using the MedGemma model.

Features

  • Interactive Chat Interface: Clean, responsive UI built with SvelteKit and Tailwind CSS
  • Local AI Processing: Uses Ollama for running AI models locally, ensuring privacy
  • Medical Expertise: Powered by the MedGemma-4B model for medical knowledge
  • Markdown Support: Responses are rendered with markdown formatting
  • Real-time Messaging: Instant responses with loading indicators

Prerequisites

Before running this application, ensure you have the following installed:

  • Node.js (version 18 or higher)
  • Ollama installed and running
  • The MedGemma model pulled: hf.co/lmstudio-community/medgemma-4b-it-GGUF:Q4_K_M

Installing Ollama and the Model

  1. Download and install Ollama from ollama.ai
  2. Pull the required model:
    ollama pull hf.co/lmstudio-community/medgemma-4b-it-GGUF:Q4_K_M
    

Installation

  1. Clone this repository:

    git clone <repository-url>
    cd med-chat
    
  2. Install dependencies:

    npm install
    

Development

Start the development server:

npm run dev

The application will be available at http://localhost:5173.

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run check - Type checking and SvelteKit sync
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier

Usage

  1. Ensure Ollama is running with the MedGemma model loaded
  2. Start the development server
  3. Open your browser to the application URL
  4. Start chatting with the medical assistant

The assistant can help with:

  • General medical questions
  • Symptom analysis
  • Health information
  • Medical advice (always consult professionals for serious concerns)

Architecture

  • Frontend: SvelteKit with TypeScript and Tailwind CSS
  • Backend: SvelteKit API routes
  • AI Engine: Ollama with MedGemma model
  • Styling: Tailwind CSS with custom gradients and shadows

Project Structure

src/
├── app.css          # Global styles
├── app.d.ts         # TypeScript declarations
├── app.html         # Main HTML template
├── lib/
│   └── index.ts     # Utility functions
└── routes/
    ├── +layout.svelte   # App layout
    ├── +page.svelte     # Main chat page
    └── api/
        └── chat/
            └── +server.ts   # Chat API endpoint

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting
  5. Submit a pull request

Disclaimer

This application is for informational purposes only and should not replace professional medical advice, diagnosis, or treatment. Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition.

License

This project is private and not licensed for public use.

Top categories

Loading Svelte Themes