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 671 * Star 632 Locally run an Instruction-Tuned Chat-Style LLM License MIT license 632 stars 671 forks Star Notifications * Code * Issues 5 * Pull requests 2 * 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 1 commit ahead, 3 commits behind ggerganov:master. #5 Latest commit @antimatter15 antimatter15 first commit ... e750735 Mar 16, 2023 first commit e750735 Git stats * 73 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows .gitignore CMakeLists.txt LICENSE Makefile README.md chat.cpp convert-pth-to-ggml.py ggml.c ggml.h quantize.cpp quantize.sh screencast.gif utils.cpp utils.h View code Alpaca.cpp Get started 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). 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-14.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-14.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. Credit This combines Facebook's LLaMA, Stanford Alpaca, alpaca-lora (which uses Jason Phang's implementation of LLaMA on top of Hugging Face Transformers), and a modified version of 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 632 stars Watchers 6 watching Forks 671 forks Releases No releases published Packages 0 No packages published Languages * C 79.9% * C++ 16.6% * 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.