Upload README.md
Browse files
README.md
CHANGED
@@ -45,19 +45,17 @@ GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is
|
|
45 |
|
46 |
The key benefit of GGUF is that it is a extensible, future-proof format which stores more information about the model as metadata. It also includes significantly improved tokenization code, including for the first time full support for special tokens. This should improve performance, especially with models that use new special tokens and implement custom prompt templates.
|
47 |
|
48 |
-
|
49 |
-
* [llama.cpp](https://github.com/ggerganov/llama.cpp)
|
50 |
* [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI. Supports GGUF with GPU acceleration via the ctransformers backend - llama-cpp-python backend should work soon too.
|
51 |
* [KoboldCpp](https://github.com/LostRuins/koboldcpp), now supports GGUF as of release 1.41! A powerful GGML web UI, with full GPU accel. Especially good for story telling.
|
|
|
52 |
* [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), should now work, choose the `c_transformers` backend. A great web UI with many interesting features. Supports CUDA GPU acceleration.
|
53 |
* [ctransformers](https://github.com/marella/ctransformers), now supports GGUF as of version 0.2.24! A Python library with GPU accel, LangChain support, and OpenAI-compatible AI server.
|
54 |
* [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), supports GGUF as of version 0.1.79. A Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
|
55 |
* [candle](https://github.com/huggingface/candle), added GGUF support on August 22nd. Candle is a Rust ML framework with a focus on performance, including GPU support, and ease of use.
|
56 |
|
57 |
-
The clients and libraries below are expecting to add GGUF support shortly:
|
58 |
-
* [LM Studio](https://lmstudio.ai/), should be updated by end August 25th.
|
59 |
<!-- README_GGUF.md-about-gguf end -->
|
60 |
-
|
61 |
<!-- repositories-available start -->
|
62 |
## Repositories available
|
63 |
|
@@ -74,6 +72,7 @@ The clients and libraries below are expecting to add GGUF support shortly:
|
|
74 |
[INST] Write code to solve the following coding problem that obeys the constraints and passes the example test cases. Please wrap your code answer using ```:
|
75 |
{prompt}
|
76 |
[/INST]
|
|
|
77 |
```
|
78 |
|
79 |
<!-- prompt-template end -->
|
@@ -82,9 +81,7 @@ The clients and libraries below are expecting to add GGUF support shortly:
|
|
82 |
|
83 |
These quantised GGUF files are compatible with llama.cpp from August 21st 2023 onwards, as of commit [6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9](https://github.com/ggerganov/llama.cpp/commit/6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9)
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
They are are not yet compatible with any other third-party UIS, libraries or utilities but this is expected to change very soon.
|
88 |
|
89 |
## Explanation of quantisation methods
|
90 |
<details>
|
@@ -110,27 +107,32 @@ Refer to the Provided Files table below to see what files use which methods, and
|
|
110 |
| [codellama-7b-python.Q3_K_S.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q3_K_S.gguf) | Q3_K_S | 3 | 2.95 GB| 5.45 GB | very small, high quality loss |
|
111 |
| [codellama-7b-python.Q3_K_M.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q3_K_M.gguf) | Q3_K_M | 3 | 3.30 GB| 5.80 GB | very small, high quality loss |
|
112 |
| [codellama-7b-python.Q3_K_L.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q3_K_L.gguf) | Q3_K_L | 3 | 3.60 GB| 6.10 GB | small, substantial quality loss |
|
|
|
113 |
| [codellama-7b-python.Q4_K_S.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q4_K_S.gguf) | Q4_K_S | 4 | 3.86 GB| 6.36 GB | small, greater quality loss |
|
114 |
| [codellama-7b-python.Q4_K_M.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q4_K_M.gguf) | Q4_K_M | 4 | 4.08 GB| 6.58 GB | medium, balanced quality - recommended |
|
|
|
115 |
| [codellama-7b-python.Q5_K_S.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q5_K_S.gguf) | Q5_K_S | 5 | 4.65 GB| 7.15 GB | large, low quality loss - recommended |
|
116 |
| [codellama-7b-python.Q5_K_M.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q5_K_M.gguf) | Q5_K_M | 5 | 4.78 GB| 7.28 GB | large, very low quality loss - recommended |
|
117 |
| [codellama-7b-python.Q6_K.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q6_K.gguf) | Q6_K | 6 | 5.53 GB| 8.03 GB | very large, extremely low quality loss |
|
118 |
-
| [codellama-7b-python.Q8_0.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q8_0.gguf) | Q8_0 | 8 | 7.
|
119 |
|
120 |
**Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
|
|
|
|
|
|
|
121 |
<!-- README_GGUF.md-provided-files end -->
|
122 |
|
123 |
<!-- README_GGUF.md-how-to-run start -->
|
124 |
-
##
|
125 |
|
126 |
Make sure you are using `llama.cpp` from commit [6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9](https://github.com/ggerganov/llama.cpp/commit/6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9) or later.
|
127 |
|
128 |
-
For compatibility with older versions of llama.cpp, or for
|
129 |
|
130 |
```
|
131 |
-
./main -t 10 -ngl 32 -m codellama-7b-python.q4_K_M.gguf --color -c 4096 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "
|
132 |
```
|
133 |
-
Change `-t 10` to the number of physical CPU cores you have. For example if your system has 8 cores/16 threads, use `-t 8`.
|
134 |
|
135 |
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
136 |
|
@@ -143,6 +145,44 @@ For other parameters and how to use them, please refer to [the llama.cpp documen
|
|
143 |
## How to run in `text-generation-webui`
|
144 |
|
145 |
Further instructions here: [text-generation-webui/docs/llama.cpp.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp.md).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
<!-- README_GGUF.md-how-to-run end -->
|
147 |
|
148 |
<!-- footer start -->
|
@@ -168,7 +208,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
|
|
168 |
|
169 |
**Special thanks to**: Aemon Algiz.
|
170 |
|
171 |
-
**Patreon special mentions**:
|
172 |
|
173 |
|
174 |
Thank you to all my generous patrons and donaters!
|
@@ -231,7 +271,7 @@ All variants are available in sizes of 7B, 13B and 34B parameters.
|
|
231 |
|
232 |
**License** A custom commercial license is available at: [https://ai.meta.com/resources/models-and-libraries/llama-downloads/](https://ai.meta.com/resources/models-and-libraries/llama-downloads/)
|
233 |
|
234 |
-
**Research Paper** More information can be found in the paper "[Code Llama: Open Foundation Models for Code](https://ai.meta.com/research/publications/code-llama-open-foundation-models-for-code/)".
|
235 |
|
236 |
## Intended Use
|
237 |
**Intended Use Cases** Code Llama and its variants is intended for commercial and research use in English and relevant programming languages. The base model Code Llama can be adapted for a variety of code synthesis and understanding tasks, Code Llama - Python is designed specifically to handle the Python programming language, and Code Llama - Instruct is intended to be safer to use for code assistant and generation applications.
|
|
|
45 |
|
46 |
The key benefit of GGUF is that it is a extensible, future-proof format which stores more information about the model as metadata. It also includes significantly improved tokenization code, including for the first time full support for special tokens. This should improve performance, especially with models that use new special tokens and implement custom prompt templates.
|
47 |
|
48 |
+
Here are a list of clients and libraries that are known to support GGUF:
|
49 |
+
* [llama.cpp](https://github.com/ggerganov/llama.cpp).
|
50 |
* [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI. Supports GGUF with GPU acceleration via the ctransformers backend - llama-cpp-python backend should work soon too.
|
51 |
* [KoboldCpp](https://github.com/LostRuins/koboldcpp), now supports GGUF as of release 1.41! A powerful GGML web UI, with full GPU accel. Especially good for story telling.
|
52 |
+
* [LM Studio](https://lmstudio.ai/), version 0.2.2 and later support GGUF. A fully featured local GUI with GPU acceleration on both Windows (NVidia and AMD), and macOS.
|
53 |
* [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), should now work, choose the `c_transformers` backend. A great web UI with many interesting features. Supports CUDA GPU acceleration.
|
54 |
* [ctransformers](https://github.com/marella/ctransformers), now supports GGUF as of version 0.2.24! A Python library with GPU accel, LangChain support, and OpenAI-compatible AI server.
|
55 |
* [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), supports GGUF as of version 0.1.79. A Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
|
56 |
* [candle](https://github.com/huggingface/candle), added GGUF support on August 22nd. Candle is a Rust ML framework with a focus on performance, including GPU support, and ease of use.
|
57 |
|
|
|
|
|
58 |
<!-- README_GGUF.md-about-gguf end -->
|
|
|
59 |
<!-- repositories-available start -->
|
60 |
## Repositories available
|
61 |
|
|
|
72 |
[INST] Write code to solve the following coding problem that obeys the constraints and passes the example test cases. Please wrap your code answer using ```:
|
73 |
{prompt}
|
74 |
[/INST]
|
75 |
+
|
76 |
```
|
77 |
|
78 |
<!-- prompt-template end -->
|
|
|
81 |
|
82 |
These quantised GGUF files are compatible with llama.cpp from August 21st 2023 onwards, as of commit [6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9](https://github.com/ggerganov/llama.cpp/commit/6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9)
|
83 |
|
84 |
+
They are now also compatible with many third party UIs and libraries - please see the list at the top of the README.
|
|
|
|
|
85 |
|
86 |
## Explanation of quantisation methods
|
87 |
<details>
|
|
|
107 |
| [codellama-7b-python.Q3_K_S.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q3_K_S.gguf) | Q3_K_S | 3 | 2.95 GB| 5.45 GB | very small, high quality loss |
|
108 |
| [codellama-7b-python.Q3_K_M.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q3_K_M.gguf) | Q3_K_M | 3 | 3.30 GB| 5.80 GB | very small, high quality loss |
|
109 |
| [codellama-7b-python.Q3_K_L.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q3_K_L.gguf) | Q3_K_L | 3 | 3.60 GB| 6.10 GB | small, substantial quality loss |
|
110 |
+
| [codellama-7b-python.Q4_0.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q4_0.gguf) | Q4_0 | 4 | 3.83 GB| 6.33 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
|
111 |
| [codellama-7b-python.Q4_K_S.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q4_K_S.gguf) | Q4_K_S | 4 | 3.86 GB| 6.36 GB | small, greater quality loss |
|
112 |
| [codellama-7b-python.Q4_K_M.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q4_K_M.gguf) | Q4_K_M | 4 | 4.08 GB| 6.58 GB | medium, balanced quality - recommended |
|
113 |
+
| [codellama-7b-python.Q5_0.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q5_0.gguf) | Q5_0 | 5 | 4.65 GB| 7.15 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
|
114 |
| [codellama-7b-python.Q5_K_S.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q5_K_S.gguf) | Q5_K_S | 5 | 4.65 GB| 7.15 GB | large, low quality loss - recommended |
|
115 |
| [codellama-7b-python.Q5_K_M.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q5_K_M.gguf) | Q5_K_M | 5 | 4.78 GB| 7.28 GB | large, very low quality loss - recommended |
|
116 |
| [codellama-7b-python.Q6_K.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q6_K.gguf) | Q6_K | 6 | 5.53 GB| 8.03 GB | very large, extremely low quality loss |
|
117 |
+
| [codellama-7b-python.Q8_0.gguf](https://huggingface.co/TheBloke/CodeLlama-7B-Python-GGUF/blob/main/codellama-7b-python.Q8_0.gguf) | Q8_0 | 8 | 7.16 GB| 9.66 GB | very large, extremely low quality loss - not recommended |
|
118 |
|
119 |
**Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
<!-- README_GGUF.md-provided-files end -->
|
124 |
|
125 |
<!-- README_GGUF.md-how-to-run start -->
|
126 |
+
## Example `llama.cpp` command
|
127 |
|
128 |
Make sure you are using `llama.cpp` from commit [6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9](https://github.com/ggerganov/llama.cpp/commit/6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9) or later.
|
129 |
|
130 |
+
For compatibility with older versions of llama.cpp, or for any third-party libraries or clients that haven't yet updated for GGUF, please use GGML files instead.
|
131 |
|
132 |
```
|
133 |
+
./main -t 10 -ngl 32 -m codellama-7b-python.q4_K_M.gguf --color -c 4096 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "[INST] Write code to solve the following coding problem that obeys the constraints and passes the example test cases. Please wrap your code answer using ```:\nWrite a story about llamas\n[/INST]"
|
134 |
```
|
135 |
+
Change `-t 10` to the number of physical CPU cores you have. For example if your system has 8 cores/16 threads, use `-t 8`. If offloading all layers to GPU, set `-t 1`.
|
136 |
|
137 |
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
138 |
|
|
|
145 |
## How to run in `text-generation-webui`
|
146 |
|
147 |
Further instructions here: [text-generation-webui/docs/llama.cpp.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp.md).
|
148 |
+
|
149 |
+
## How to run from Python code
|
150 |
+
|
151 |
+
You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [ctransformers](https://github.com/marella/ctransformers) libraries.
|
152 |
+
|
153 |
+
### How to load this model from Python using ctransformers
|
154 |
+
|
155 |
+
#### First install the package
|
156 |
+
|
157 |
+
```bash
|
158 |
+
# Base ctransformers with no GPU acceleration
|
159 |
+
pip install ctransformers>=0.2.24
|
160 |
+
# Or with CUDA GPU acceleration
|
161 |
+
pip install ctransformers[cuda]>=0.2.24
|
162 |
+
# Or with ROCm GPU acceleration
|
163 |
+
CT_HIPBLAS=1 pip install ctransformers>=0.2.24 --no-binary ctransformers
|
164 |
+
# Or with Metal GPU acceleration for macOS systems
|
165 |
+
CT_METAL=1 pip install ctransformers>=0.2.24 --no-binary ctransformers
|
166 |
+
```
|
167 |
+
|
168 |
+
#### Simple example code to load one of these GGUF models
|
169 |
+
|
170 |
+
```python
|
171 |
+
from ctransformers import AutoModelForCausalLM
|
172 |
+
|
173 |
+
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
174 |
+
llm = AutoModelForCausalLM.from_pretrained("TheBloke/CodeLlama-7B-Python-GGML", model_file="codellama-7b-python.q4_K_M.gguf", model_type="llama", gpu_layers=50)
|
175 |
+
|
176 |
+
print(llm("AI is going to"))
|
177 |
+
```
|
178 |
+
|
179 |
+
## How to use with LangChain
|
180 |
+
|
181 |
+
Here's guides on using llama-cpp-python or ctransformers with LangChain:
|
182 |
+
|
183 |
+
* [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
|
184 |
+
* [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
|
185 |
+
|
186 |
<!-- README_GGUF.md-how-to-run end -->
|
187 |
|
188 |
<!-- footer start -->
|
|
|
208 |
|
209 |
**Special thanks to**: Aemon Algiz.
|
210 |
|
211 |
+
**Patreon special mentions**: Russ Johnson, J, alfie_i, Alex, NimbleBox.ai, Chadd, Mandus, Nikolai Manek, Ken Nordquist, ya boyyy, Illia Dulskyi, Viktor Bowallius, vamX, Iucharbius, zynix, Magnesian, Clay Pascal, Pierre Kircher, Enrico Ros, Tony Hughes, Elle, Andrey, knownsqashed, Deep Realms, Jerry Meng, Lone Striker, Derek Yates, Pyrater, Mesiah Bishop, James Bentley, Femi Adebogun, Brandon Frisco, SuperWojo, Alps Aficionado, Michael Dempsey, Vitor Caleffi, Will Dee, Edmond Seymore, usrbinkat, LangChain4j, Kacper Wikieł, Luke Pendergrass, John Detwiler, theTransient, Nathan LeClaire, Tiffany J. Kim, biorpg, Eugene Pentland, Stanislav Ovsiannikov, Fred von Graf, terasurfer, Kalila, Dan Guido, Nitin Borwankar, 阿明, Ai Maven, John Villwock, Gabriel Puliatti, Stephen Murray, Asp the Wyvern, danny, Chris Smitley, ReadyPlayerEmma, S_X, Daniel P. Andersen, Olakabola, Jeffrey Morgan, Imad Khwaja, Caitlyn Gatomon, webtim, Alicia Loh, Trenton Dambrowitz, Swaroop Kallakuri, Erik Bjäreholt, Leonard Tan, Spiking Neurons AB, Luke @flexchar, Ajan Kanaga, Thomas Belote, Deo Leter, RoA, Willem Michiel, transmissions 11, subjectnull, Matthew Berman, Joseph William Delisle, David Ziegler, Michael Davis, Johann-Peter Hartmann, Talal Aujan, senxiiz, Artur Olbinski, Rainer Wilmers, Spencer Kim, Fen Risland, Cap'n Zoog, Rishabh Srivastava, Michael Levine, Geoffrey Montalvo, Sean Connelly, Alexandros Triantafyllidis, Pieter, Gabriel Tamborski, Sam, Subspace Studios, Junyu Yang, Pedro Madruga, Vadim, Cory Kujawski, K, Raven Klaugh, Randy H, Mano Prime, Sebastain Graf, Space Cruiser
|
212 |
|
213 |
|
214 |
Thank you to all my generous patrons and donaters!
|
|
|
271 |
|
272 |
**License** A custom commercial license is available at: [https://ai.meta.com/resources/models-and-libraries/llama-downloads/](https://ai.meta.com/resources/models-and-libraries/llama-downloads/)
|
273 |
|
274 |
+
**Research Paper** More information can be found in the paper "[Code Llama: Open Foundation Models for Code](https://ai.meta.com/research/publications/code-llama-open-foundation-models-for-code/)" or its [arXiv page](https://arxiv.org/abs/2308.12950).
|
275 |
|
276 |
## Intended Use
|
277 |
**Intended Use Cases** Code Llama and its variants is intended for commercial and research use in English and relevant programming languages. The base model Code Llama can be adapted for a variety of code synthesis and understanding tasks, Code Llama - Python is designed specifically to handle the Python programming language, and Code Llama - Instruct is intended to be safer to use for code assistant and generation applications.
|