Skip to content
majicmajPublic

About

No description, website, or topics provided.

Resources

Stars

32 stars

Watchers

1 watching

Forks

Repository files navigation

Aloha

GitHub stars GitHub forks

Self-Hosted AI Chat Application

Aloha is a self-hosted chat application that connects to a local Ollama instance. It provides a modern chat interface similar to ChatGPT but runs entirely on your own infrastructure.


Preview

ALOHA


Setting Up Ollama

  1. Install Ollama on Ubuntu:

    curl -fsSL https://ollama.com/install.sh | sh
  2. Pull a model:

    For example, to pull Llama 3:

    ollama pull llama3
  3. Start the Ollama service:

    systemctl start ollama
  4. (Optional) Configure Ollama for Network Access:
    If running Ollama on a separate server, you need to configure it to allow network access. This requires setting the OLLAMA_HOST and OLLAMA_ORIGINS environment variables.

    Here's how to do it on Linux:

    a. Edit the systemd service file for Ollama:

    sudo systemctl edit ollama.service

    b. Add the following content to the file:

    [Service]
    Environment="OLLAMA_HOST=0.0.0.0"
    Environment="OLLAMA_ORIGINS=*"

    c. Reload the systemd daemon and restart Ollama:

    sudo systemctl daemon-reload
    sudo systemctl restart ollama

    For more details, refer to the Ollama FAQ.

    • By default, the Ollama API is available at:
      http://localhost:11434
      

Setting Up the Web Application

  1. Clone the repository:

    git clone <repo-url>
    cd <repo-name>
  2. Install dependencies:

    npm install
  3. Configure environment variables:

    Edit the .env file:

    vim .env

    Set the Ollama API URL (replace 192.168.x.x with the appropriate IP if running remotely):

    VITE_URL=http://192.168.x.x:11434
  4. Start the development server:

    npm run dev
  5. Build for production:

    npm run build

Updating the Model List

The application's model selection list is generated from the official Ollama library. To keep this list current, you can run the following command:

npm run update-models

This script fetches the latest models and updates src/constants/models.ts automatically.


Configuration

By default, the application connects to Ollama at:

http://localhost:11434

To change this, update OLLAMA_API_URL in:

src/lib/api.ts

Security Considerations

  • Do not expose the Ollama API directly to the internet.
  • Use a reverse proxy with proper security headers if external access is needed.
  • Implement authentication for the web application if hosting publicly.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

32 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages