From 7c941c462c39ee47999ac4176e22525a5d91195d Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Tue, 19 Dec 2023 12:39:49 -0800 Subject: [PATCH 1/6] Add ignore-paths for github actions --- .github/workflows/build-and-push-image.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-and-push-image.yaml b/.github/workflows/build-and-push-image.yaml index 76b6dac15..ca5fb52a0 100644 --- a/.github/workflows/build-and-push-image.yaml +++ b/.github/workflows/build-and-push-image.yaml @@ -3,6 +3,11 @@ name: Publish Docker image and Github Registry on: push: branches: ['master'] + paths-ignore: + - '*.md' + - 'cloud-deployments/*' + - 'images/*' + - '.vscode/*' jobs: push_to_registries: From f1fc2d90fa27fe016c34e0aa36a6194789cc91ba Mon Sep 17 00:00:00 2001 From: Timothy Carambat Date: Tue, 19 Dec 2023 13:24:50 -0800 Subject: [PATCH 2/6] Readme updates (#475) * wip * btn links * button updates * update dev instructions * typo --- README.md | 100 ++++++++++++++++++----------------- docker/HOW_TO_USE_DOCKER.md | 34 +++++++----- images/deployBtns/aws.png | Bin 0 -> 3560 bytes images/deployBtns/docker.png | Bin 0 -> 2746 bytes 4 files changed, 74 insertions(+), 60 deletions(-) create mode 100644 images/deployBtns/aws.png create mode 100644 images/deployBtns/docker.png diff --git a/README.md b/README.md index e91520ab4..879cf2dd7 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,13 @@ A full-stack application that enables you to turn any document, resource, or pie ![Chatting](/images/screenshots/chatting.gif) -### Watch the demo! +
+Watch the demo! [![Watch the video](/images/youtube.png)](https://youtu.be/f95rGD9trL0) +
+ ### Product Overview AnythingLLM is a full-stack application where you can use commercial off-the-shelf LLMs or popular open source LLMs and vectorDB solutions to build a private ChatGPT with no compromises that you can run locally as well as host remotely and be able to chat intelligently with any documents you provide it. @@ -79,64 +82,28 @@ This monorepo consists of three main sections: - `docker`: Docker instructions and build process + information for building from source. - `collector`: NodeJS express server that process and parses documents from the UI. -### Minimum Requirements -> [!TIP] -> Running AnythingLLM on AWS/GCP/Azure? -> You should aim for at least 2GB of RAM. Disk storage is proportional to however much data -> you will be storing (documents, vectors, models, etc). Minimum 10GB recommended. +## 🛳 Self Hosting +Mintplex Labs & the community maintain a number of deployment methods, scripts, and templates that you can use to run AnythingLLM locally. Refer to the table below to read how to deploy on your preferred environment or to automatically deploy. +| Docker | AWS | GCP | Digital Ocean | Render.com | +|----------------------------------------|----:|-----|---------------|------------| +| [![Deploy on Docker][docker-btn]][docker-deploy] | [![Deploy on AWS][aws-btn]][aws-deploy] | [![Deploy on GCP][gcp-btn]][gcp-deploy] | [![Deploy on DigitalOcean][do-btn]][aws-deploy] | [![Deploy on Render.com][render-btn]][render-deploy] | -- `yarn` and `node` on your machine -- access to an LLM running locally or remotely. -*AnythingLLM by default uses a built-in vector database powered by [LanceDB](https://github.com/lancedb/lancedb) - -*AnythingLLM by default embeds text on instance privately [Learn More](/server/storage/models/README.md) - -## Recommended usage with Docker (easy!) -> [!IMPORTANT] -> If you are running another service on localhost like Chroma, LocalAi, or LMStudio -> you will need to use http://host.docker.internal:xxxx to access the service from within -> the docker container using AnythingLLM as `localhost:xxxx` will not resolve for the host system. -> eg: Chroma host URL running on localhost:8000 on host machine needs to be http://host.docker.internal:8000 -> when used in AnythingLLM. - -> [!TIP] -> It is best to mount the containers storage volume to a folder on your host machine -> so that you can pull in future updates without deleting your existing data! - -`docker pull mintplexlabs/anythingllm:master` - -```shell -export STORAGE_LOCATION=$HOME/anythingllm && \ -mkdir -p $STORAGE_LOCATION && \ -touch "$STORAGE_LOCATION/.env" && \ -docker run -d -p 3001:3001 \ ---cap-add SYS_ADMIN \ --v ${STORAGE_LOCATION}:/app/server/storage \ --v ${STORAGE_LOCATION}/.env:/app/server/.env \ --e STORAGE_DIR="/app/server/storage" \ -mintplexlabs/anythingllm:master -``` - -Open [http://localhost:3001](http://localhost:3001) and you are now using AnythingLLM! -All your data and progress will now persist between container rebuilds or pulls from Docker Hub. - -[Learn more about running AnythingLLM with Docker](./docker/HOW_TO_USE_DOCKER.md) - -### How to get started (Development environment) +## How to setup for development - `yarn setup` from the project root directory. - This will fill in the required `.env` files you'll need in each of the application sections. Go fill those out before proceeding or else things won't work right. - `yarn prisma:setup` To build the Prisma client and migrate the database. -To boot the server locally (run commands from root of repo): +To boot the server locally (from root of repo): - ensure `server/.env.development` is set and filled out. `yarn dev:server` -To boot the frontend locally (run commands from root of repo): -- ensure `frontend/.env` is set and filled out. -- ensure `VITE_API_BASE="http://localhost:3001/api"` +To boot the frontend locally (from root of repo): `yarn dev:frontend` +To then run the document collector (from root of repo) +`yarn dev:collector` + [Learn about documents](./server/storage/documents/DOCUMENTS.md) [Learn about vector caching](./server/storage/vector-cache/VECTOR_CACHE.md) @@ -146,6 +113,9 @@ To boot the frontend locally (run commands from root of repo): - create PR with branch name format of `-` - yee haw let's merge +
+Telemetry for AnythingLLM + ## Telemetry AnythingLLM by Mintplex Labs Inc contains a telemetry feature that collects anonymous usage information. @@ -168,3 +138,37 @@ We will only track usage details that help us make product and roadmap decisions - Chat is sent. This is the most regular "event" and gives us an idea of the daily-activity of this project across all installations. Again, only the event is sent - we have no information on the nature or content of the chat itself. You can verify these claims by finding all locations `Telemetry.sendTelemetry` is called. Additionally these events are written to the output log so you can also see the specific data which was sent - if enabled. No IP or other identifying information is collected. The Telemetry provider is [PostHog](https://posthog.com/) - an open-source telemetry collection service. + +
+ +## 🔗 More Products + +- **[VectorAdmin][vector-admin]:** An all-in-one GUI & tool-suite for managing vector databases. +- **[OpenAI Assistant Swarm][assistant-swarm]:** Turn your entire library of OpenAI assistants into one single army commanded from a single agent. + +
+ +[![][back-to-top]](#readme-top) + +
+ +--- + +Copyright © 2023 [Mintplex Labs][profile-link].
+This project is [MIT](./LICENSE) licensed. + + +[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-222628?style=flat-square +[profile-link]: https://github.com/mintplex-labs +[vector-admin]: https://github.com/mintplex-labs/vector-admin +[assistant-swarm]: https://github.com/Mintplex-Labs/openai-assistant-swarm +[docker-btn]: ./images/deployBtns/docker.png +[docker-deploy]: ./docker/HOW_TO_USE_DOCKER.md +[aws-btn]: ./images/deployBtns/aws.png +[aws-deploy]: ./cloud-deployments/aws/cloudformation/DEPLOY.md +[gcp-btn]: https://deploy.cloud.run/button.svg +[gcp-deploy]: ./cloud-deployments/gcp/deployment/DEPLOY.md +[do-btn]: https://www.deploytodo.com/do-btn-blue.svg +[do-deploy]: ./cloud-deployments/digitalocean/terraform/DEPLOY.md +[render-btn]: https://render.com/images/deploy-to-render-button.svg +[render-deploy]: https://render.com/deploy?repo=https://github.com/Mintplex-Labs/anything-llm&branch=render diff --git a/docker/HOW_TO_USE_DOCKER.md b/docker/HOW_TO_USE_DOCKER.md index a74b11d45..5b5a58067 100644 --- a/docker/HOW_TO_USE_DOCKER.md +++ b/docker/HOW_TO_USE_DOCKER.md @@ -2,8 +2,20 @@ Use the Dockerized version of AnythingLLM for a much faster and complete startup of AnythingLLM. -## Requirements -- Install [Docker](https://www.docker.com/) on your computer or machine. + +### Minimum Requirements +> [!TIP] +> Running AnythingLLM on AWS/GCP/Azure? +> You should aim for at least 2GB of RAM. Disk storage is proportional to however much data +> you will be storing (documents, vectors, models, etc). Minimum 10GB recommended. + +- `docker` installed on your machine +- `yarn` and `node` on your machine +- access to an LLM running locally or remotely + +*AnythingLLM by default uses a built-in vector database powered by [LanceDB](https://github.com/lancedb/lancedb) + +*AnythingLLM by default embeds text on instance privately [Learn More](../server/storage/models/README.md) ## Recommend way to run dockerized AnythingLLM! > [!IMPORTANT] @@ -34,7 +46,13 @@ mintplexlabs/anythingllm:master Go to `http://localhost:3001` and you are now using AnythingLLM! All your data and progress will persist between container rebuilds or pulls from Docker Hub. -## Build locally from source +## How to use the user interface +- To access the full application, visit `http://localhost:3001` in your browser. + +## About UID and GID in the ENV +- The UID and GID are set to 1000 by default. This is the default user in the Docker container and on most host operating systems. If there is a mismatch between your host user UID and GID and what is set in the `.env` file, you may experience permission issues. + +## Build locally from source _not recommended for casual use_ - `git clone` this repo and `cd anything-llm` to get to the root directory. - `touch server/storage/anythingllm.db` to create empty SQLite DB file. - `cd docker/` @@ -43,12 +61,6 @@ container rebuilds or pulls from Docker Hub. Your docker host will show the image as online once the build process is completed. This will build the app to `http://localhost:3001`. -## How to use the user interface -- To access the full application, visit `http://localhost:3001` in your browser. - -## About UID and GID in the ENV -- The UID and GID are set to 1000 by default. This is the default user in the Docker container and on most host operating systems. If there is a mismatch between your host user UID and GID and what is set in the `.env` file, you may experience permission issues. - ## ⚠️ Vector DB support ⚠️ Out of the box, all vector databases are supported. Any vector databases requiring special configuration are listed below. @@ -80,6 +92,4 @@ VITE_API_BASE="http://:3001/api" For example, if the docker instance is available on `192.186.1.222` your `VITE_API_BASE` would look like `VITE_API_BASE="http://192.186.1.222:3001/api"` in `frontend/.env.production`. ### Still not working? -[Ask for help on Discord](https://discord.gg/6UyHPeGZAC) - - +[Ask for help on Discord](https://discord.gg/6UyHPeGZAC) \ No newline at end of file diff --git a/images/deployBtns/aws.png b/images/deployBtns/aws.png new file mode 100644 index 0000000000000000000000000000000000000000..fde4a2a8d836ad6393e5e5188b173889894f071d GIT binary patch literal 3560 zcmb`K`#%$o_s1t=ZfUuvxzEU*2)WEc?vnfco-kV$a=&e#n8+=1saSZsCnRj{k)hm` z%a{!1l1nacrtt0iH+()noacF+AI=Z2UtW*LE5*vv=pvgS8vp>fXku(&4FE83{?#fh z%zybNPL2F`F@#tf-C~#>l#Bm+um&4Dg#ZBT-2XoefWnsoe?Om^7$9sTUT(R9@_7vT z>Lg{c2?+@TEK$IZ!BL_t%vP3Gnwpmmzv+$Y8yK=aVZFP%qL(Eq!y;qyFx`|n>*Za& zhn(4^zD1`tlu)~{qn}ehYqf%RVi&vKO&*fU%iA{J<^=*{uL+0Oe_&7+;JD2OaL|Um zgkRru9T+0dSs50{mCt4Aac!ENXs|rC$p2-^my3X zKn2!WN5+38wdkxt0jpanR=NKSJMw5hJ^ZairJ))kS&Mz{S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$K0o|mm AumAu6 literal 0 HcmV?d00001 diff --git a/images/deployBtns/docker.png b/images/deployBtns/docker.png new file mode 100644 index 0000000000000000000000000000000000000000..e79604afd1e6d9f80c4efc7845aecaa47e812ff3 GIT binary patch literal 2746 zcmbW3`9BkmAIE1k$5zg05g{Gs%vJj2nq#Oi=E#xUwB(x1u{jE{VL3jC+-GBq@No>u zh}>k35II6-l~D@cKHvY~`~Bhle7|0g$NT;M@%?xuSePMBf*B<2ykB07U5D;s89)g#rLzXA=WG6gGD&Hxz?< zFW!4_zP_ZfyrFS&V|0A{_Lfhz@7ANRmc6OT-HE^X8;^7I8+H9UORfD>XU@zZY?Y-40xM5xzjn z|MlyDiCe5o#fuW?{gv+$=Yb-dsrizi!2}mTW1uGz>ZmDTmdNlJQ=fi(g zN%d1npMXtf=))07=TWgQj&uXMs_50A=p| zvI%a-hXzV|WR__|i-7iM%R!xO^Ba3LpZV4r-iiXHkRN>&TxR3=cz3GNCw|2kT_{Xm z-o=UMLlrp>zeTqn(K2;CZ#;vmE}ySI=TqF}u#2&~pEJT=6uD2AF6MB~nY^W`)FF{Z z7v)2cgpx1LdCVZ>A`b5fhOIVmAFgLyb!|K--61bD9AfbhryATvdAZ-y@bf`*E0@`a zL$jW*&fxUQ4|lh{-!NHE-@hIUME9kfWNUqMMW9>1!dbf(-_Gk-$v9r^?{JGW5YZ3& zYL`B;zdmQ=X7fDh=MUwDuc`sdGHJ5EF9$YmZ5eMnA=FG(daL+e{)8^+-=;RFG~%%S z!+<*g*ow6OX&A$?;dyuqzv6O3tIZE5qeE!5d(@rwjzer@HKv$%%#)gv%LV)U)t=oc zC599%@Nb7PR>tex3P_mg0?pH z2qxJoX;Lw?=tbbg=dA7}*&1!7Xs*H9wG@K@f@wwP&E8^KJa{$RH#Y0Fa(UgfkV zZ5Va@wBUW}tjH_1rs=lbnUjSW6opb3IOc?MpV@B<_T50EN-lhz-|T!@!3gU9L~-e< zetV~?8K!1i%4?|zIghNI=5KK`k&6>*j1An)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:00:00 2001 From: Timothy Carambat Date: Tue, 19 Dec 2023 13:27:09 -0800 Subject: [PATCH 3/6] Add placeholder collector ENV file (#476) resolves #474 --- collector/.env.example | 1 + 1 file changed, 1 insertion(+) create mode 100644 collector/.env.example diff --git a/collector/.env.example b/collector/.env.example new file mode 100644 index 000000000..91d0e10a5 --- /dev/null +++ b/collector/.env.example @@ -0,0 +1 @@ +# Placeholder .env file for collector runtime \ No newline at end of file From 32b1f050628763fb48663dd63648561e4acd848d Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Tue, 19 Dec 2023 13:30:17 -0800 Subject: [PATCH 4/6] add Top link --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 879cf2dd7..9ed7cc609 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +

AnythingLLM logo

From a7f6003277143c25f838ae26165d9a8a5fb69f50 Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Tue, 19 Dec 2023 16:20:34 -0800 Subject: [PATCH 5/6] fix: set lower maxChunk limit on native embedder to stay within resource constraints chore: update comment for what embedding chunk means --- server/utils/EmbeddingEngines/azureOpenAi/index.js | 2 +- server/utils/EmbeddingEngines/localAi/index.js | 2 +- server/utils/EmbeddingEngines/native/index.js | 4 ++-- server/utils/EmbeddingEngines/openAi/index.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/utils/EmbeddingEngines/azureOpenAi/index.js b/server/utils/EmbeddingEngines/azureOpenAi/index.js index 8959b0007..3f36b576b 100644 --- a/server/utils/EmbeddingEngines/azureOpenAi/index.js +++ b/server/utils/EmbeddingEngines/azureOpenAi/index.js @@ -14,7 +14,7 @@ class AzureOpenAiEmbedder { ); this.openai = openai; - // The maximum amount of "inputs" that OpenAI API can process in a single call. + // Limit of how many strings we can process in a single pass to stay with resource or network limits // https://learn.microsoft.com/en-us/azure/ai-services/openai/faq#i-am-trying-to-use-embeddings-and-received-the-error--invalidrequesterror--too-many-inputs--the-max-number-of-inputs-is-1---how-do-i-fix-this-:~:text=consisting%20of%20up%20to%2016%20inputs%20per%20API%20request this.embeddingMaxChunkLength = 16; } diff --git a/server/utils/EmbeddingEngines/localAi/index.js b/server/utils/EmbeddingEngines/localAi/index.js index 0f43cc7dc..68fe66544 100644 --- a/server/utils/EmbeddingEngines/localAi/index.js +++ b/server/utils/EmbeddingEngines/localAi/index.js @@ -17,7 +17,7 @@ class LocalAiEmbedder { }); this.openai = new OpenAIApi(config); - // Arbitrary limit of string size in chars to ensure we stay within reasonable POST request size. + // Limit of how many strings we can process in a single pass to stay with resource or network limits this.embeddingMaxChunkLength = maximumChunkLength(); } diff --git a/server/utils/EmbeddingEngines/native/index.js b/server/utils/EmbeddingEngines/native/index.js index 2081e3fde..81189d4e2 100644 --- a/server/utils/EmbeddingEngines/native/index.js +++ b/server/utils/EmbeddingEngines/native/index.js @@ -13,8 +13,8 @@ class NativeEmbedder { ); this.modelPath = path.resolve(this.cacheDir, "Xenova", "all-MiniLM-L6-v2"); - // Arbitrary limit of string size in chars to ensure we stay within reasonable POST request size. - this.embeddingMaxChunkLength = 1_000; + // Limit of how many strings we can process in a single pass to stay with resource or network limits + this.embeddingMaxChunkLength = 50; // Make directory when it does not exist in existing installations if (!fs.existsSync(this.cacheDir)) fs.mkdirSync(this.cacheDir); diff --git a/server/utils/EmbeddingEngines/openAi/index.js b/server/utils/EmbeddingEngines/openAi/index.js index 8cfa23516..6ba38c898 100644 --- a/server/utils/EmbeddingEngines/openAi/index.js +++ b/server/utils/EmbeddingEngines/openAi/index.js @@ -10,7 +10,7 @@ class OpenAiEmbedder { const openai = new OpenAIApi(config); this.openai = openai; - // Arbitrary limit of string size in chars to ensure we stay within reasonable POST request size. + // Limit of how many strings we can process in a single pass to stay with resource or network limits this.embeddingMaxChunkLength = 1_000; } From 67725e807ae9680fde87f90c700e8ff4bfe04d14 Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Tue, 19 Dec 2023 16:22:25 -0800 Subject: [PATCH 6/6] fix: broken build file --- .github/workflows/build-and-push-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-push-image.yaml b/.github/workflows/build-and-push-image.yaml index ca5fb52a0..943af5526 100644 --- a/.github/workflows/build-and-push-image.yaml +++ b/.github/workflows/build-and-push-image.yaml @@ -3,7 +3,7 @@ name: Publish Docker image and Github Registry on: push: branches: ['master'] - paths-ignore: + paths-ignore: - '*.md' - 'cloud-deployments/*' - 'images/*'