npm package: @kozmoai/kozmo
Description: <!-- markdownlint-disable MD030 -->
Latest version: 1.6.5

<!-- markdownlint-disable MD030 -->

<img width="100%" src="https://github.com/kozmoai/kozmo/blob/main/images/kozmo.png?raw=true"></a>

# kozmo - Build LLM Apps Easily

[![Release Notes](https://img.shields.io/github/release/kozmoai/kozmo)](https://github.com/kozmoai/kozmo/releases)
[![Discord](https://img.shields.io/discord/1087698854775881778?label=Discord&logo=discord)](https://discord.gg/jbaHfsRVBW)
[![Twitter Follow](https://img.shields.io/twitter/follow/kozmoai?style=social)](https://twitter.com/kozmoai)
[![GitHub star chart](https://img.shields.io/github/stars/kozmoai/kozmo?style=social)](https://star-history.com/#kozmoai/kozmo)
[![GitHub fork](https://img.shields.io/github/forks/kozmoai/kozmo?style=social)](https://github.com/kozmoai/kozmo/fork)

<h3>Drag & drop UI to build your customized LLM flow</h3>
<a href="https://github.com/kozmoai/kozmo">
<img width="100%" src="https://github.com/kozmoai/kozmo/blob/main/images/kozmo.gif?raw=true"></a>

## ⚡Quick Start

Download and Install [NodeJS](https://nodejs.org/en/download) >= 18.15.0

1. Install kozmo
    ```bash
    npm install -g kozmo
    ```
2. Start kozmo

    ```bash
    npx kozmo start
    ```

    With username & password

    ```bash
    npx kozmo start --KOZMO_USERNAME=user --KOZMO_PASSWORD=1234
    ```

3. Open [http://localhost:3000](http://localhost:3000)

## 🐳 Docker

### Docker Compose

1. Go to `docker` folder at the root of the project
2. Copy `.env.example` file, paste it into the same location, and rename to `.env`
3. `docker-compose up -d`
4. Open [http://localhost:3000](http://localhost:3000)
5. You can bring the containers down by `docker-compose stop`

### Docker Image

1. Build the image locally:
    ```bash
    docker build --no-cache -t kozmo .
    ```
2. Run image:

    ```bash
    docker run -d --name kozmo -p 3000:3000 kozmo
    ```

3. Stop image:
    ```bash
    docker stop kozmo
    ```

## 👨‍💻 Developers

Kozmo has 3 different modules in a single mono repository.

-   `server`: Node backend to serve API logics
-   `ui`: React frontend
-   `components`: Third-party nodes integrations

### Prerequisite

-   Install [PNPM](https://pnpm.io/installation)
    ```bash
    npm i -g pnpm
    ```

### Setup

1. Clone the repository

    ```bash
    git clone https://github.com/kozmoai/kozmo.git
    ```

2. Go into repository folder

    ```bash
    cd kozmo
    ```

3. Install all dependencies of all modules:

    ```bash
    pnpm install
    ```

4. Build all the code:

    ```bash
    pnpm build
    ```

5. Start the app:

    ```bash
    pnpm start
    ```

    You can now access the app on [http://localhost:3000](http://localhost:3000)

6. For development build:

    - Create `.env` file and specify the `VITE_PORT` (refer to `.env.example`) in `packages/ui`
    - Create `.env` file and specify the `PORT` (refer to `.env.example`) in `packages/server`
    - Run

        ```bash
        pnpm dev
        ```

    Any code changes will reload the app automatically on [http://localhost:8080](http://localhost:8080)

## 🔒 Authentication

To enable app level authentication, add `KOZMO_USERNAME` and `KOZMO_PASSWORD` to the `.env` file in `packages/server`:

```
KOZMO_USERNAME=user
KOZMO_PASSWORD=1234
```

## 🌱 Env Variables

Kozmo support different environment variables to configure your instance. You can specify the following variables in the `.env` file inside `packages/server` folder. Read [more](https://github.com/kozmoai/kozmo/blob/main/CONTRIBUTING.md#-env-variables)

## 📖 Documentation

[Kozmo Docs](https://docs.kozmoai.com/)

## 🌐 Self Host

Deploy kozmo self-hosted in your existing infrastructure, we support various [deployments](https://docs.kozmoai.com/configuration/deployment)

-   [AWS](https://docs.kozmoai.com/deployment/aws)
-   [Azure](https://docs.kozmoai.com/deployment/azure)
-   [Digital Ocean](https://docs.kozmoai.com/deployment/digital-ocean)
-   [GCP](https://docs.kozmoai.com/deployment/gcp)
-   <details>
      <summary>Others</summary>

    -   [Railway](https://docs.kozmoai.com/deployment/railway)

        [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/pn4G8S?referralCode=WVNPD9)

    -   [Render](https://docs.kozmoai.com/deployment/render)

        [![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://docs.kozmoai.com/deployment/render)

    -   [HuggingFace Spaces](https://docs.kozmoai.com/deployment/hugging-face)

        <a href="https://huggingface.co/spaces/kozmoai/kozmo"><img src="https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-sm.svg" alt="HuggingFace Spaces"></a>

    -   [Elestio](https://elest.io/open-source/kozmoai)

        [![Deploy](https://pub-da36157c854648669813f3f76c526c2b.r2.dev/deploy-on-elestio-black.png)](https://elest.io/open-source/kozmoai)

    -   [Sealos](https://cloud.sealos.io/?openapp=system-template%3FtemplateName%3Dkozmo)

        [![](https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg)](https://cloud.sealos.io/?openapp=system-template%3FtemplateName%3Dkozmo)

    -   [RepoCloud](https://repocloud.io/details/?app_id=29)

        [![Deploy on RepoCloud](https://d16t0pc4846x52.cloudfront.net/deploy.png)](https://repocloud.io/details/?app_id=29)

      </details>

## 💻 Cloud Hosted

Coming soon