Instructions to use TheBloke/CodeLlama-7B-Python-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/CodeLlama-7B-Python-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TheBloke/CodeLlama-7B-Python-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TheBloke/CodeLlama-7B-Python-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use TheBloke/CodeLlama-7B-Python-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 TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/CodeLlama-7B-Python-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 TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
Use Docker
docker model run hf.co/TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use TheBloke/CodeLlama-7B-Python-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TheBloke/CodeLlama-7B-Python-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheBloke/CodeLlama-7B-Python-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
- SGLang
How to use TheBloke/CodeLlama-7B-Python-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 "TheBloke/CodeLlama-7B-Python-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": "TheBloke/CodeLlama-7B-Python-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 "TheBloke/CodeLlama-7B-Python-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": "TheBloke/CodeLlama-7B-Python-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use TheBloke/CodeLlama-7B-Python-GGUF with Ollama:
ollama run hf.co/TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use TheBloke/CodeLlama-7B-Python-GGUF with Docker Model Runner:
docker model run hf.co/TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
- Lemonade
How to use TheBloke/CodeLlama-7B-Python-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.CodeLlama-7B-Python-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Commit History
-
Update base_model formatting
3c6970f
-
Upload README.md
b09c67c
-
Upload README.md
dcd7825
-
Upload README.md
f848c2c -
Upload README.md
b3633fd -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
27dbdf0 -
Add Llama 2 license files
335af58 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
1b06c06 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
b18e28d -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
bbd726f -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
bc85d3e -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
365e5f8 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
7bcc1dd -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
f3e10d8 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
5dcadd7 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
6c71f21 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
68ee8f4 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
90bd2dc -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
d687884
-
Initial GGUF model commit
1e85574 -
Initial GGUF model commit
f2927b5 -
Add Llama 2 license files
8c709d1 -
Add Llama 2 license files
08437cd -
Add Llama 2 license files
c3c91ef -
Initial GGUF model commit
cb7ee1b -
Initial GGUF model commit
a855e41 -
Add Llama 2 license files
b372d5a -
Add Llama 2 license files
b4476f9 -
Add Llama 2 license files
93a8d97 -
Initial GGUF model commit
0f0db35 -
Initial GGUF model commit
cc31bf6 -
Add Llama 2 license files
04549d8 -
Add Llama 2 license files
bd86951 -
Add Llama 2 license files
2130841 -
Initial GGUF model commit
8626746 -
Add Llama 2 license files
a6c5b7f -
Add Llama 2 license files
19caaed -
Add Llama 2 license files
e9ee1d7
-
Initial GGUF model commit
3a607fa -
Initial GGUF model commit
9c9cb36 -
Add Llama 2 license files
7fa9c90 -
Add Llama 2 license files
4f75ac4 -
Add Llama 2 license files
cb20025 -
Initial GGUF model commit
c0e4377 -
Initial GGUF model commit
ca80b1b -
Add Llama 2 license files
b9c5b2c -
Add Llama 2 license files
d480687 -
Add Llama 2 license files
ed20e49 -
Update README.md
bad2278
-
Initial GGUF model commit
1f853a1