Coder Social home page Coder Social logo

polly3223 / aichat Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 1.78 MB

A simple UI to interact with various llm backends: openai, groq, fireworksai and togheterai

Home Page: https://www.lorenzodalmazzo.com/blog/AiChat

HTML 2.78% TypeScript 42.64% Svelte 44.92% JavaScript 2.54% CSS 7.12%

aichat's Introduction

Ai Chat

A simple UI to interact with various llm backends: openai, groq, fireworksai and togheterai

AiChatCover.jpg

What is AiChat?

AiChat is an open-source chat interface designed to easily test multiple LLMs from the same web app. This tool is particularly useful for developers and researchers who want to compare different language models' outputs in a single, cohesive interface.

Features

  • Supports multiple LLM backends: OpenAI, Groq, FireworksAI, and TogetherAI.
  • Chats are automatically saved in the MongoDB database.
  • Code snippets generated by the AI are automatically syntax-highlighted based on the detected language.
  • User-friendly web interface built with SvelteKit.

Technology Stack

  • Frontend: SvelteKit
  • Backend: Node.js
  • Database: MongoDB

Screenshots

Authentication Page

Authentication Page

Chat UI

Chat UI

Chat History

Chat History

Getting Started

Follow these steps to set up and run AiChat on your local machine.

Prerequisites

  1. Node.js and npm (or pnpm)
  2. MongoDB server (You can use MongoDB Atlas for a free hosted MongoDB instance)

Installation

  1. Clone the repository:

    git clone https://github.com/polly3223/AiChat
    cd AiChat
  2. Create a .env file at the root of the project with the following structure:

    SECRET_MONGO_CONNECTION=mongodb+srvXXXXXXXXXXX
    SECRET_PSW=XXXXXXXXXXX
    
    SECRET_TOGHETERAI_API_KEY=XXXXXXXXXXX
    SECRET_GROQ_API_KEY=XXXXXXXXXXX
    SECRET_FIREWORKS_API_KEY=XXXXXXXXXXX
    SECRET_OPENAI_API_KEY=XXXXXXXXXXX
    

    The MongoDB connection string, a password, and at least one API token from one of the AI service providers are required.

  3. Set up the AI client: Based on the API service you want to use, go to the file aiAdapter.ts and uncomment its relative line:

    // export const aiClient: AiClient = new GroqClient();
    // export const aiClient: AiClient = new ToghetherAiClient();
    // export const aiClient: AiClient = new FireworksAiClient();
    export const aiClient: AiClient = new OpenAiClient();
  4. Install the dependencies:

    pnpm install
  5. Run the project:

    pnpm dev

Deployment

Deploy on Railway

  1. Fork the repository: This allows you to make changes easily.
  2. Login to Railway and select the forked repository from your GitHub:
  3. Insert the environment variables from the Railway UI and run the automatic build:

You can also choose to deploy the project on your own VPS following similar steps by configuring your server and setting the environment variables.

Contributing

Contributions are welcome! If you have any ideas or improvements, feel free to open a pull request or raise an issue.

Future Plans

There is no clear roadmap as of now. We welcome ideas and suggestions from the community to help shape the future of AiChat.

License

This project is licensed under the MIT License.

aichat's People

Contributors

polly3223 avatar

Stargazers

Gary Blankenship avatar  avatar William Trabazo avatar  avatar xiong avatar Vince Fulco--Bighire.tools avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.