Skip to content

subo93/huggingface-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat App

This is a simple chat application built with Express, Socket.io, and a local Ollama model.

Features

  • Real-time chat functionality using Socket.io
  • Integration with a local Ollama model to generate responses
  • Serves a React frontend

Prerequisites

  • Hardware Requirements:

    • Minimum 8 GB RAM
    • Minimum 2 GHz dual-core processor
    • 500 MB of free disk space
  • Software Requirements:

    • Node.js
    • npm
    • Ollama model installed and accessible via the command line
    • Built on Linux OS (Ubuntu)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-directory>
  2. Install the dependencies:

    npm install
  3. Build the React frontend:

    cd /home/subodhi/Desktop/Apps\ 2025/reactjsnew/chat-app
    npm install
    npm run build
    cd -
  4. Install Ollama:

    curl -fsSL https://ollama.com/install.sh | sh
  5. Verify Ollama installation:

    which ollama
    /usr/local/bin/ollama
  6. Check installed models:

    ls ~/.ollama/models
    # Expected output:
    # phi -> ~2.2 GB
    # mistral -> ~4–5 GB

Running the App

  1. Start the server:

    node src/server.js
  2. Open your browser and navigate to http://localhost:5000.

Usage

  • Open the chat application in your browser.
  • Enter a message in the chat input and press enter.
  • The message will be sent to the server, processed by the local Ollama model, and the response will be displayed in the chat.

Managing Ollama

  1. Run the Ollama model:

    ollama run phi
  2. Check if Ollama is already running:

    ps aux | grep ollama
  3. Restart Ollama:

    kill <pid>
    ollama serve

Troubleshooting

  • Ensure the Ollama model is installed and accessible via the command line.
  • Check the server logs for any errors related to the exec function.

License

This project is licensed under the MIT License.

About

A lightweight AI-powered chat app using Ollama local model model.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published