{"id":13564732,"url":"https://github.com/ykhli/local-ai-stack","last_synced_at":"2025-05-15T21:04:39.925Z","repository":{"id":205223279,"uuid":"712256426","full_name":"ykhli/local-ai-stack","owner":"ykhli","description":"A starter kit to build *local-only* AI apps that cost $0 to run -- starting with document Q\u0026A. Written in Javascript","archived":false,"fork":false,"pushed_at":"2024-01-30T06:15:57.000Z","size":273,"stargazers_count":1363,"open_issues_count":4,"forks_count":191,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-08T14:01:44.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ykhli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-31T05:31:58.000Z","updated_at":"2025-04-04T08:08:07.000Z","dependencies_parsed_at":"2023-11-29T19:29:07.644Z","dependency_job_id":"1a57e5e2-ce11-4174-bbda-76a9e7c17c42","html_url":"https://github.com/ykhli/local-ai-stack","commit_stats":null,"previous_names":["ykhli/local-ai-stack"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ykhli%2Flocal-ai-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ykhli%2Flocal-ai-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ykhli%2Flocal-ai-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ykhli%2Flocal-ai-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ykhli","download_url":"https://codeload.github.com/ykhli/local-ai-stack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254422754,"owners_count":22068678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:35.166Z","updated_at":"2025-05-15T21:04:39.901Z","avatar_url":"https://github.com/ykhli.png","language":"TypeScript","readme":"# Local AI Stack\n\nMake it possible for anyone to run a simple AI app that can do document Q\u0026A **100% locally** without having to swipe a credit card 💳. Based on [AI Starter Kit](https://github.com/a16z-infra/ai-getting-started).\n\n\u003cimg width=\"600\" alt=\"Screen Shot 2023-10-30 at 10 20 17 PM\" src=\"https://github.com/ykhli/local-ai-stack/assets/3489963/b4a7eddb-e655-45c3-93d4-fbb26e94a96c\"\u003e\n\nHave questions? Join [AI Stack devs](https://discord.gg/TsWCNVvRP5) and find me in #local-ai-stack channel.\n\n## Stack\n\n- 🦙 Inference: [Ollama](https://github.com/jmorganca/ollama)\n- 💻 VectorDB: [Supabase pgvector](https://supabase.com/docs/guides/database/extensions/pgvector)\n- 🧠 LLM Orchestration: [Langchain.js](https://js.langchain.com/docs/)\n- 🖼️ App logic: [Next.js](https://nextjs.org/)\n- 🧮 Embeddings generation: [Transformer.js](https://github.com/xenova/transformers.js) and [\nall-MiniLM-L6-v2](https://huggingface.co/Xenova/all-MiniLM-L6-v2)\n\n## Quickstart\n\n### 1. Fork and Clone repo\n\nFork the repo to your Github account, then run the following command to clone the repo:\n\n```\ngit clone git@github.com:[YOUR_GITHUB_ACCOUNT_NAME]/local-ai-stack.git\n```\n\n### 2. Install dependencies\n\n```\ncd local-ai-stack\nnpm install\n```\n\n### 3. Install Ollama\n\nInstructions are [here](https://github.com/jmorganca/ollama#macos)\n\n### 4. Run Supabase locally\n\n1. Install Supabase CLI\n\n```\nbrew install supabase/tap/supabase\n```\n\n2. Start Supabase\n\nMake sure you are under `/local-ai-stack` directory and run:\n\n```\nsupabase start\n```\n\n### 5. Fill in secrets\n\n```\ncp .env.local.example .env.local\n```\n\nThen get `SUPABASE_PRIVATE_KEY` by running\n\n```\nsupabase status\n```\n\nCopy `service_role key` and save it as `SUPABASE_PRIVATE_KEY` in `.env.local`\n\n### 6. Generate embeddings\n\n```bash\nnode src/scripts/indexBlogLocal.mjs\n```\n\nThis script takes in all files from /blogs, generate embeddings using [transformers.js](https://github.com/xenova/transformers.js), and store embeddings as well as metadata in Supabase.\n\n### 7. Run app locally\n\nNow 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`.\n\n### 8. Deploy the app\n\nIf you want to take the local-only app to the next level, feel free to follow instructions on [AI Starter Kit](https://github.com/a16z-infra/ai-getting-started) for using Clerk, Pinecone/Supabase, OpenAI, Replicate and other cloud-based vendors.\n\n## Refs \u0026 Credits\n\n- [AI SDK](https://sdk.vercel.ai/docs)\n- [LangUI](https://www.langui.dev/components)\n- [Tailwind CSS](https://tailwindcss.com/)\n- [a16z AI starter kit](https://github.com/a16z-infra/ai-getting-started)\n- https://js.langchain.com/docs/modules/indexes/vector_stores/integrations/pinecone\n- https://js.langchain.com/docs/modules/models/llms/integrations#replicate\n- https://js.langchain.com/docs/modules/chains/index_related_chains/retrieval_qa\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fykhli%2Flocal-ai-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fykhli%2Flocal-ai-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fykhli%2Flocal-ai-stack/lists"}