Skip to content

Commit

Permalink
feat: use LlamaIndex branding, update readme, change license
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusschiesser committed Oct 24, 2023
1 parent 831a544 commit 55b01ef
Show file tree
Hide file tree
Showing 18 changed files with 82 additions and 703 deletions.
682 changes: 21 additions & 661 deletions LICENSE

Large diffs are not rendered by default.

61 changes: 40 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<br /><br />

<p align="center">
<img src="./public/android-chrome-192x192.png" alt="Unc Logo" width="70">
<img src="./public/android-chrome-192x192.png" alt="LlamaIndex Chat Logo" width="70">
</p>

<h3 align="center"><b>Unc</b></h3>
<p align="center"><b>A privacy-first, enterprise-ready, open-source ChatGPT platform</b></p>
<h3 align="center"><b>LlamaIndex Chat</b></h3>
<p align="center"><b>Create chat bots that know your data</b></p>

<p>
<img
src="./public/screenshot.png"
alt="Unc Screen"
alt="LlamaIndex Chat Screen"
width="100%"
/>
</p>

Welcome to [Unc](https://unc.de). A robust, scalable open-source platform built specifically for implementing privacy-first, enterprise-level ChatGPT.
Welcome to [LlamaIndex Chat](https://github.com/run-llama/chat-llamaindex). You can create and share LLM chatbots that
know your data (PDF or text documents).

Getting started with Unc is a breeze. Visit [unc.de](https://unc.de) - a hosted version of Unc with no user authentication, provides an immediate start.
Getting started with LlamaIndex Chat is a breeze. Visit https://chat-llamaindex.vercel.app - a hosted version of LlamaIndex Chat with no user authentication that provides an immediate start.

## 🚀 Features

Unc is enterprise-ready, featuring:
LlamaIndex Chat is an example chatbot application for [LlamaIndexTS](https://github.com/run-llama/LlamaIndexTS).
You can:

- Self-hosted, can be installed in own cloud (private or public).
- Chat with your own HTML and PDF documents.
- Create bots using prompt engineering (no-code) and share them with other users. This avoids the repetition of frequently used prompts.
- Supports [Azure OpenAI from Microsoft](https://azure.microsoft.com/en-us/products/ai-services/openai-service), eliminating traffic to OpenAI.
- Privacy first; personal data is stored locally in the browser.
- Create bots using prompt engineering and share them with other users.
- Modify the demo bots by using the UI or directly editing the [./app/bots/bot.data.ts](./app/bots/bot.data.ts) file.
- Integrate your data by uploading documents or generating new [data sources](#📀-data-sources).

## ⚡️ Quick start

Expand All @@ -38,8 +38,8 @@ Requirement: [NodeJS](https://nodejs.org) 18
- Clone the repository

```bash
git clone https://github.com/marcusschiesser/unc
cd unc
git clone https://github.com/run-llama/chat-llamaindex
cd chat-llamaindex
```

- Set the environment variables
Expand All @@ -61,16 +61,35 @@ pnpm dev

Deploying to Vercel is simple, just click the button below and follow the instructions:

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fmarcusschiesser%2Func&env=OPENAI_API_KEY)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Frun-llama%2Fchat-llamaindex&env=OPENAI_API_KEY)

In case you're deploying to a [Vercel Hobby](https://vercel.com/docs/accounts/plans#hobby) account, make sure to [change the running time](./app/api/llm/route.ts#L179) to 10 seconds as this is the limit for the free plan.
In case you're deploying to a [Vercel Hobby](https://vercel.com/docs/accounts/plans#hobby) account, make sure to [change the running time](./app/api/llm/route.ts#L196) to 10 seconds as this is the limit for the free plan.

## Recreate Storage
If you want to use the [sharing](#🔄-sharing) functionality, then you need to create a Vercel KV store and connect it to your project.
Just follow [this step from the quickstart](https://vercel.com/docs/storage/vercel-kv/quickstart#create-a-kv-database). No further configuration is needed as the app is automatically using a connected KV store.

The app is using a [`ChatEngine`](https://ts.llamaindex.ai/modules/high_level/chat_engine) for each bot with a different [`VectorStoreIndex`](https://ts.llamaindex.ai/modules/high_level/data_index) attached.
The `cache` folder in the file system is used as [Storage](The https://ts.llamaindex.ai/modules/low_level/storage) for the `VectorStoreIndex`. To re-create the storage
Vector Indexes
## 🔄 Sharing

LlamaIndex Chat supports sharing of bots via URLs. Demo bots are read-only and can't be shared. But you can create new bots (or clone and modify a demo bot) and call the share functionality in the context menu. It will create a new URL that can be shared with others. Opening the URL, users can directly use the shared bot.

## 📀 Data Sources

The app is using a [`ChatEngine`](https://ts.llamaindex.ai/modules/high_level/chat_engine) for each bot with a [`VectorStoreIndex`](https://ts.llamaindex.ai/modules/high_level/data_index) attached.
The `cache` folder in the root directory is used as [Storage](https://ts.llamaindex.ai/modules/low_level/storage) for each `VectorStoreIndex`.

Each subfolder in the `cache` folder contains the data for one `VectorStoreIndex`. To set which `VectorStoreIndex` is used for a bot, use the subfolder's name as `datasource` attribute in the [bot's data](./app/bots/bot.data.ts).

### Generate Data Sources

To generate a new data source, create a new subfolder in the `datasources` directory and add the data files (e.g. PDFs) to it.
Then create the `VectorStoreIndex` for the data source, by running the following command:

```bash
pnpm run generate
pnpm run generate <datasource-name>
```

Where `<datasource-name>` is the name of the subfolder with your data files.

## 🙏 Thanks

Thanks go to @Yidadaa for his [ChatGPT-Next-Web](https://github.com/Yidadaa/ChatGPT-Next-Web) project, which was used as a starter template for this project.
10 changes: 5 additions & 5 deletions app/components/layout/error.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { LINKEDIN_URL } from "../../constant";
import { GITHUB_URL } from "../../constant";
import Locale from "../../locales";
import { downloadAs } from "../../utils/download";
import {
Expand All @@ -14,7 +14,7 @@ import {
} from "@/app/components/ui/alert-dialog";
import { cn } from "@/app/lib/utils";
import { Button, buttonVariants } from "@/app/components/ui/button";
import { Linkedin, RefreshCcw } from "lucide-react";
import { Github, RefreshCcw } from "lucide-react";
import {
Card,
CardContent,
Expand All @@ -41,7 +41,7 @@ export class ErrorBoundary extends React.Component<any, IErrorBoundaryState> {

clearAndSaveData() {
try {
downloadAs(JSON.stringify(localStorage), "unc-snapshot.json");
downloadAs(JSON.stringify(localStorage), "chat-llamaindex-snapshot.json");
} finally {
localStorage.clear();
location.reload();
Expand All @@ -66,9 +66,9 @@ export class ErrorBoundary extends React.Component<any, IErrorBoundaryState> {
<Button
variant="outline"
size="sm"
onClick={() => window.open(LINKEDIN_URL, "_blank")}
onClick={() => window.open(GITHUB_URL, "_blank")}
>
<Linkedin className="mr-2 h-4 w-4" />
<Github className="mr-2 h-4 w-4" />
<span>Report This Error</span>
</Button>
<AlertDialog>
Expand Down
10 changes: 5 additions & 5 deletions app/components/layout/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ThemeToggle } from "@/app/components/layout/theme-toggle";
import { Linkedin, LogOut, Settings } from "lucide-react";
import { Github, LogOut, Settings } from "lucide-react";
import { signOut, useSession } from "next-auth/react";
import dynamic from "next/dynamic";
import { useNavigate } from "react-router-dom";
import { LINKEDIN_URL, Path } from "../../constant";
import { GITHUB_URL, Path } from "../../constant";
import Locale from "../../locales";
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
import { Button } from "../ui/button";
Expand Down Expand Up @@ -107,10 +107,10 @@ export function SideBar(props: { className?: string }) {
<Button
variant="outline"
size="sm"
onClick={() => window.open(LINKEDIN_URL, "_blank")}
onClick={() => window.open(GITHUB_URL, "_blank")}
>
<Linkedin className="mr-2 h-4 w-4" />
<span>{Locale.Home.LinkedIn}</span>
<Github className="mr-2 h-4 w-4" />
<span>{Locale.Home.Github}</span>
</Button>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/components/login.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Linkedin } from "lucide-react";
import { signIn } from "next-auth/react";
import Link from "next/link";
import { LINKEDIN_URL } from "../constant";
import { GITHUB_URL } from "../constant";
import Locale from "../locales";
import { Button, buttonVariants } from "./ui/button";
import { cn } from "../lib/utils";
Expand All @@ -10,7 +10,7 @@ export default function LoginPage() {
return (
<div className="container relative hidden flex-col items-center justify-center md:grid lg:max-w-none lg:grid-cols-2 lg:px-0">
<Link
href={LINKEDIN_URL}
href={GITHUB_URL}
className={cn(
buttonVariants({ variant: "ghost" }),
"absolute right-4 top-4 md:right-8 md:top-8",
Expand Down
2 changes: 1 addition & 1 deletion app/constant.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const LINKEDIN_URL = "https://www.linkedin.com/in/marcusschiesser";
export const GITHUB_URL = "https://github.com/run-llama/chat-llamaindex";

export enum Path {
Home = "/",
Expand Down
6 changes: 3 additions & 3 deletions app/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const en = {
Send: "Send Memory",
},
Home: {
LinkedIn: "Contact",
Github: "Github",
Logout: "Logout",
Settings: "Settings",
},
Expand Down Expand Up @@ -144,8 +144,8 @@ const en = {
},

Welcome: {
Title: "Unc",
SubTitle: "The open and secure ChatGPT platform",
Title: "LlamaIndex Chat",
SubTitle: "Create chat bots that know your data",
Quote:
"“This tool has saved me countless hours of work and helped me apply AI features to my work faster than ever before.”",
LoginLinkedinTitle: "Login with LinkedIn",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "unc",
"name": "chat-llamaindex",
"private": false,
"license": "AGPL-3.0-or-later",
"license": "MIT",
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down
Binary file modified public/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon-2048x2048.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
Binary file modified public/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/serviceWorker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const UNC_WEB_CACHE = "unc-web-cache";
const UNC_WEB_CACHE = "chat-llamaindex-web-cache";

self.addEventListener("activate", function (event) {
console.log("ServiceWorker activated.");
Expand Down
4 changes: 2 additions & 2 deletions public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unc.de",
"short_name": "UNC",
"name": "chat-llamaindex",
"short_name": "chat",
"icons": [
{
"src": "/android-chrome-192x192.png",
Expand Down

0 comments on commit 55b01ef

Please sign in to comment.