Make it possible for anyone to run a simple AI app that can do document Q&A 100% locally without having to swipe a credit card ๐ณ. Based on AI Starter Kit.
![Screen Shot 2023-10-30 at 10 20 17 PM](https://private-user-images.githubusercontent.com/3489963/279266407-b4a7eddb-e655-45c3-93d4-fbb26e94a96c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM0NDc3MDEsIm5iZiI6MTcyMzQ0NzQwMSwicGF0aCI6Ii8zNDg5OTYzLzI3OTI2NjQwNy1iNGE3ZWRkYi1lNjU1LTQ1YzMtOTNkNC1mYmIyNmU5NGE5NmMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTJUMDcyMzIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzA2YjA1MzBkOTJiY2NjZDUzZDY4MTkyNjk3ZjE1YzgwNjY3MjFhNjBkOTliZmQ3ZWFkZGNjYmQxYmE1N2Q3OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ._NaqE-WZuI-Y2AYzH1q1T48w6xtqaNj-IVlgBiC42_8)
Have questions? Join AI Stack devs and find me in #local-ai-stack channel.
- ๐ฆ Inference: Ollama
- ๐ป VectorDB: Supabase pgvector
- ๐ง LLM Orchestration: Langchain.js
- ๐ผ๏ธ App logic: Next.js
Fork the repo to your Github account, then run the following command to clone the repo:
git clone [email protected]:[YOUR_GITHUB_ACCOUNT_NAME]/local-ai-stack.git
cd local-ai-stack
npm install
Instructions are here
- Install Supabase CLI
brew install supabase/tap/supabase
- Start Supabase
Make sure you are under /local-ai-stack
directory and run:
supabase start
cp .env.local.example .env.local
Then get SUPABASE_PRIVATE_KEY
by running
supabase status
Copy anon key
and save it as SUPABASE_PRIVATE_KEY
in .env.local
node src/scripts/indexBlogLocal.mjs
This script takes in all files from /blogs, generate embeddings using transformers.js, and store embeddings as well as metadata in Supabase.
Now you are ready to test out the app locally! To do this, simply run npm run dev
under the project root and visit http://localhost:3000
.
If you want to take the local-only app to the next level, feel free to follow instructions on AI Starter Kit for using Clerk, Pinecone/Supabase, OpenAI, Replicate and other cloud-based vendors.