Skip to content

Commit 7636ddb

Browse files
authored
Update README.md
1 parent 99f3908 commit 7636ddb

File tree

1 file changed

+49
-32
lines changed

1 file changed

+49
-32
lines changed

README.md

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,69 @@ Run a fast ChatGPT-like model locally on your device. The screencast below is no
88

99
This combines the [LLaMA foundation model](https://github.com/facebookresearch/llama) with an [open reproduction](https://github.com/tloen/alpaca-lora) of [Stanford Alpaca](https://github.com/tatsu-lab/stanford_alpaca) a fine-tuning of the base model to obey instructions (akin to the [RLHF](https://huggingface.co/blog/rlhf) used to train ChatGPT) and a set of modifications to [llama.cpp](https://github.com/ggerganov/llama.cpp) to add a chat interface.
1010

11-
## Get started
11+
## Get Started (7B)
1212

13-
```sh
14-
git clone https://github.com/antimatter15/alpaca.cpp
15-
cd alpaca.cpp
13+
Download the zip file corresponding to your operating system from the [latest release](https://github.com/antimatter15/alpaca.cpp/releases/latest). On Windows, download `alpaca-win.zip`, on Mac (both Intel or ARM) download `alpaca-mac.zip`, and on Linux (x64) download `alpaca-linux.zip`.
1614

17-
make chat
15+
Download `ggml-alpaca-7b-q4.bin` and place it in the same folder as the `chat` executable in the zip file. There are several options:
16+
17+
```
18+
# Any of these commands will work.
19+
curl -o ggml-alpaca-7b-q4.bin -C - https://gateway.estuary.tech/gw/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC
20+
curl -o ggml-alpaca-7b-q4.bin -C - https://ipfs.io/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC
21+
curl -o ggml-alpaca-7b-q4.bin -C - https://cloudflare-ipfs.com/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC
22+
23+
# BitTorrent
24+
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
25+
https://btcache.me/torrent/5AACEAEC63B03E51A98F04FD5C42320B2A033010
26+
https://torrage.info/torrent.php?h=5aaceaec63b03e51a98f04fd5c42320b2a033010
27+
```
28+
29+
Once you've downloaded the model weights and placed them into the same directory as the `chat` or `chat.exe` executable, run:
30+
31+
```
1832
./chat
1933
```
2034

21-
You can download the weights for `ggml-alpaca-7b-q4.bin` with BitTorrent:
35+
The weights are based on the published fine-tunes from `alpaca-lora`, converted back into a pytorch checkpoint with a [modified script](https://github.com/tloen/alpaca-lora/pull/19) and then quantized with llama.cpp the regular way.
36+
37+
## Getting Started (13B)
2238

23-
magnet: `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`
24-
torrent: https://btcache.me/torrent/5AACEAEC63B03E51A98F04FD5C42320B2A033010
25-
torrent: https://torrage.info/torrent.php?h=5aaceaec63b03e51a98f04fd5c42320b2a033010
39+
If you have more than 10GB of RAM, you can use the higher quality 13B `ggml-alpaca-13b-q4.bin` model. To download the weights, you can use
2640

41+
```
2742
28-
Alternatively you can download them with IPFS.
43+
# Any of these commands will work.
44+
curl -o ggml-alpaca-13b-q4.bin -C - https://gateway.estuary.tech/gw/ipfs/Qme6wyw9MzqbrUMpFNVq42rC1kSdko7MGT9CL7o1u9Cv9G
45+
curl -o ggml-alpaca-13b-q4.bin -C - https://ipfs.io/ipfs/Qme6wyw9MzqbrUMpFNVq42rC1kSdko7MGT9CL7o1u9Cv9G
46+
curl -o ggml-alpaca-13b-q4.bin -C - https://cloudflare-ipfs.com/ipfs/Qme6wyw9MzqbrUMpFNVq42rC1kSdko7MGT9CL7o1u9Cv9G
2947
48+
# BitTorrent
49+
magnet:?xt=urn:btih:053b3d54d2e77ff020ebddf51dad681f2a651071&dn=ggml-alpaca-13b-q4.bin&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Fopentracker.i2p.rocks%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A6969%2Fannounce&tr=udp%3A%2F%2F9.rarbg.com%3A2810%2Fannounce
50+
https://btcache.me/torrent/053B3D54D2E77FF020EBDDF51DAD681F2A651071
51+
https://torrage.info/torrent.php?h=053b3d54d2e77ff020ebddf51dad681f2a651071
3052
```
31-
# any of these will work
32-
curl -o ggml-alpaca-7b-q4.bin -C - https://gateway.estuary.tech/gw/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC
33-
curl -o ggml-alpaca-7b-q4.bin -C - https://ipfs.io/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC
34-
curl -o ggml-alpaca-7b-q4.bin -C - https://cloudflare-ipfs.com/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC
53+
54+
Once you've downloaded the weights, you can run the following command to enter chat
55+
56+
```
57+
./chat -m ggml-alpaca-13b-q4.bin
3558
```
3659

37-
Save the `ggml-alpaca-7b-q4.bin` file in the same directory as your `./chat` executable.
3860

39-
The weights are based on the published fine-tunes from `alpaca-lora`, converted back into a pytorch checkpoint with a [modified script](https://github.com/tloen/alpaca-lora/pull/19) and then quantized with llama.cpp the regular way.
61+
## Building from Source (MacOS/Linux)
62+
63+
64+
```sh
65+
git clone https://github.com/antimatter15/alpaca.cpp
66+
cd alpaca.cpp
67+
68+
make chat
69+
./chat
70+
```
71+
4072

41-
## Windows Setup
73+
## Building from Source (Windows)
4274

4375
- Download and install CMake: <https://cmake.org/download/>
4476
- Download and install `git`. If you've never used git before, consider a GUI client like <https://desktop.github.com/>
@@ -59,21 +91,6 @@ cmake --build . --config Release
5991
- (You can add other launch options like `--n 8` as preferred onto the same line)
6092
- You can now type to the AI in the terminal and it will reply. Enjoy!
6193

62-
## 13B
63-
64-
TODO: write more docs here (PRs welcome)
65-
66-
You can download the weights for `ggml-alpaca-13b-q4.bin` with BitTorrent:
67-
68-
magnet: `magnet:?xt=urn:btih:053b3d54d2e77ff020ebddf51dad681f2a651071&dn=ggml-alpaca-13b-q4.bin&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Fopentracker.i2p.rocks%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A6969%2Fannounce&tr=udp%3A%2F%2F9.rarbg.com%3A2810%2Fannounce`
69-
torrent: https://btcache.me/torrent/053B3D54D2E77FF020EBDDF51DAD681F2A651071
70-
torrent: https://torrage.info/torrent.php?h=053b3d54d2e77ff020ebddf51dad681f2a651071
71-
72-
73-
```
74-
./chat -m ggml-alpaca-13b-q4.bin
75-
```
76-
7794
## Credit
7895

7996
This combines [Facebook's LLaMA](https://github.com/facebookresearch/llama), [Stanford Alpaca](https://crfm.stanford.edu/2023/03/13/alpaca.html), [alpaca-lora](https://github.com/tloen/alpaca-lora) and [corresponding weights](https://huggingface.co/tloen/alpaca-lora-7b/tree/main) by Eric Wang (which uses [Jason Phang's implementation of LLaMA](https://github.com/huggingface/transformers/pull/21955) on top of Hugging Face Transformers), and [llama.cpp](https://github.com/ggerganov/llama.cpp) by Georgi Gerganov. The chat implementation is based on Matvey Soloviev's [Interactive Mode](https://github.com/ggerganov/llama.cpp/pull/61) for llama.cpp. Inspired by [Simon Willison's](https://til.simonwillison.net/llms/llama-7b-m2) getting started guide for LLaMA. [Andy Matuschak](https://twitter.com/andy_matuschak/status/1636769182066053120)'s thread on adapting this to 13B, using fine tuning weights by [Sam Witteveen](https://huggingface.co/samwit/alpaca13B-lora).

0 commit comments

Comments
 (0)