https://github.com/antimatter15/alpaca.cpp Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} antimatter15 / alpaca.cpp Public forked from ggerganov/llama.cpp * Notifications * Fork 821 * Star 2.3k Locally run an Instruction-Tuned Chat-Style LLM License MIT license 2.3k stars 821 forks Star Notifications * Code * Issues 21 * Pull requests 1 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights antimatter15/alpaca.cpp This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/a] Use Git or checkout with SVN using the web URL. [gh repo clone antima] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. This branch is 17 commits ahead, 11 commits behind ggerganov:master. Latest commit @antimatter15 antimatter15 Update README.md ... d0f855a Mar 18, 2023 Update README.md d0f855a Git stats * 89 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows CI: Enable Linux/MacOS builds March 17, 2023 04:00 .gitignore add easy Windows install instructions to the readme March 17, 2023 04:49 CMakeLists.txt Fix CMake March 16, 2023 23:07 LICENSE Add LICENSE (ggerganov#21) March 12, 2023 08:36 Makefile Fix Makefile March 17, 2023 03:58 README.md Update README.md March 17, 2023 11:13 chat.cpp Merge pull request #26 from mcmonkey4eva/master March 17, 2023 09:44 convert-pth-to-ggml.py Use tokenizer.vocab_size() instead of hardcoding 32000 in convert-p... March 15, 2023 21:37 ggml.c Fix RMS norm in GGML (ggerganov#191) March 15, 2023 19:29 ggml.h Add RMS norm and use it (ggerganov#187) March 16, 2023 00:41 quantize.cpp Windows fixes (ggerganov#31) March 12, 2023 22:15 quantize.sh Add quantize script for batch quantization (ggerganov#92) March 13, 2023 18:15 screencast.gif first commit March 16, 2023 09:16 utils.cpp added ctx_size parameter (ggerganov#148) March 15, 2023 21:42 utils.h added ctx_size parameter (ggerganov#148) March 15, 2023 21:42 View code Alpaca.cpp Get started Windows Setup 13B Credit Disclaimer README.md Alpaca.cpp Run a fast ChatGPT-like model locally on your device. The screencast below is not sped up and running on an M2 Macbook Air with 4GB of weights. asciicast This combines the LLaMA foundation model with an open reproduction of Stanford Alpaca a fine-tuning of the base model to obey instructions (akin to the RLHF used to train ChatGPT) and a set of modifications to llama.cpp to add a chat interface. Get started git clone https://github.com/antimatter15/alpaca.cpp cd alpaca.cpp make chat ./chat You can download the weights for ggml-alpaca-7b-q4.bin with BitTorrent magnet:?xt= urn:btih:5aaceaec63b03e51a98f04fd5c42320b2a033010&dn= ggml-alpaca-7b-q4.bin&tr= udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr= udp%3A%2F%2Fopentracker.i2p.rocks%3A6969%2Fannounce Alternatively you can download them with IPFS. # any of these will work wget -O ggml-alpaca-7b-q4.bin -c https://gateway.estuary.tech/gw/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC wget -O ggml-alpaca-7b-q4.bin -c https://ipfs.io/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC wget -O ggml-alpaca-7b-q4.bin -c https://cloudflare-ipfs.com/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC Save the ggml-alpaca-7b-q4.bin file in the same directory as your ./ chat executable. The weights are based on the published fine-tunes from alpaca-lora, converted back into a pytorch checkpoint with a modified script and then quantized with llama.cpp the regular way. Windows Setup * Download and install CMake: https://cmake.org/download/ * Download and install git. If you've never used git before, consider a GUI client like https://desktop.github.com/ * Clone this repo using your git client of choice (for GitHub Desktop, go to File -> Clone repository -> From URL and paste https://github.com/antimatter15/alpaca.cpp in as the URL) * Open a Windows Terminal inside the folder you cloned the repository to * Run the following commands one by one: cmake . cmake --build . --config Release * Download the weights via any of the links in "Get started" above, and save the file as ggml-alpaca-7b-q4.bin in the main Alpaca directory. * In the terminal window, run this command: .\Release\chat.exe * (You can add other launch options like --n 8 as preferred onto the same line) * You can now type to the AI in the terminal and it will reply. Enjoy! 13B TODO Torrent: magnet:?xt=urn:btih:f3cf71b172129d6b5abccab393bc32253fac8159 &dn=ggml-alpaca-13b-q4.bin&tr=udp%3A%2F%http:// 2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%https://t.co/ zenhelfwRd%3A6969%2Fannounce&tr=https%3A%2F%https://t.co/ zenhelfwRd%3A443%2Fannounce&tr=udp%3A%2F%https://t.co/ RRAn1X65wE%3A6969%2Fannounce&tr=udp%3A%2F%https://t.co/ uTXBeTLUMa%3A2810%2Fannounce Credit This combines Facebook's LLaMA, Stanford Alpaca, alpaca-lora and corresponding weights by Eric Wang (which uses Jason Phang's implementation of LLaMA on top of Hugging Face Transformers), and llama.cpp by Georgi Gerganov. The chat implementation is based on Matvey Soloviev's Interactive Mode for llama.cpp. Inspired by Simon Willison's getting started guide for LLaMA. Disclaimer Note that the model weights are only to be used for research purposes, as they are derivative of LLaMA, and uses the published instruction data from the Stanford Alpaca project which is generated by OpenAI, which itself disallows the usage of its outputs to train competing models. About Locally run an Instruction-Tuned Chat-Style LLM Resources Readme License MIT license Stars 2.3k stars Watchers 28 watching Forks 821 forks Releases No releases published Packages 0 No packages published Languages * C 79.8% * C++ 16.7% * Python 1.2% * Makefile 1.2% * Other 1.1% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.