Instructions to use DevShubham/Codellama-7B-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DevShubham/Codellama-7B-Instruct-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DevShubham/Codellama-7B-Instruct-GGUF", device_map="auto")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("DevShubham/Codellama-7B-Instruct-GGUF", dtype="auto", device_map="auto") - llama-cpp-python
How to use DevShubham/Codellama-7B-Instruct-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="DevShubham/Codellama-7B-Instruct-GGUF", filename="codellama-7b-instruct.Q2_K-008.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use DevShubham/Codellama-7B-Instruct-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use DevShubham/Codellama-7B-Instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DevShubham/Codellama-7B-Instruct-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DevShubham/Codellama-7B-Instruct-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M
- SGLang
How to use DevShubham/Codellama-7B-Instruct-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "DevShubham/Codellama-7B-Instruct-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DevShubham/Codellama-7B-Instruct-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "DevShubham/Codellama-7B-Instruct-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DevShubham/Codellama-7B-Instruct-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use DevShubham/Codellama-7B-Instruct-GGUF with Ollama:
ollama run hf.co/DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M
- Unsloth Studio
How to use DevShubham/Codellama-7B-Instruct-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for DevShubham/Codellama-7B-Instruct-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for DevShubham/Codellama-7B-Instruct-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for DevShubham/Codellama-7B-Instruct-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use DevShubham/Codellama-7B-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M
- Lemonade
How to use DevShubham/Codellama-7B-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull DevShubham/Codellama-7B-Instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Codellama-7B-Instruct-GGUF-Q4_K_M
List all available models
lemonade list
Update README.md
Browse files
README.md
CHANGED
|
@@ -96,25 +96,6 @@ Refer to the Provided Files table below to see what files use which methods, and
|
|
| 96 |
<!-- compatibility_gguf end -->
|
| 97 |
|
| 98 |
<!-- README_GGUF.md-provided-files start -->
|
| 99 |
-
## Provided files
|
| 100 |
-
|
| 101 |
-
| Name | Quant method | Bits | Size | Max RAM required | Use case |
|
| 102 |
-
| ---- | ---- | ---- | ---- | ---- | ----- |
|
| 103 |
-
| [codellama-13b-instruct.Q2_K.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q2_K.gguf) | Q2_K | 2 | 5.43 GB| 7.93 GB | smallest, significant quality loss - not recommended for most purposes |
|
| 104 |
-
| [codellama-13b-instruct.Q3_K_S.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q3_K_S.gguf) | Q3_K_S | 3 | 5.66 GB| 8.16 GB | very small, high quality loss |
|
| 105 |
-
| [codellama-13b-instruct.Q3_K_M.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q3_K_M.gguf) | Q3_K_M | 3 | 6.34 GB| 8.84 GB | very small, high quality loss |
|
| 106 |
-
| [codellama-13b-instruct.Q3_K_L.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q3_K_L.gguf) | Q3_K_L | 3 | 6.93 GB| 9.43 GB | small, substantial quality loss |
|
| 107 |
-
| [codellama-13b-instruct.Q4_0.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q4_0.gguf) | Q4_0 | 4 | 7.37 GB| 9.87 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
|
| 108 |
-
| [codellama-13b-instruct.Q4_K_S.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q4_K_S.gguf) | Q4_K_S | 4 | 7.41 GB| 9.91 GB | small, greater quality loss |
|
| 109 |
-
| [codellama-13b-instruct.Q4_K_M.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q4_K_M.gguf) | Q4_K_M | 4 | 7.87 GB| 10.37 GB | medium, balanced quality - recommended |
|
| 110 |
-
| [codellama-13b-instruct.Q5_0.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q5_0.gguf) | Q5_0 | 5 | 8.97 GB| 11.47 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
|
| 111 |
-
| [codellama-13b-instruct.Q5_K_S.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q5_K_S.gguf) | Q5_K_S | 5 | 8.97 GB| 11.47 GB | large, low quality loss - recommended |
|
| 112 |
-
| [codellama-13b-instruct.Q5_K_M.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q5_K_M.gguf) | Q5_K_M | 5 | 9.23 GB| 11.73 GB | large, very low quality loss - recommended |
|
| 113 |
-
| [codellama-13b-instruct.Q6_K.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q6_K.gguf) | Q6_K | 6 | 10.68 GB| 13.18 GB | very large, extremely low quality loss |
|
| 114 |
-
| [codellama-13b-instruct.Q8_0.gguf](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/blob/main/codellama-13b-instruct.Q8_0.gguf) | Q8_0 | 8 | 13.83 GB| 16.33 GB | very large, extremely low quality loss - not recommended |
|
| 115 |
-
|
| 116 |
-
**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.
|
| 117 |
-
|
| 118 |
|
| 119 |
|
| 120 |
<!-- README_GGUF.md-provided-files end -->
|
|
@@ -146,7 +127,7 @@ pip3 install huggingface-hub>=0.17.1
|
|
| 146 |
Then you can download any individual model file to the current directory, at high speed, with a command like this:
|
| 147 |
|
| 148 |
```shell
|
| 149 |
-
huggingface-cli download
|
| 150 |
```
|
| 151 |
|
| 152 |
<details>
|
|
@@ -155,7 +136,7 @@ huggingface-cli download TheBloke/CodeLlama-13B-Instruct-GGUF codellama-13b-inst
|
|
| 155 |
You can also download multiple files at once with a pattern:
|
| 156 |
|
| 157 |
```shell
|
| 158 |
-
huggingface-cli download
|
| 159 |
```
|
| 160 |
|
| 161 |
For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
|
|
@@ -222,7 +203,7 @@ CT_METAL=1 pip install ctransformers>=0.2.24 --no-binary ctransformers
|
|
| 222 |
from ctransformers import AutoModelForCausalLM
|
| 223 |
|
| 224 |
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
| 225 |
-
llm = AutoModelForCausalLM.from_pretrained("
|
| 226 |
|
| 227 |
print(llm("AI is going to"))
|
| 228 |
```
|
|
@@ -237,14 +218,7 @@ Here's guides on using llama-cpp-python or ctransformers with LangChain:
|
|
| 237 |
<!-- README_GGUF.md-how-to-run end -->
|
| 238 |
|
| 239 |
<!-- footer start -->
|
| 240 |
-
<!-- 200823 -->
|
| 241 |
-
## Discord
|
| 242 |
-
|
| 243 |
-
For further support, and discussions on these models and AI in general, join us at:
|
| 244 |
|
| 245 |
-
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
| 246 |
-
|
| 247 |
-
## Thanks, and how to contribute
|
| 248 |
|
| 249 |
Thanks to the [chirper.ai](https://chirper.ai) team!
|
| 250 |
|
|
@@ -256,14 +230,6 @@ If you're able and willing to contribute it will be most gratefully received and
|
|
| 256 |
|
| 257 |
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
| 258 |
|
| 259 |
-
* Patreon: https://patreon.com/TheBlokeAI
|
| 260 |
-
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
| 261 |
-
|
| 262 |
-
**Special thanks to**: Aemon Algiz.
|
| 263 |
-
|
| 264 |
-
**Patreon special mentions**: Alicia Loh, Stephen Murray, K, Ajan Kanaga, RoA, Magnesian, Deo Leter, Olakabola, Eugene Pentland, zynix, Deep Realms, Raymond Fosdick, Elijah Stavena, Iucharbius, Erik Bjäreholt, Luis Javier Navarrete Lozano, Nicholas, theTransient, John Detwiler, alfie_i, knownsqashed, Mano Prime, Willem Michiel, Enrico Ros, LangChain4j, OG, Michael Dempsey, Pierre Kircher, Pedro Madruga, James Bentley, Thomas Belote, Luke @flexchar, Leonard Tan, Johann-Peter Hartmann, Illia Dulskyi, Fen Risland, Chadd, S_X, Jeff Scroggin, Ken Nordquist, Sean Connelly, Artur Olbinski, Swaroop Kallakuri, Jack West, Ai Maven, David Ziegler, Russ Johnson, transmissions 11, John Villwock, Alps Aficionado, Clay Pascal, Viktor Bowallius, Subspace Studios, Rainer Wilmers, Trenton Dambrowitz, vamX, Michael Levine, 준교 김, Brandon Frisco, Kalila, Trailburnt, Randy H, Talal Aujan, Nathan Dryer, Vadim, 阿明, ReadyPlayerEmma, Tiffany J. Kim, George Stoitzev, Spencer Kim, Jerry Meng, Gabriel Tamborski, Cory Kujawski, Jeffrey Morgan, Spiking Neurons AB, Edmond Seymore, Alexandros Triantafyllidis, Lone Striker, Cap'n Zoog, Nikolai Manek, danny, ya boyyy, Derek Yates, usrbinkat, Mandus, TL, Nathan LeClaire, subjectnull, Imad Khwaja, webtim, Raven Klaugh, Asp the Wyvern, Gabriel Puliatti, Caitlyn Gatomon, Joseph William Delisle, Jonathan Leane, Luke Pendergrass, SuperWojo, Sebastain Graf, Will Dee, Fred von Graf, Andrey, Dan Guido, Daniel P. Andersen, Nitin Borwankar, Elle, Vitor Caleffi, biorpg, jjj, NimbleBox.ai, Pieter, Matthew Berman, terasurfer, Michael Davis, Alex, Stanislav Ovsiannikov
|
| 265 |
-
|
| 266 |
-
|
| 267 |
Thank you to all my generous patrons and donaters!
|
| 268 |
|
| 269 |
And thank you again to a16z for their generous grant.
|
|
|
|
| 96 |
<!-- compatibility_gguf end -->
|
| 97 |
|
| 98 |
<!-- README_GGUF.md-provided-files start -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
|
| 100 |
|
| 101 |
<!-- README_GGUF.md-provided-files end -->
|
|
|
|
| 127 |
Then you can download any individual model file to the current directory, at high speed, with a command like this:
|
| 128 |
|
| 129 |
```shell
|
| 130 |
+
huggingface-cli download DevShubham/Codellama-7B-Instruct-GGUF codellama-13b-instruct.q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
|
| 131 |
```
|
| 132 |
|
| 133 |
<details>
|
|
|
|
| 136 |
You can also download multiple files at once with a pattern:
|
| 137 |
|
| 138 |
```shell
|
| 139 |
+
huggingface-cli download DevShubham/Codellama-7B-Instruct-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
|
| 140 |
```
|
| 141 |
|
| 142 |
For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
|
|
|
|
| 203 |
from ctransformers import AutoModelForCausalLM
|
| 204 |
|
| 205 |
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
| 206 |
+
llm = AutoModelForCausalLM.from_pretrained("DevShubham/Codellama-7B-Instruct-GGUF", model_file="codellama-13b-instruct.q4_K_M.gguf", model_type="llama", gpu_layers=50)
|
| 207 |
|
| 208 |
print(llm("AI is going to"))
|
| 209 |
```
|
|
|
|
| 218 |
<!-- README_GGUF.md-how-to-run end -->
|
| 219 |
|
| 220 |
<!-- footer start -->
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
|
|
|
|
|
|
|
|
|
|
| 222 |
|
| 223 |
Thanks to the [chirper.ai](https://chirper.ai) team!
|
| 224 |
|
|
|
|
| 230 |
|
| 231 |
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
| 232 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
Thank you to all my generous patrons and donaters!
|
| 234 |
|
| 235 |
And thank you again to a16z for their generous grant.
|